Greylist filtering is enabled by default when Mail service is turned on. This can result in messages not being delivered as quickly as you might anticipate.
With greylist filtering, mail service records the IP address of the server sending the message, the email address of the sender, and the recipient’s email address into a local database. The first time a particular combination of these three attributes is recorded, mail service then rejects the message with a temporary error and logs this into mail.log. For the next 60 seconds, any other messages sent with the same attributes are also rejected. If the same message is sent again after 60 seconds, it’s accepted for delivery.
This works because legitimate SMTP servers, upon receipt of the temporary error, will re-queue the message and retry to deliver the message at a later time. Junk mail servers rarely follow this requirement. This means that the first time a particular set of those three attributes is used the message will be delayed until the sending server resends the message, but the message will go through. Subsequent messages are delivered immediately.
Click the pop-up menu at the bottom of the Logs pane, then choose SMTP Log.
Look for entries that begin with, “Temporary message rejection.”
Any entry for a greylisted message will look something like:
Temporary message rejection to: user@yourhostname from: sender@mail.example.com sent from: [sendingIPaddress] for: 60 seconds due to greylisting
When you create a whitelist, you’re listing servers that are known good servers.
Create a text file:
touch host-whitelist.txt
Edit the text file:
vi host-whitelist.txt
Add the following three lines, replacing the name on the third line with the name of the mail server you would like to whitelist:
mail:command = writeSettings
mail:skipReadSettings = yes
mail:configuration:postfix:host_whitelist:_array_index:0 = "goodMailServer"
Load these settings into serveradmin
:
sudo serveradmin command < host-whitelist.txt
View the current whitelist settings:
sudo serveradmin settings mail:postfix:host_whitelist
A result like the following would indicate that mail.example.com is on the whitelist and so messages from it will be delivered as expected:
mail:postfix:host_whitelist:_array_index:0 = "mail.example.com"