postgrey not starting after release upgrade

Bug #1252441 reported by Shinji
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
postgrey (Ubuntu)
Incomplete
Undecided
Rolf Leggewie

Bug Description

Hi!

After upgrading my server from ubuntu 13.04 to 13.10 the "postgrey" daemon does not start.

If I call

===
root@mail /home/shinji # /etc/init.d/postgrey start
 * Starting postfix greylisting daemon postgrey [ OK]
===

everything seems to be fine. But I get this in my logfiles:

===
Nov 18 20:42:09 mail postfix/smtpd[4031]: warning: connect to 127.0.0.1:10023: Connection refused
Nov 18 20:42:09 mail postfix/smtpd[4031]: warning: problem talking to server 127.0.0.1:10023: Connection refused
===

So postgrey is not running :(

===
root@mail /home/shinji # sudo netstat -pln | grep postgrey
root@mail /home/shinji #
===

My "/etc/default/postgrey" file looks like this

===
POSTGREY_OPTS="--inet=10023 --delay=120 --max-age=90"
===

And if I try to start it as 'root' with

===
postgrey --inet 10023
==

i'll get this:

===
2013/11/18-20:45:59 postgrey (type Net::Server::Multiplex) starting! pid(4063)
Resolved [localhost]:10023 to [127.0.0.1]:10023, IPv4
Binding to TCP port 10023 on host 127.0.0.1 with IPv4
Insecure dependency in bind while running with -T switch at /usr/lib/perl/5.14/IO/Socket.pm line 202.
===

Revision history for this message
Shinji (thorsten-reichelt) wrote :

I did an

===
 apt-get remove --purge postgrey
===

After that I rebooted the server and entered

===
 apt-get install postgrey
===

But this is the result:

===
root@mail /home/shinji # service postgrey start
 * Starting postfix greylisting daemon postgrey [ OK ]
root@mail /home/shinji # lsof -i TCP:10023
root@mail /home/shinji #
===

:(

Revision history for this message
Shinji (thorsten-reichelt) wrote :

I can start postgrey by calling

====

root@mail /home/shinji # postgrey -v --inet=127.0.0.1:10023
2013/11/18-22:15:33 postgrey (type Net::Server::Multiplex) starting! pid(3239)
Binding to TCP port 10023 on host 127.0.0.1 with IPv4
Setting gid to "116 116"
Setting uid to "109"

====

But it WILL NOT start by calling "/etc/init.d/postgrey start" or "service postgrey start"!

Revision history for this message
Marius Gedminas (mgedmin) wrote :

Given that I use postgrey on my servers, and that I will upgrade to 14.04 LTS when it comes out, I decided to try some preventative maintenance and see if postgrey is really broken on 13.10.

I was unable to reproduce your problem:

    $ sudo apt-get install postgrey

    $ ps $(cat /var/run/postgrey.pid)
      PID TTY STAT TIME COMMAND
    17720 ? Ss 0:00 /usr/sbin/postgrey --pidfile=/var/run/postgrey.pid --daemonize --inet=10023

    $ sudo lsof -i TCP:10023
    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
    /usr/sbin 17720 postgrey 6u IPv4 2248799 0t0 TCP localhost:10023 (LISTEN)

    $ less /var/log/syslog
    Nov 19 09:56:41 platonas postgrey[17720]: Process Backgrounded
    Nov 19 09:56:41 platonas postgrey[17720]: 2013/11/19-09:56:41 postgrey (type Net::Server::Multiplex) starting! pid(17720)
    Nov 19 09:56:41 platonas postgrey[17720]: Resolved [localhost]:10023 to [127.0.0.1]:10023, IPv4
    Nov 19 09:56:41 platonas postgrey[17720]: Binding to TCP port 10023 on host 127.0.0.1 with IPv4
    Nov 19 09:56:41 platonas postgrey[17720]: Setting gid to "139 139"
    Nov 19 09:56:41 platonas postgrey[17720]: Setting uid to "127"
    Nov 19 09:59:45 platonas postgrey[17720]: 2013/11/19-09:59:45 Server closing!

Hm.

Revision history for this message
Shinji (thorsten-reichelt) wrote :

I can start postgrey with

===
service postgrey start
===

If I remove the "-T" parameter from "/usr/sbin/postgrey"! So instead of

===
#!/usr/bin/perl -T -w
===

I have to write

===
#!/usr/bin/perl -w
===

Now postgrey starts again. It seems that disabling the perl tainted mode solves the problem. But I guess this opens some security holes. :(

Revision history for this message
Shinji (thorsten-reichelt) wrote :

Ok, my final solution is now to edit the postgrey pearl file as described here:

https://github.com/yasuhirokimura/postgrey/commit/9673b54064691a5b9c295ffea340d8a1f9ee1cb8

But I am running Perl 5.14 and not 4.18!

description: updated
Revision history for this message
Rolf Leggewie (r0lf) wrote :

Is this still an issue in xenial or later?

Changed in postgrey (Ubuntu):
assignee: nobody → Rolf Leggewie (r0lf)
status: New → Incomplete
Revision history for this message
Rolf Leggewie (r0lf) wrote :

ping shinji

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.