From ArchWiki
< Postfix
Revision as of 18:36, 28 November 2016 by MichaelRpdx (talk | contribs) (Add reminder about --inet and --unix not working together, postfix uses the socket implementation.)
Jump to navigation Jump to search

Merge-arrows-2.pngThis article or section is a candidate for merging with Postfix.Merge-arrows-2.png

Notes: Short enough, and Postfix is already listing other addons. (Discuss in Talk:Postfix/Postgrey#)

Tango-edit-clear.pngThis article or section needs language, wiki syntax or style improvements. See Help:Style for reference.Tango-edit-clear.png

Reason: See Help:Style. (Discuss in Talk:Postfix/Postgrey#)

Postgrey can be used to enable greylisting for a Postfix mail server.


Install the postgrey package. To get it running quickly edit the Postfix configuration file and add these lines:

smtpd_recipient_restrictions =
  check_policy_service inet:

Then start/enable the postgrey service. Afterwards, reload the postfix service. Now greylisting should be enabled.


Configuration is done via editing the greylist.service file. First copy it over to edit it.

# cp /usr/lib/systemd/system/postgrey.service /etc/systemd/system/

Now you can edit it. For example, to add automatic whitelisting (successful deliveries are whitelisted and don't have to wait any more), you could add the --auto-whitelist-clients=N option and replace N by a suitably small number (or leave it at its default of 5).


If you specify --unix=/path/to/socket and the socket file is not created ensure you have removed the default --inet= from the service file.

For a full documentation of possible options see perldoc postgrey.