Having a Mail server running on Mac OS X 10.7.5 (Lion) and having "Junk Mail Filtering" enabled, causes greylisting to kick in on every received message. An example:
Dec 23 22:05:45 servername /usr/libexec/postfix/greylist.pl[89032]: Temporary message rejection to: <user@host.tld> from: <nobody@linux3.s12.com.br> sent from: [50.23.172.250] for: 60 seconds due to greylisting
That is nice for spam prevention, but not so nice for customers submitting orders through a PHP formmail at our web site. This causes a delay before order messages are being delivered to our mailbox. Our web site is being hosted by a third party web hosting firm.
How to exclude the messages sent via our web hosting firm from greylisting?
Best Answer
As this is 10.7 Server, the 10.8 command:
can't be used in this case.
1. Create an exception file
2. Fill this file with domains that are OK to be excluded from the (greylist) policy
3. Create database from text file
4. Modify the Mac OS Lion SMTP server configuration
This configuration change allows the domains configured in the exception file to bypass running the greylist check. Therefore open up the main.cf, for example using the
nano
editor:Search for the line that starts with
smtpd_recipient_restrictions =
, for example using the key combination Ctrl + WThe line might look like:
For readability I am writing this one line now as multiple lines:
After
reject_unauth_destination
and beforecheck_policy_service unix:private/policy
some new text has to be inserted. The new text tells the mail server to look in the newly created file. The magic words to insert are:check_sender_access hash:/etc/postfix/sender_access
.Now the
smtpd_recipient_restrictions
looks like:Or written as a single line, it looks like:
To save the change press Ctrl + O, and to exit the nano editor press Ctrl + X.
5. Make the configuration changed become effective
And presto, now the web form mail messages arrive without greylisting delay.
PS You can also use the sender_access file to reject users, by adding lines like:
user@abadboy.com REJECT