15 marzo 2020 Roberto Puzzanghera 0 commenti
The Sender Policy Framework (SPF) is an open standard specifying a technical method to prevent sender address forgery. More precisely, the current version of SPF — called SPFv1 or SPF Classic — protects the envelope sender address, which is used for the delivery of messages. See the box on the right for a quick explanation of the different types of sender addresses in e-mails.
Prima di tutto è necessario creare il record PDF nel proprio name server. Puoi usare questa procedura guidata che ti conduce alla creazione del record, che più o meno dovrà essere una cosa del genere:
yourdomain.tld. IN TXT "v=spf1 mx a ip4:<your-ip>/32 ip4:<your-localnet>/24 include:alloweddomain.tld -all"
Se il tuo server mx compare anche nella DMZ del tuo name server (DeMilitarized Zone) sarà bene aggiungere un record pressochè identico anche lì, per evitare un tentativo di spoofing da parte di uno spammer che ti invia messaggi utilizzando proprio il tuo dominio nell'indirizzo del mittente.
Il comportamento di SPF è controllato dal file /var/qmail/control/spfbehavior
. Si può specificare un valore tra 0 e 6:
Il contenuto di questo file viene sovrascritto dal valore della variabile di ambiente SPFBEHAVIOR (se è stata impostata, tipicamente in /etc/tcprules.d/tcp.smtp).
Valori superiori a 3 sono fortemente sconsigliati, mentre normalmente si imposta un valore pari a 2 o 3.
Controllare come prima cosa l'intestazione del messaggio in arrivo. Si dovrebbe trovare una riga "Received-SPF" come questa nel caso di SPF non abilitato
Received-SPF: none (0: domain at does not designate permitted sender hosts)
o come questa nel caso di un SPF abilitato e regolare:?
Received-SPF: pass(0: SPF record at designates x.x.x.x as permitted sender)
Per testare il rigetto impostare temporaneamente il valore più alto 6 e riavviare qmail. Dopo di chè inviare un email con un mittente fasullo connettendosi al server da remoto; il messaggio dovrebbe essere rigettato con un messaggio come questo:
# telnet qmail.yourserver.net 25 Trying [remote-IP]... Connected to [remote-IP]. Escape character is '^]'. 220 qmail.yourserver.net ESMTP mail from: test@nospfdomain.net 250 ok rcpt to: user@yourdomain.net 550 See http://spf.pobox.com/why.html?sender=test%40nospfdomain.net&ip=[sender-IP]&receiver=0 (#5.7.1) quit 221 qmail.yourserver.net Connection closed by foreign host.
Ricordarsi di ripristinare a 2 o 3 il file /var/qmail/control/spfbehavior
.
Failed after apply roberto-netqmail-1.06.patch-2022.02.13
23 maggio 2022 19:45
Failed after apply roberto-netqmail-1.06.patch-2022.02.13
23 maggio 2022 18:52
qmail-smtpd: read failed (hang up before quit cmd)
23 maggio 2022 16:17
qmail-smtpd: read failed (hang up before quit cmd)
22 maggio 2022 17:32
Failed after apply roberto-netqmail-1.06.patch-2022.02.13
19 maggio 2022 21:33
Failed after apply roberto-netqmail-1.06.patch-2022.02.13
19 maggio 2022 21:23
Failed after apply roberto-netqmail-1.06.patch-2022.02.13
17 maggio 2022 20:32
Failed after apply roberto-netqmail-1.06.patch-2022.02.13
17 maggio 2022 19:57
Failed after apply roberto-netqmail-1.06.patch-2022.02.13
13 maggio 2022 16:35
Failed after apply roberto-netqmail-1.06.patch-2022.02.13
13 maggio 2022 16:30
Tags
apache clamav dkim dovecot ezmlm fail2ban ftp guide hacks lamp letsencrypt linux linux-vserver lxc mariadb mediawiki mozilla mysql openboard owncloud patches php proftpd qmail qmail-spp qmailadmin rbl roundcube rsync sieve simscan slackware solr spamassassin spf ssh ssl tcprules tex ucspi-tcp vpopmail vqadmin