« 5 seconds of fame | Main | The patient isn't dead yet »

How to setup postgrey

Postgrey is a postifx policy server which utilizes greylisting, a very simple yet highly effective (for now) way to stop spam.

  1. Download files..
    wget postgrey-1.24.tar.gz
  2. Untar .. and read the README file...

    tar -xzvf postgrey-1.24.tar.gz
    more README
    ^c
    less README
    q
    perldoc postgrey

  3. Follow Instructions!

    useradd postgrey

    .. <copy init script from someone else..>

    /etc/rc.d/init.d/postgrey start

  4. Swear and install needed perl modules which were listed in the documentation

  5. Restart server.. and send a test email to see if it all works

  6. Edit configuration file for some actual parameters...

    OPTIONS="--unix=/tmp/postgrey.sock --lookup-by-subnet \
    --user=postgrey --group=postgrey --daemonize \
    --greylist-text='Greylisted for %s seconds (see http://www.unix-girl.com/greylist.html)'"

  7. Restart server.. and send a test email to see if it all works

  8. Discover you forgot to upgrade postfix to something that actually supports server policy (2.2)

  9. Upgrade postfix

  10. Restart server, send test email to see if it all works..

  11. Discover some of your configuration no longer works with the new version of postfix and you're now bouncing all emails.. change config

  12. Restart server, send test email to see if it all works

  13. It works! Enjoy a lot less spam

I love how easy working with postfix is (in reality all that took only about 30min - including the time to bitch - and at a maximum 5 swears). My current spam level went from about a 100 a day (before spamassassin) to 1 or 2 a week.