Postfix mēstuļu novēršana
Must prepare before: Postfix e-pasta serveris | Should prepare further: Spamassassin mēstuļu filtrs |
Saturs
Nepareiza SMTP savienojuma atcelšana
failā /etc/postfix/main.cf pievieno papildu rindas:
# Antispam configuration
# see http://odo.lv/Recipes/PostfixNoSpam
smtpd_delay_reject = yes
smtpd_helo_required = yes
smtpd_helo_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
# when list is changed, run: postmap hash:helo_access
check_helo_access hash:/etc/postfix/helo_access,
reject_non_fqdn_hostname,
reject_invalid_hostname,
permit
smtpd_sender_restrictions =
permit_sasl_authenticated,
permit_mynetworks,
reject_non_fqdn_sender,
reject_unknown_sender_domain,
permit
# delay before any reaction if not in mynetwork
smtpd_client_restrictions =
reject_unauth_pipelining,
permit_mynetworks,
sleep 5,
permit
smtpd_recipient_restrictions =
permit_mynetworks,
permit_sasl_authenticated,
reject_invalid_hostname,
reject_non_fqdn_hostname,
reject_non_fqdn_sender,
reject_non_fqdn_recipient,
reject_unknown_sender_domain,
reject_unknown_recipient_domain,
reject_unauth_destination,
reject_unauth_pipelining,
reject_rbl_client cbl.abuseat.org,
reject_rbl_client dul.dnsbl.sorbs.net,
reject_rbl_client list.dsbl.org,
reject_rbl_client sbl-xbl.spamhaus.org,
permit
# if postgrey is used, comment line above and uncomment next line
# check_policy_service inet:127.0.0.1:10023Ja vēlas atļaut vai aizliegt konkrētus helo DNS vārdus, izveido failu /etc/postfix/helo_access un ievieto tajā rindas, piemēram:
viensdators.odo.lv OK
otrsdators.odo.lv OK
odo.lv REJECT You are not meIzpilda komandu:
postmap hash:helo_accessPārstartē postfix serveri ar komandu:
systemctl restart postfix- Ar komandu tail -f /var/log/mail.log novēro postfix žurnāla failu un pārliecinās, ka tiek noraidīti tikai mēstuļu sutītāji.
Mēstuļu izdzēšana
- Pārliecinās, ka ir uzstādīts Spamassassin mēstuļu filtrs
Failā /etc/postfix/main.cf pievieno rindu:
#Add header checks
header_checks = regexp:/etc/postfix/header_checksIzveido failu /etc/postfix/header_checks ar saturu:
/^X-Spam-Flag:.YES/ DISCARD Considered as SPAM
/^X-Spam-Level:.\*{4}/ REJECT SPAM level too high- likums ar DISCARD norāda, ka vēstules, kuras Spamassassin atzina par mēstuli (spama līmenis 5 vai augstāks), tiek izdzēstas,
- likums ar REJECT norāda, ka vēstules, kuru spama līmenis ir 4, tiek atgrieztas sūtītājam ar attiecīgu paskaidrojumu
- Pārstartē Postfix
Saites
- Spamassassin mēstuļu filtrs
- Postgrey mēstuļu filtrs
- http://www.akadia.com/services/postfix_uce.html
- http://www.freesoftwaremagazine.com/articles/focus_spam_postfix
- http://www.cyberciti.biz/faq/howto-configure-postfix-dnsrbls-under-linux-unix/
Tags
Linux
E-pasts
Drošība
Created by Valdis Vītoliņš on 2009-12-16 07:34
Last modified by Valdis Vītoliņš on 2024-01-16 13:59
Created by Valdis Vītoliņš on 2009-12-16 07:34
Last modified by Valdis Vītoliņš on 2024-01-16 13:59