The installation process is really simple. All you need is the package named
postgrey, which can be installed using the following command.
sudo aptitude install postgrey
Now, you can optionally conﬁgure the postgrey daemon using the ﬁle
/etc/default/postgrey. I am using the default values (did not touch the ﬁle) and everything runs ﬁne as it seems. By the way, right after installation, the server should be up and running alreay. Do not forget to restart it, after re-conﬁguration (
Now we need to tell postﬁx to use postgrey accordingly. Therefore, you need to change the conﬁguration ﬁle to the following lines.
smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination, check_policy_service inet:127.0.0.1:60000
You should check the connection address and port (maybe using
ps ax | grep postgrey) and change it accordingly - although, if you are using the default setup, it should be the very same setting. Save and close the ﬁle and reload the mail server conﬁguration by invoking
sudo postfix reload
That’s it. The SPAM ﬂow should be ended :)