Greylistning not working / running

Hi,

I have some trouble with getting greylisting to work. First I enabled greylisting from virtualmin but no emails got delivered.

/var/log/syslog
Mar 24 22:00:17 [SERVER_HOSTNAME] postfix/smtpd[25943]: warning: connect to 127.0.0.1:10023: Connection timed out
Mar 24 22:00:17 [SERVER_HOSTNAME] postfix/smtpd[25943]: warning: problem talking to server 127.0.0.1:10023: Connection timed out
Mar 24 22:00:17 [SERVER_HOSTNAME] postfix/smtpd[25943]: NOQUEUE: reject: RCPT from unknown[REMOTE_SERVER_PUBLIC_IP]: 451 4.3.5 Server configuration problem; from=johndoe@sender.com to=johndoe@reciver.com proto=ESMTP helo=<mail.sender.com>

I found some threads in this forum suggesting the following change:

/etc/default/postgrey
POSTGREY_OPTS="–inet=10023"

to

POSTGREY_OPTS="–inet=127.0.0.01:10023"

But this didn’t work so I figured I’d disable the greylisting for the moment but I think something messed up the postfix configuration.

/var/log/syslog
Mar 24 23:40:48 [SERVER_HOSTNAME] postfix/smtpd[2057]: connect from [RDNS][REMOTE_IP]
Mar 24 23:40:48 [SERVER_HOSTNAME] postfix/smtpd[2057]: warning: restriction check_policy_service must be followed by transport:server
Mar 24 23:40:48 [SERVER_HOSTNAME] postfix/smtpd[2057]: NOQUEUE: reject: RCPT from [RDNS][SENDER IP]: 451 4.3.5 Server configuration error; from=johndoe@sender.com to=johndoe@reciver.com proto=ESMTP helo=<mail.sender.com>

So I once again found the solution in this forum

/etc/postfix/main.cf
Removed: check_policy_service

Now, I would like to get greylisting to work, I know it worked for half a day since I could send and recive emails and have this log:

Mar 24 14:32:12 [SERVER_HOSTNAME] postgrey[545]: action=pass, reason=triplet found, client_name=RDNS, client_address=[SENDER_IP], sender=johndoe@sender.com, recipient=johndoe@reciver.com

  • Ubuntu 14.04 LTS
  • Latest Webmin / Virtualmin
  • Only running ipv4 so maybe this is the issue ?
  • Running iptables in Webmin with default action drop and all web and mail ports opened (80, 443, 25, 143 etc etc)

Any ideas how to solve this?

Howdy,

Well, let’s start here and make sure that Postgrey is running… what is the output of this command:

netstat -an | grep :10023

Hi andreychek,

Yesterday I ran the postgrey status command and it returned “not running”.

Let me just enable greylisting again and run the netstat command.

Here is the command from netstat -an | grep :10023

tcp 0 0 127.0.0.1:10023 0.0.0.0:* LISTEN

I’ve also tried to send an email from my Zimbra installation, it got greylisted so waiting for Zimbra to send the email again. But it seems to be working now. Let me just evaluate a little bit more.

Mar 25 09:43:03 [SERVER_HOSTNAME] postfix/smtpd[1715]: connect from dub004-omc2s35.hotmail.com[157.55.1.174]
Mar 25 09:43:03 [SERVER_HOSTNAME] postgrey[1487]: action=greylist, reason=early-retry (122s missing), client_name=dub004-omc2s35.hotmail.com, client_address=157.55.1.174, sender=johndoe@sender.com, recipient=johndoe@reciver.com
Mar 25 09:43:03 [SERVER_HOSTNAME] postfix/smtpd[1715]: NOQUEUE: reject: RCPT from dub004-omc2s35.hotmail.com[157.55.1.174]: 450 4.2.0 johndoe@reciver.com: Recipient address rejected: Greylisted, see http://postgrey.schweikert.ch/help/twitchplayer.com.html; from=johndoe@sender.com to=johndoe@reciver.com proto=ESMTP helo=<DUB004-OMC2S35.hotmail.com>
Mar 25 09:43:03 euve112262 postfix/smtpd[1715]: disconnect from dub004-omc2s35.hotmail.com[157.55.1.174]

Seems to be working now, don’t know what happend yesterday. I also tried to restart the server to be 100% sure but it’s still working.

I notice one thing that happend yesterday, I was updating my DNS servers to google DNS from (Webmin < Networking < Network configuration) and my hostname got messed up on save.

Before save: Hostname: server.domain.com
After save: Hostname: server

of course I changed the hostname back but maybe this was the cause ?

Howdy,

Hmm, it’s hard to say, but I’m glad to hear it’s working for you now!

-Eric

postgrey has been a nightmare on Ubuntu+Virtualmin. Always crashing.
I ended up using gld from https://www.gasmi.net/progs.php and never had a problem.