HOWTO: #Ispconfig3 #Postfix #Greylisting

No-to-Spam
Just a little manual 🙂
Assuming that you have Ispconfig3 with postfix installed, it’s very easy to get rid of spam that passes your filters, despite the fact that Ispconfig has a anti-spam engine onboard.

I am on Debian 8 (Jessie) b.t.w.

– Login as root and

apt-get update && apt-get install postgrey

***
#Optional:
Postgrey add’s a delay on your maildelivery, but only for hosts that are new to your server. The default is 300 seconds, but you can safely shorten that to 60 or less because the spamming server might never retry because it won’t get a the greylist command 🙂
Please note that the number “10023” is the port on which postrey runs, it may differ on your installation. Keep that number in mind because you need it in a minute.

nano /etc/default/postgrey

add –delay=60 to this line: POSTGREY_OPTS=”–inet=127.0.0.1:10023″ It will look like this: POSTGREY_OPTS=”–inet=127.0.0.1:10023 –delay=60″

service postgrey start

***

nano /etc/postfix/main.cf

and add check_policy_service inet:127.0.0.1:10023 to the smtpd_recipient_restrictions.
Mine looks like this:
smtpd_recipient_restrictions = permit_mynetworks, permit_sasl_authenticated, reject_unauth_destination, check_recipient_access mysql:/etc/postfix/mysql-virtual_recipient.cf,check_policy_service inet:127.0.0.1:10023

postfix reload

Done

You might want to see it working, you can do so by issuing the following command:

tail -f /var/log/mail.log | grep greylist

Output looks like this:

root@server /var/log # tail -f mail.log | grep greylist
Dec 21 12:30:31 server postgrey[27672]: action=greylist, reason=new, client_name=unknown, client_address=122.191.145.8, recipient=[redacted]

Enjoy, spam is something from the past.

One Response

  1. erik says:

    Here is a spam message on your blog ☺.

    But don’t behind screens all holiday. Enjoy ☺

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.