Mailinabox: How to completely deactivate greylisting

What is greylisting?

If you’re running a mailinabox instance, you might have noticed, that most mails only arrive after a delay of about 5 to 10 minutes. This is a huge nuisance, especially with confirmation mails when registering new accounts at platforms like GitHub, X, Facebook or actually any website that sends you a mail with a confirmation link.

It get’s especially bad if the confirmation link has a tight timeout (a couple of minutes), because you might not receive the mail, befor the link no longer works.

The reason for this behaviour is greylisting, a functionality where the mailserver rejects an incoming mail the first time a delivery attempt is being made. Only when the remote mailserver tries to deliver the same mail a second time (usually after a couple of minutes) the receiving mailserver will accept the mail.

How to deactivate greylisting

Deactivating greylisting on your mailinabox instance is pretty straightforward, simply create a file /etc/postgrey/whitelist_clients.local with the following contents:

# completely disable greylisting
/.*/

This is a regular expression, that whitelists all sending domains (so no mail gets greylisted).

If you want to indulge, you can also just allow some domains to send you mails without greylisting. One regex per line.

To make your changes take effect you then simply need to reload the postgrey service with the following command:

systemctl reload postgrey