<rdf:RDF
    xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
    xmlns:s='http://snipsnap.org/rdf/snip-schema#'
    xml:base='http://bliki.rimuhosting.com/rdf'>
    <s:Snip rdf:about='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/greylisting+with+postgrey'
         s:cUser='brandon'
         s:oUser=''
         s:mUser='glenn'>
        <s:name>knowledgebase/linux/mail/greylisting with postgrey</s:name>
        <s:content>&#xD;&#xA;Greylisting has proven to be a pretty effective method for reducing the amount of spam you receive.  It works by temporarily rejecting emails.   Valid email servers will then retry delivery, and be allowed through while spammers will (hopefully) give up.   See http://www.greylisting.org/ for more info.   The postgrey application at http://postgrey.schweikert.ch/ provides a simple way to implement greylisting for postfix mail servers.&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;Debian and Ubuntu have the package available in the main repositories.   On CentOS/RHEL based distros, you will need to enable the rpmforge repository per http://bliki.rimuhosting.com/space/retep/extra+packages+for+rhel4+and+centos5 &#xD;&#xA;&#xD;&#xA;Then just install postgrey with apt&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;apt-get install postgrey&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;Configure postgrey to start at boot:&#xD;&#xA;&#xD;&#xA;Debian/Ubuntu:&#xD;&#xA;{code:none}&#xD;&#xA;update-rc.d postgrey defaults&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;CentOS/RHEL:&#xD;&#xA;{code:none}&#xD;&#xA;chkconfig postgrey on&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;And tell it to start up (any distro): &#xD;&#xA;{code:none}&#xD;&#xA;/etc/init.d/postgrey start&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;Now, tell postfix to use it:&#xD;&#xA;&#xD;&#xA;Debian/Ubuntu:&#xD;&#xA;The package listens on localhost:60000 by default, so edit /etc/postfix/main.cf, and add &apos;check_policy_service inet:127.0.0.1:60000&apos; to smtpd_recipient_restrictions.   Make sure to add it after permit_sasl_authenticated so you don&apos;t greylist authenticated users.   Like this:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;smtpd_recipient_restrictions =&#xD;&#xA;        permit_mynetworks&#xD;&#xA;        permit_sasl_authenticated&#xD;&#xA;        reject_unauth_destination&#xD;&#xA;        check_policy_service inet:127.0.0.1:60000&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;&#xD;&#xA;CentOS/RHEL:&#xD;&#xA;This package listens on a unix socket by default, so edit /etc/postfix/main.cf and add &apos;check_policy_service unix:/var/spool/postfix/postgrey/socket&apos; to &apos;smtpd_recipient_restrictions.  Again, make sure to add it after permit_sasl_authenticated so as not to greylist yourself.  Example:&#xD;&#xA;&#xD;&#xA;{code:none}&#xD;&#xA;smtpd_recipient_restrictions =&#xD;&#xA;        permit_mynetworks&#xD;&#xA;        permit_sasl_authenticated&#xD;&#xA;        reject_unauth_destination&#xD;&#xA;        check_policy_service unix:/var/spool/postfix/postgrey/socket&#xD;&#xA;{code}&#xD;&#xA;&#xD;&#xA;</s:content>
        <s:mTime>2008-04-08 22:17:25.0</s:mTime>
        <s:cTime>2007-08-02 17:39:44.0</s:cTime>
        <s:comments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
        <s:snipLinks>
            <rdf:Bag>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail'/>
                <rdf:li rdf:resource='#snipsnap-search'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/'/>
                <rdf:li rdf:resource='#knowledgebase'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/miscapplications/ruby on rails'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/postfixadmin on debian sarge'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#retep/extra packages for rhel4 and centos5'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#virtualmin notes'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/postfix notes'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/Mail and DNS'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/postfix with amavis and mysql'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/Postfix mbox to Maildir conversion'/>
                <rdf:li rdf:resource='#snipsnap-index'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/mail/mail not going through'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/linux/networking/monitoring bandwidth usage with vnstat'/>
                <rdf:li rdf:resource='http://bliki.rimuhosting.com/rdf#knowledgebase/rimuhosting/rimuhosting ssh access'/>
            </rdf:Bag>
        </s:snipLinks>
        <s:attachments
             rdf:type='http://www.w3.org/1999/02/22-rdf-syntax-ns#Bag'/>
    </s:Snip>
</rdf:RDF>
