modifying /etc/default/postgrey variable "POSTGREY_TEXT" does not change postgrey text when an email is greylisted

Bug #1393768 reported by flrichar
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
postgrey (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

Modifying the POSTGREY_TEXT variable under /etc/default/postgrey does not properly set the greylisting text. It's some sort of parsing error. I've tried setting it as below:

POSTGREY_TEXT="Greylisted for auditing."

I've also modified the init script, it seems as if it's including a carriage return or setting the entire string to null, so it doesn't include the --greylist-text option on bootup.

I have postgrey working with the greylist text option under a different distro, having to modify its systemctl startup scripts.

Revision history for this message
Ewen McNeill (ewen) wrote :
Download full text (3.7 KiB)

I ran into what looked like this problem (on Ubuntu 14.04 LTS, with the postgrey 1.34-1.2 package).

After a bunch of debugging it turned out that neither "service postgrey stop" nor "service postgrey restart" were actually _stopping_ the postgrey daemon, which meant it never started with the new parameters (which meant it kept using the default text). Once I realised that and manually killed the old postgrey daemon ("ps ax | grep postgrey", "kill $PID") and verified it was gone, I could then do "service postgrey start" and (a) the new text appeared on the command line ("ps ax | grep postgrey") and (b) the new text was used in the log/SMTP session.

So it appears the root cause is that "service postgrey stop" does not in fact result in stopping postgrey, despite claiming to. (Even when run with "sudo") Because the "stop" has "oknodo" and "quiet" on it, there's apparently no logging of the fact nothing stopped.

-=- cut here -=-
ewen@imatixmailweb:~$ ps axu | grep [p]ostgrey
postgrey 11217 0.0 1.1 17912 11004 ? Ss 03:05 0:00 /usr/sbin/postgrey --pidfile=/var/run/postgrey.pid --daemonize --inet=10023 --greylist-text=Your message has been greylisted. Please retry in %s seconds.
ewen@imatixmailweb:~$ sudo start-stop-daemon --stop --oknodo --quiet --pidfile /var/run/postgrey.pid --name postgrey
ewen@imatixmailweb:~$ ps axu | grep [p]ostgrey
postgrey 11217 0.0 1.1 17912 11004 ? Ss 03:05 0:00 /usr/sbin/postgrey --pidfile=/var/run/postgrey.pid --daemonize --inet=10023 --greylist-text=Your message has been greylisted. Please retry in %s seconds.
ewen@imatixmailweb:~$
-=- cut here -=-

Removing "oknodo" and "quiet" reveals that "stop" is not actually doing anything:

-=- cut here -=-
ewen@imatixmailweb:~$ sudo start-stop-daemon --stop --pidfile /var/run/postgrey.pid --name postgrey
No postgrey found running; none killed.
ewen@imatixmailweb:~$ ps axu | grep [p]ostgrey
postgrey 11217 0.0 1.1 17912 11004 ? Ss 03:05 0:00 /usr/sbin/postgrey --pidfile=/var/run/postgrey.pid --daemonize --inet=10023 --greylist-text=Your message has been greylisted. Please retry in %s seconds.
ewen@imatixmailweb:~$
-=- cut here -=-

even though it is in fact still running (these tests done after I'd already done the kill/restart, to try to find out why "stop" didn't).

I think the problem is that the name match doesn't match, because it works without that:

-=- cut here -=-
ewen@imatixmailweb:~$ sudo start-stop-daemon --stop --pidfile /var/run/postgrey.pid
ewen@imatixmailweb:~$ ps axu | grep [p]ostgrey
ewen@imatixmailweb:~$
-=- cut here -=-

And I think that in turn is due to postgrey being a Perl script, so the executable running is perl, not "postgrey". Eg,

-=- cut here -=-
ewen@imatixmailweb:~$ ps axu | grep [p]ostgrey
postgrey 11302 0.0 1.1 17920 10984 ? Ss 03:16 0:00 /usr/sbin/postgrey --pidfile=/var/run/postgrey.pid --daemonize --inet=10023 --greylist-text=Your message has been greylisted. Please retry in %s seconds.
ewen@imatixmailweb:~$ sudo ls -l /proc/11302 | grep exe
lrwxrwxrwx 1 root root 0 Sep 9 03:18 exe -> /usr/bin/perl
ewen@imatixmailweb:~$
-=- cut here -=-

which means the "name" check...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in postgrey (Ubuntu):
status: New → Confirmed
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.