Ces derniers temps, pas mal des adhérent⋅e⋅s d’Infini nous contactent pour nous signaler que leurs emails arrivent à destination avec « un certain délai ».
Plutôt que de poster tout le temps la même réponse par mail, on a décidé de la publier sur notre site.
Halte aux SMTP mous du genou !
▻https://www.infini.fr/pourquoi-vos-emails-arrivent-en-retard-chez-orange
Un serveur SMTP de CHATONS causant avec un serveur de mail Orange.
Vous faites transiter plusieurs dizaines de milliers de messages vers Orange chaque jour ?
@biggrizzly j’ai pas de chiffres pour orange sous la main tout de suite, mais oui les boites mails des adhérent⋅e⋅s et surtout nos listes de diffusion sympa font qu’on peut envoyer un million de mails par jour. Et quand on a pas cinquante IPs sous la main c’est tendu :p
Gros volume en effet... Les blocs IP chez OVH ne sont pas bien chers... mais ensuite, il faut gérer les IP sur les serveurs de mails... et ce n’est pas forcément bien simple en effet...
Ouep, et surtout on a nos serveurs dans un datacenter basé à brest, on passe par un opérateur régional historique pour le raccordement, bref « on n’est pas branchés » chez ovh.
Découvrez l’Observatoire de la résilience de l’Internet français 2016 par l’ANSSI et l’Afnic ▻https://www.afnic.fr/fr/l-afnic-en-bref/actualites/actualites-generales/10681/show/rapport-2016-de-l-observatoire-de-la-resilience-de-l-internet-francais.html
#VendrediLecture #ANSSI #Afnic #Internet #Securité #DNS #TGP #BGP #TLS #DDoS #SMTP #IPV6 #RPKI
Un peu light pour comparé aux 100 000 emails dispos gratuitement chez ►https://www.sparkpost.com
Des #Alertes mail à partir des messages dans vos fichiers de logs
▻http://www.dsfc.net/infrastructure/securite/alertes-mail-messages-fichiers-logs
Grâce à #Swatch, vous serez alerté en temps réel des tentatives d’intrusion dans votre système #Linux.
#Sécurité #Formateur_Linux #Formateur_Syslog #rsyslog #SMTP #syslog
Postfix : SASL auth with PAM and passwd file
How to configure #Postfix to authenticate users with #SASL, #PAM and a custom #passwd file (#Debian Linux Jessie)
Here are the clues and hints I’d have been happy to find gathered in one single place to avoid such waste of time...
1) How to activate a PAM plugin in order to use a custom passwd file
Create the passwd file :
echo "myuser@mydomain.tld:"$( mkpasswd -m sha-512 "mypassword" ) > /etc/postfix/my_passwd_file
apt-get install libpam-pwdfile
echo 'auth required pam_pwdfile.so pwdfile=/etc/postfix/my_passwd_file
account required pam_permit.so
session required pam_permit.so
password required pam_deny.so' > /etc/pam.d/smtp
apt-get install pamtester
pamtester -v smtp myuser@mydomain.tld authenticate
pamtester: invoking pam_start(smtp, myuser@mydomain.tld, ...)
pamtester: performing operation - authenticate
Password:
pamtester: successfully authenticated
pamtester is as far as I can see in SF a not maintained project, but it is included as a standard package in Debian, which is a very good thing to test the authenticate chain from the very beginning.
I’ve actived the debug mode for PAM by creating a file in /etc :
touch /etc/pam_debug
Then, second step, the sasl auth daemon. I’ve tried before to directly tell sasl to use pam, but it was refusing to authenticate without beeing able to obtain any hint in the log files. saslauthd is far more verbose and it has helped me a lot to reach the goal.
2) Configure saslauthd
Follow the first recipe in the Debian page :
►https://wiki.debian.org/PostfixAndSASL
This recipe is almost correct for my passwd file. Except that by default, it separates the user name and the domain :
Sep 9 10:17:39 smtpout saslauthd[829]: DEBUG: auth_pam: pam_authenticate failed: User not known to the underlying authentication module
Sep 9 10:17:39 smtpout saslauthd[829]: do_auth : auth failure: [user=myuser] [service=smtp] [realm=mydomain.tld] [mech=pam] [reason=PAM auth error]
The solution is to add an option in the saslauthd config file :
vi /etc/default/saslauthd-postfix
And modify the “OPTIONS” line :
OPTIONS="-c -r -m /var/spool/postfix/var/run/saslauthd"
The “-r” option protects the mail address from being separated from its domain. Check “man saslauthd” :
-r Combine the realm with the login (with an ’@’ sign in between). e.g. login: “foo” realm: “bar” will get passed as login: “foo@bar”. Note that the realm will still be passed, which may lead to unexpected behavior for authentication mechanisms that make use of the realm, however for mechanisms which don’t, such as getpwent, this is the only way to authenticate domain-specific users sharing the same userid.
If you want to check saslauth, you may use :
testsaslauthd -u "myuser@mydomain.tld" -p "mypassword" -f /var/spool/postfix/var/run/saslauthd/mux -s smtp
3) Then, the last test : check that Postfix accepts to authenticate users...
Many blog posts explain how to test SMTP AUTH using telnet... But... they usually propose deprecated ways to encode the credentials...
►https://www.ndchost.com/wiki/mail/test-smtp-auth-telnet
In my case, the perl encoding for the user was wrong. I obtained a good encoding this way :
echo -n "myuser@mydomain.tld" | base64
echo -n "mypassword" | base64
#SMTP conversation :
user@localhost [~]# telnet exampledomain.com 25
Trying 1.1.1.1...
Connected to exampledomain.com (1.1.1.1).
Escape character is '^]'.
220-server1.exampledomain.com ESMTP Exim 4.66 #1 Wed, 09 May 2007 23:55:12 +0200
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
EHLO exampledomain.com
250-server1.exampledomain.com Hello [1.1.1.2]
250-SIZE 52428800
250-PIPELINING
250-AUTH PLAIN LOGIN
250-STARTTLS
250 HELP
AUTH LOGIN
334 VXNlcm5hbWU6
dXNlcm5hbWUuY29t
334 UGFzc3dvcmQ6
bXlwYXNzd29yZA==
235 Authentication succeeded
Don’t forget to check the logs, it’s useful to understand what’s wrong :
tail /var/log/auth.log
tail /var/log/syslog
tail /var/log/mail.log
References :
▻https://github.com/tiwe-de/libpam-pwdfile
▻http://pamtester.sourceforge.net
►https://wiki.debian.org/PostfixAndSASL
►https://www.ndchost.com/wiki/mail/test-smtp-auth-telnet
L’observatoire de la résilience de l’Internet français publie son rapport 2015 ▻https://www.afnic.fr/fr/l-afnic-en-bref/actualites/actualites-generales/9991/show/l-observatoire-de-la-resilience-de-l-internet-francais-publie-son-rapport-2015
#ANSSI #AFNIC #INTERNET #RESILIENCE #WEB #TLS #BGP #SMTP #DNSSEC #IPv6 #HTTPS #RPKI #DDoS
#SSMTP, un serveur #SMTP pour vos #Applications_Web
▻http://www.dsfc.net/infrastructure/messagerie-infrastructure/ssmtp-serveur-smtp-pour-applications-web
L’installation et La configuration de SSMTP vous prendront quelques minutes à peine pour disposer d’un serveur d’envoi adapté à vos applications Web.
#Messagerie #ESMTP #Lamp #MSMTP #Postfix
A couple of email privacy tips:
Make sure your email client isn’t leaking your local hostname. For example if you use Claws Mail ►http://www.claws-mail.org enable the “Send account mail address in Message-ID” in each account’s settings.
If you run your own SMTP server make sure it’s not leaking your IP address. For example if you use OpenSMTPD ▻https://opensmtpd.org use its “mask-source” option:
listen on net0 port 587 tls pki example.net auth mask-source
Note: only use that option on submission ports and not on port 25 otherwise it’ll mask the source of incoming messages as well as outgoing ones.
Trois #RFC sur le protocole #DANE viennent de sortir, l’un sur l’utilisation de DANE avec #SMTP (#Postfix a un bon support de DANE), l’autre sur l’utilisation de DANE avec les enregistrements DNS SRV (par exemple pour #XMPP) et le dernier sur l’utilisation concrète de DANE, avec quelques conseils opérationnels.
▻http://www.bortzmeyer.org/7671.html ▻http://www.bortzmeyer.org/7672.html ▻http://www.bortzmeyer.org/7673.html
« Lundi dernier, le 5 octobre, Axelle Lemaire, notre secrétaire d’État au numérique French Tech Digital Dolby-Surround (le son était malheureusement coupé pendant les débats sur la loi renseignement), a annoncé qu’elle était pour le "chiffrement". Plus exactement elle annonçait, je cite le bon compte-rendu de NextInpact, "la signature d’une charte entre les opérateurs français pour le cryptage des boites email". »
Très bonne explication (avec dessins) de la différence entre un chiffrement du courrier de bout en bout vs. étape par étape.
▻https://nonblocking.info/le-chiffrement-batard-venu-des-enfers
#chiffrement #SMTP #TLS #vie_privée
Les serveurs #smtp pour l’e-mailing | Arobase.org
▻http://www.arobase.org/emailing/services-smtp.htm
mandrillapp étant désormais payant (pour les nouveaux utilisateurs), une sélection de prestataires proposant un #service SMTP au moins partiellement gratuit
Introducing Go-MailHog – Ian Kent
▻http://iankent.uk/2014/04/20/introducing-go-mailhog
un #outil pour simuler un serveur #smtp en local : très pratique pour les devs nécessitant l’envoi de mails
The sad state of #SMTP encryption
▻https://blog.filippo.io/the-sad-state-of-smtp-encryption
#cryptography #cryptographie
RFC 7410 : A Property Types Registry for the Authentication-Results Header Field
Le RFC 7001 avait créé l’en-tête de courrier Authentication-Results : qui permettait de signaler à un logiciel de courrier les résultats de tests d’authenticité faits par un serveur. Cet en-tête pouvait inclure un type de propriété (property type ou ptype) qui indiquait d’où venait la propriété testée : la session #SMTP, l’en-tête du message, son corps, ou bien une politique locale. Le jeu de valeurs pour les types possibles était fixe et, depuis, certains ont trouvé ce jeu trop restreint. Ce nouveau et très court #RFC remplace donc la liste fixe du RFC 7001 par un registre en ligne à l’IANA.
email encryption downgrade attack :
ISPs that remove #STARTTLS flag and as a result break email encryption
▻https://www.eff.org/deeplinks/2014/11/starttls-downgrade-attacks
This type of STARTTLS stripping attack has mostly gone unnoticed because it tends to be applied to residential networks, where it is uncommon to run an email server
[...]
There are several weak points in the STARTTLS protocol, however. The first weakness is that the flag indicating that a server supports STARTTLS is not itself encrypted, and is therefore subject to tampering, which can prevent that server from establishing an encrypted connection. That type of tampering is exactly what we see today. EFF is working on a set of improvements to STARTTLS, called STARTTLS Everywhere, that will make server-to-server encryption more robust by requiring encryption for servers that are already known to support it.
RFC 3270 : SMTP Service Extension for Secure SMTP over Transport Layer Security
▻http://www.bortzmeyer.org/3207.html
“We can’t send mail more than 500 miles” the chairman explained.
▻http://www.ibiblio.org/harris/500milemail.html
#SMTP #sysadmin
Problèmes de SMTP chez laposte.net
Cher Seenthis, je t’expose un petit problème technique qui m’embête ces temps-ci : actuellement les serveurs #SMTP de laposte.net rejettent automatiquement les #mails envoyés avec MAIL FROM :<>. Voici un exemple de session SMTP où un tel mail est rejeté :
julien@xxx:~$ rlwrap telnet smtpz4.laposte.net 25
Trying 194.117.213.1...
Connected to smtpz4.laposte.net.
Escape character is ’^]’.
220 lpn-prd-vrin002 ESMTP Postfix (Ubuntu)
EHLO xxx.xxxxx.org
250-lpn-prd-vrin002
250-PIPELINING
250-SIZE 50000000
250-VRFY
250-ETRN
250-STARTTLS
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
MAIL FROM : <>
501 5.0.1 Emetteur invalide. Invalid Sender. LPN007_403
Or les serveurs SMTP sont tenus d’accepter ces mails, d’après la RFC 1123, section 5.2.9 :
▻http://tools.ietf.org/html/rfc1123#page-54
Ceci permet notamment de gérer les rebonds (mails renvoyés à l’expéditeur) en évitant des boucles de rebonds infinis. Plus d’informations ici par exemple :
▻http://serverfault.com/questions/151955/why-an-empty-mail-from-address-can-sent-out-email
Une conséquence en ce qui me concerne est que l’envoi de mails à des adresses laposte.net via des mailing-lists gérées par Mailman sont systématiquement rejetés. Ces listes fonctionnaient parfaitement avec les adresses laposte.net il y a quelques semaines (et elles continuent à fonctionner sans problème avec les adresses d’autres fournisseurs).
J’ai évidemment fait remonter à la poste via Twitter et postmaster, mais aucun retour.
Alors, cher Seenthis, si tu as une idée de solution, si tu penses que c’est moi qui n’ai rien compris ou si tu connais Monsieur postmaster de laposte, je serais très heureux d’avoir ton avis
@fil Ah, c’est bon à savoir.
Quand tu parles de from=<mailman-bounces@rezo.net>, est-ce que c’est celui qui apparaît dans ton mail.log ? J’ai l’impression de mon côté que certains messages sont effectivement envoyés avec from=<LISTNAME-bounces@domain.tld>, et là ça passe, et d’autres avec from=<>, et là ça coince pour laposte, mais passe pour les autres.
J’en perds un peu mon latin...
Petit élément de réponse : apparemment le from=<>
était dû au fait que les mails envoyés par mailman passaient d’abord par dspam. En branchant mailman pour qu’il envoie par postfix sans intermédiaire, il semble que le from reste bien à <LISTNAME-bounces@domain.tld>
. Avec un peu de chance ça va résoudre mon problème.
Il n’empêche qu’il me semble que les SMTP de laposte devraient bien accepter les mails avec un from vide.
Merci @fil pour ton retour.
RFC 7372 : Email Authentication Status Codes
Il existe désormais plusieurs techniques d’authentification du courrier électronique, comme #SPF ou #DKIM. Elles permettent à un serveur de messagerie, s’il le désire, d’accepter ou de rejeter le courrier entrant s’il échoue à ces tests d’authentification. Mais il n’existait pas jusqu’à présent de moyen standard de prévenir l’expéditeur, lors de la session #SMTP, de la raison de ce rejet. C’est désormais fait, avec ce nouveau #RFC, qui permet de renvoyer des codes de retour SMTP explicites, si on veut.
Swaks - Swiss Army Knife for #SMTP
▻http://www.jetmore.org/john/code/swaks
Swaks is a featureful, flexible, scriptable, transaction-oriented SMTP test tool
The current state of #SMTP STARTTLS deployment:
▻https://www.facebook.com/notes/protect-the-graph/the-current-state-of-smtp-starttls-deployment/1453015901605223
What 4xx/5xx rejection codes could mean at the various stages of an #SMTP transaction:
▻https://wordtothewise.com/2014/05/smtp-level-rejections
Raspberry Pi Email Server
▻http://www.samhobbs.co.uk/raspberry-pi-email-server
The RasPi’s small size and low power consumption make it an ideal choice for use as a home email server. After trying a couple of different pieces of software, I finally found an excellent combination: Postfix with Dovecot and Squirrelmail, plus Spamasssassin and Sieve for spam filtering.
Voilà un bon tutoriel, c’est à dire complet, didactique et clair, pour l’installation d’un serveur email personnel avec Postfix et Dovecot.
#Auto-hébergement_(informatique) #Courrier_électronique #Dovecot #IMAP #Postfix #Raspberry_Pi #SMTP
Bon par contre je me heurte encore à la configuration de deux serveurs côte à côte (et pas juste un nom de domaine en alias). C’est pas simple tout ça.
#Raspbian (le Pi peut avoir plein de systèmes d’exploitation différents)
#Google has most of my email because it has all of yours:
►http://mako.cc/copyrighteous/google-has-most-of-my-email-because-it-has-all-of-yours #surveillance #mail #SMTP
If you want to run the analysis on your own, you’re welcome to the Python and R code I used to produce the numbers and graphs.
▻http://projects.mako.cc/source/?p=gmail-maildir-counter
Dès qu’un groupe où vous êtes crée une liste de diffusion, vous pouvez rappeler qu’il suffit qu’une personne fasse passer ses mails par gmail/yahoo/outlook/msn/etc pour que le contenu des messages, la liste des adresses mails y participant activement soient directement rendus disponibles à ces entreprises et indirectement les services #marketing et/ou de #renseignement avec lesquels elles sont en contrat.