====== Configurer postfix pour utiliser un relais avec authentification ====== Par défaut, CentOS 5 est livré avec sendmail comme MTA. Et sendmail est vraiment pas terrible (suffit de regarder la syntaxe des fichiers de configuration pour s'en rendre compte). On va donc le remplacer par postfix ===== Installation de postfix ===== yum install postfix ===== Suppression de sendmail ===== yum remove sendmail ===== Configuration d'un smart host avec authentification ===== Si on veut relayer nos mails à travers un autre SMTP, avec authentification: * On inscrit le informations d'authentification dans un fichier echo smtp.domain.tld USERNAME:PASSWORD>> /etc/postfix/relay_auth * Et on restreint l'accès à ce fichiers: chmod 600 /etc/postfix/relay_auth * On Crée le hash de ce fichier postmap /etc/postfix/relay_auth * On délcare le smart host dans le fichier de configuration principal vim /etc/postfix/main.cf ajouter/modifier la section suivante: relayhost = smtp.domain.tld smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/relay_auth smtp_use_tls = yes smtp_sasl_security_options = noanonymous smtp_sasl_tls_security_options = noanonymous smtp_tls_note_starttls_offer = yes smtp_tls_CApath = /etc/pki/tls/certs Si votre serveur ne propose qu'une authentification de type PLAIN (ce qui ne pose pas de problème quand on utilise TLS), il faut aussi installer le support sur CentOS 6: yum install cyrus-sasl-plain ===== Relancer postfix ===== Il ne reste plus qu'à relancer postfix avec un petit /etc/init.d/postfix restart