« Postfix en tant que relay » : différence entre les versions
Aller à la navigation
Aller à la recherche
Aucun résumé des modifications |
Aucun résumé des modifications |
||
Ligne 31 : | Ligne 31 : | ||
=2= | =2= | ||
<pre> | |||
touch /etc/postfix/smarthost_passwd | |||
chown root:root /etc/postfix/smarthost_passwd | |||
chmod 600 /etc/postfix/smarthost_passwd | |||
postmap /etc/postfix/smarthost_passwd | |||
</pre> | |||
/etc/postfix/smarthost_passwd contiendra les associations de cette manière : | |||
<pre> | |||
sender1@domain1.tld userforsender1@domain1.tld:password | |||
sender2@domain1.tld userforsender2@domain1.tld:password | |||
@domain2.tld userfordomain2@domain2.tld:password | |||
</pre> | |||
configuration de postfix : | |||
<pre> | |||
relayhost = relay.domain.tld:587 | |||
smtp_use_tls=yes | |||
smtp_sasl_auth_enable = yes | |||
smtp_sasl_password_maps = hash:/etc/postfix/smarthost_passwd | |||
smtp_sasl_security_options = noanonymous | |||
smtp_sender_dependent_authentication = yes | |||
sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay | |||
</pre> | |||
<pre> | |||
sender1@domain1.tld relay.domain.tld | |||
sender2@domain.tld relay.domain.tld | |||
@domain2.tld relay2.domain.tld | |||
</pre> | |||
<pre> | |||
/etc/init.d/postfix restart | |||
</pre> |
Version du 13 juillet 2014 à 09:54
aptitude install postfix
Configuez le en tant que "internet with smarthost". Dans SMTP Relay Host, entrez l'hostname:port que vous souhaitez utiliser comme smtp sortant.
Nous allons utiliser les informations suivantes :
- serveur de relai mail : relay.domain.tld sur le port 578 (submission)
- utilisateur permettant d'envoyer le mail : test@otherdomain.tld
- mot de passe : password
Configuration simple
echo "relay.domain.tld:587 test@otherdomain.tld:password" > /etc/postfix/smarthost_passwd chown root:root /etc/postfix/smarthost_passwd chmod 600 /etc/postfix/smarthost_passwd postmap /etc/postfix/smarthost_passwd
configuration de postfix :
relayhost = relay.domain.tld:587 smtp_use_tls=yes smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/smarthost_passwd smtp_sasl_security_options = noanonymous
/etc/init.d/postfix restart
2
touch /etc/postfix/smarthost_passwd chown root:root /etc/postfix/smarthost_passwd chmod 600 /etc/postfix/smarthost_passwd postmap /etc/postfix/smarthost_passwd
/etc/postfix/smarthost_passwd contiendra les associations de cette manière :
sender1@domain1.tld userforsender1@domain1.tld:password sender2@domain1.tld userforsender2@domain1.tld:password @domain2.tld userfordomain2@domain2.tld:password
configuration de postfix :
relayhost = relay.domain.tld:587 smtp_use_tls=yes smtp_sasl_auth_enable = yes smtp_sasl_password_maps = hash:/etc/postfix/smarthost_passwd smtp_sasl_security_options = noanonymous smtp_sender_dependent_authentication = yes sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
sender1@domain1.tld relay.domain.tld sender2@domain.tld relay.domain.tld @domain2.tld relay2.domain.tld
/etc/init.d/postfix restart