8

I'm using postgrey on all my MX servers (main and 2 backups). I need to disable greylisting on a main server when receiving mails from backup server. How to do that?

When I add IP/FQDN to /etc/postgrey/whitelist_clients, it doesn't help.

Specifying POSTGREY_OPTS="--inet=10023 --whitelist-clients=/etc/postgrey/whitelist_clients" in /etc/default/postgrey didn't help either.

Alexis Wilke
  • 2,707
Xdg
  • 223
  • 1
  • 3
  • 9
  • Can you check your init script to see whether /etc/default/postgrey is read while starting the postgrey service? – clement Apr 21 '14 at 16:27
  • It looks like so.

    Read config file if it is present.

    if [ -r /etc/default/$NAME ] then . /etc/default/$NAME fi and NAME=postgrey. It's Ubuntu default.

    – Xdg Apr 21 '14 at 16:54

2 Answers2

7

You performed the right steps, adding to whitelist_clients. It is better to create a new file whitelist_clients.local, which is not modified while upgrading the postgrey package and is also read by postgrey. Then, restart postgrey.

But, due to a bug in the Debian postgrey init script, postgrey is not actually being restarted by running service postgrey restart (even stopping it is broken). Either restart the whole machine, or kill the postgrey process manually and start it again (using service postgrey start).

The issue is told to be fixed in June 2014 and restart is hopefully working in future Debian/Ubuntu releases.

ravery
  • 6,874
Jens Erat
  • 5,051
  • 7
  • 31
  • 37
  • 1
    I just tested in Ubuntu 14.04 and indeed, the service postgrey stop does nothing. A good ol' kill <pid> though... works as expected. Then you can just do a start and it restarts. – Alexis Wilke May 24 '16 at 20:19
  • In debian 8.5 postgrey is properly restarted, Although there still is this in the log: "Couldn't unlink "/var/run/postgrey.pid" [Permission denied]" – Lenne Oct 21 '16 at 14:24
  • If you use 'kill -9', you won't delete the '/var/run/postgrey.pid' file, which would cause that problem. – Mr Ed Apr 17 '19 at 08:49
1

What worked for me (Ubuntu 12.04) was adding the offending domains to '/etc/postgrey/whitelist_clients' (whitelist_clients.local didn't work for me), using 'kill -9' on the postgrey process, deleting '/var/run/postgrey.pid', then 'service postgrey start'.

My problems were caused by outlook.com (hotmail, outlook, etc), which appears to retry sending on many different IPs, which isn't handled by postgrey very well, i.e. it doesn't get the same IP twice so the email message isn't accepted.

Mr Ed
  • 141
  • 2