Ceci est une ancienne révision du document !
Remplacer Sendmail par Postfix sur CentOS 5
Par défaut, CentOS 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 rempalcer 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_sasl_security_options =
Relancer postfix
Il ne reste plus qu'à relancer postfix avec un petit
/etc/init.d/postfix restart