22
0
Fork 0

Il y a eu un changement de format pour la configuration de opensmtpd, corrige la doc

This commit is contained in:
mtrossevin 2022-02-01 15:12:38 +01:00
parent f165400a86
commit 8890cfe7ad
1 changed files with 32 additions and 7 deletions

View File

@ -50,11 +50,14 @@ table aliases file:/etc/mail/aliases
#
listen on lo0
action "mbox" mbox alias <aliases>
action "relay" relay
# Uncomment the following to accept external mail for domain "example.org"
#
# accept from any for domain "example.org" alias <aliases> deliver to mbox
accept for local alias <aliases> deliver to mbox
accept from local for any relay
# match from any for domain "example.org" action "mbox"
match for local action "mbox"
match from local for any action "relay"
~~~
Cette configuration permet de relayer juste les mails qui viennent de
@ -73,6 +76,25 @@ listen on localhost
# If you edit the file, you have to run "smtpctl update table aliases"
table aliases file:/etc/aliases
action "mbox" mbox alias <aliases>
action "relay" relay
# Uncomment the following to accept external mail for domain "example.org"
#match from any for domain "example.org" action "mbox"
match for local action "mbox"
match for any action "relay"
~~~
ou pour Debian <11:
~~~
# To accept external mail, replace with: listen on all
listen on localhost
# If you edit the file, you have to run "smtpctl update table aliases"
table aliases file:/etc/aliases
# Uncomment the following to accept external mail for domain "example.org"
#accept from any for domain "example.org" alias <aliases> deliver to mbox
@ -91,17 +113,19 @@ On a ce cas quand on veut que les mails de root soient avec un autre
nom de domaine que le hostname.
~~~
accept from local for any relay as "root@example.com"
action "relayAs" relay mail-from "root@example.com"
match from local for any action "relayAs"
~~~
Attention, dans ce cas cela ré-écrit même les messages envoyés avec un autre utilisateur.
### Utiliser un relai SMTP
On peut utiliser un relai en modifiant la règle `accept for any relay` et en ajoutant le mot clé `via` :
On peut utiliser un relai en ajoutant le mot clé `host` dans la définition de l'action :
~~~
accept from local for any relay via 192.0.2.25
action "relayVia" relay host "192.0.2.25"
match from local for any action "relayVia"
~~~
On peut notamment utiliser cela pour contourner un blocage du port 25
@ -109,7 +133,8 @@ et renvoyer sur un port différent (il faut évidemment que sur le relai
SMTP réponde sur ce port). Par exemple sur le port 2525 :
~~~
accept from local for any relay via 192.0.2.25:2525
action "relayVia" relay host "192.0.2.25:2525"
match from local for any action "relayVia"
~~~