diff --git a/HowtoMail/Antispam.md b/HowtoMail/Antispam.md index a2bf6d36..1207f2f8 100644 --- a/HowtoMail/Antispam.md +++ b/HowtoMail/Antispam.md @@ -191,11 +191,76 @@ rm -rf $tmp -Postscreen est un démon de Postfix qui permet de renforcer les filtres de 1er niveau. +Postscreen est un démon de [Postfix](HowtoPostfix) qui permet de renforcer les filtres de 1er niveau. Il permet principalement de combiner la vérification auprès de plusieurs RBL. -Avec l'option "reject_rbl_client", Postfix vérifie la présence d'une IP auprès de plusieurs RBLs : si l'IP est présente au moins une fois, Postfix rejette le message. +Avec l'option `reject_rbl_client`, Postfix vérifie la présence d'une IP auprès de plusieurs RBLs : si l'IP est présente au moins une fois, Postfix rejette le message. Postscreen permet de ne rejeter le message que si l'adresse IP est présente au moins N fois. +Sa configuration se passe dans le fichier `/etc/postfix/main.cf` : + +~~~ +# Deep protocol tests +# Disabled due to reject with 450. +postscreen_pipelining_enable = no +postscreen_non_smtp_command_enable = no +postscreen_bare_newline_enable = no +# Pre 220 tests. +postscreen_greet_banner = Welcome! Are you a zombie? +# RBL +# If score >=2, reject with 550 +postscreen_dnsbl_threshold = 10 +postscreen_dnsbl_sites = zen.spamhaus.org*9, + bl.spamcop.net*9, + b.barracudacentral.org*8, + cbl.abuseat.org*8, + bl.score.senderscore.com*8, + hostkarma.junkemailfilter.com=127.0.0.2*8, + dnsbl.sorbs.net*7, + ix.dnsbl.manitu.net*6, + psbl.surriel.com*5, + truncate.gbudb.net*5, + dnsbl-1.uceprotect.net*5, + db.wpbl.info*5, + all.spamrats.com*5, + dnsbl.dronebl.org*5, + dnsbl.inps.de*5, + bl.blocklist.de*5, + srnblack.surgate.net*5, + all.s5h.net*5, + rbl.megarbl.net*5, + bl.mailspike.net*5, + cidr.bl.mcafee.com*5, + hostkarma.junkemailfilter.com=127.0.0.4*4, + aspews.ext.sorbs.net*2, + dnsblchile.org*1, + hostkarma.junkemailfilter.com=127.0.0.1*-6 + #dnsblchile.org + #rbl.rbldns.ru + #dnsbl.proxybl.org + +# Skip all tests if score <=-1 +postscreen_dnsbl_whitelist_threshold = -1 +# Actions +postscreen_dnsbl_action = enforce +postscreen_greet_action = enforce +postscreen_bare_newline_action = enforce +postscreen_blacklist_action = enforce +postscreen_non_smtp_command_action = drop +postscreen_pipelining_action = enforce +# Whitelist & MX kick +# If you talk first to high MX weight (192.0.2.34) = Reject with 550. +postscreen_whitelist_interfaces = !192.0.2.34, static:192.0.2.32, static:192.0.2.24 +postscreen_access_list = permit_mynetworks, cidr:/etc/postfix/postscreen_access.cidr, hash:/etc/postfix/client.access, hash:/etc/postfix/client.access_local +# Cache controls +postscreen_cache_retention_time = 10s +postscreen_greet_ttl = 1d +postscreen_bare_newline_ttl = 30d +postscreen_non_smtp_command_ttl = 30d +postscreen_pipelining_ttl = 30d +~~~ + +> *Note* : pour les fichiers listés dans `postscreen_access_list`, tout mot clé différent de `permit` rejette les adresses IP listées (y compris `OK` !). + ### Postgrey