postfix - policyd-spf-python
Bir sunucumda Postfix MTA kullanıyorum. Bu aralar oldukça fazla spam e-posta gelmeye başladı.
Gerekli olan paketi kuralım.
sudo apt-get install postfix-policyd-spf-python
yapılandırma dosyamızı düzenleyelim.
cd /etc/postfix-policyd-spf-python
~# nano policyd-spf.conf
dosya içeriğin temizleyip aşağıdaki içeriği yapıştırın.
debugLevel = 1içeriği kaydedip kapatın.
TestOnly = 1
HELO_reject = Fail
Mail_From_reject = Softfail
PermError_reject = False
TempError_Defer = False
skip_addresses = 127.0.0.0/8,::ffff:127.0.0.0/104,::1
Hide_Receiver = Yes
Authserv_Id = HEADER
~# nano /etc/postfix/master.cf
#------------- SPF ---------------------------------------------------
policy-spf unix - n n - - spawn
user=policyd-spf argv=/usr/bin/policyd-spf
#------------- SPF ---------------------------------------------------
En alta satıra inip ekleyip kaydedin.
~# nano /etc/postfix/main.cf
#------------- SPF --------------------
policy-spf_time_limit = 3600s
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination,check_policy_service unix:private/policy-spf
#------------- SPF --------------------
~# service postfix restart
Sonuç
root@battalgazi:~# grep www.openspf.net /var/log/mail.log
Jun 24 01:03:49 battalgazi policyd-spf[10618]: 550 5.7.23 Message rejected due to: SPF fail - not authorized. Please see http://www.openspf.net/Why?s=helo;id=microsoft.com;ip=94.102.15.233;r=<UNKNOWN>
Jun 24 01:03:49 battalgazi postfix/smtpd[10552]: NOQUEUE: reject: RCPT from server.wegagroup.com[94.102.15.233]: 550 5.7.23 <caylak@truvalinux.org.tr>: Recipient address rejected: Message rejected due to: SPF fail - not authorized. Please see http://www.openspf.net/Why?s=helo;id=microsoft.com;ip=94.102.15.233;r=<UNKNOWN>; from=<gates@microsoft.com> to=<caylak@truvalinux.org.tr> proto=SMTP helo=<microsoft.com>
Jun 24 01:13:57 battalgazi policyd-spf[12010]: 550 5.7.23 Message rejected due to: domain owner discourages use of this host. Please see http://www.openspf.net/Why?s=mfrom;id=gates@gmail.com;ip=94.102.15.233;r=<UNKNOWN>
Jun 24 01:13:58 battalgazi postfix/smtpd[11837]: NOQUEUE: reject: RCPT from server.wegagroup.com[94.102.15.233]: 550 5.7.23 <caylak@truvalinux.org.tr>: Recipient address rejected: Message rejected due to: domain owner discourages use of this host. Please see http://www.openspf.net/Why?s=mfrom;id=gates@gmail.com;ip=94.102.15.233;r=<UNKNOWN>; from=<gates@gmail.com> to=<caylak@truvalinux.org.tr> proto=SMTP helo=<smtp.gmail.com>
Jun 24 01:17:30 battalgazi policyd-spf[12674]: 550 5.7.23 Message rejected due to: domain owner discourages use of this host. Please see http://www.openspf.net/Why?s=mfrom;id=finansmerkezi03@aol.com;ip=94.102.15.233;r=<UNKNOWN>
Jun 24 01:17:30 battalgazi postfix/smtpd[12599]: NOQUEUE: reject: RCPT from server.wegagroup.com[94.102.15.233]: 550 5.7.23 <caylak@truvalinux.org.tr>: Recipient address rejected: Message rejected due to: domain owner discourages use of this host. Please see http://www.openspf.net/Why?s=mfrom;id=finansmerkezi03@aol.com;ip=94.102.15.233;r=<UNKNOWN>; from=<finansmerkezi03@aol.com> to=<caylak@truvalinux.org.tr> proto=SMTP helo=<smtp.aol.com>
root@battalgazi:~#
Başarılı :)
Perl versiyonu için
http://www.serdarkok.com/linux/postfix-spf-entegrasyonu