Fix code
parent
abcb6c95a1
commit
fce98db2bd
|
@ -15,8 +15,8 @@ defined in {{< rfc 5321 >}}, with some additional standard extensions.
|
|||
It allows the machines to exchange mail.
|
||||
|
||||
|
||||
**OpenSMTPD** is a part the OpenBSD base system. It was ported to others OSes,
|
||||
as Devuan.
|
||||
**OpenSMTPD** is a part the OpenBSD base system. It was ported to others
|
||||
OSes, as Devuan.
|
||||
|
||||
Informations:
|
||||
|
||||
|
@ -76,14 +76,38 @@ place on your system.
|
|||
It's better put rights `0400` on this secrets file. *Default: `0640`*.
|
||||
|
||||
Even, it's possible for the service to access at your secrets file, with
|
||||
your personal rights as `$USER:$USER`, it's better to put the group right `opensmtpd`.
|
||||
your personal rights as `$USER:$USER`, it's better to put the group right
|
||||
`opensmtpd`.
|
||||
{{< /note >}}
|
||||
|
||||
### File smtpd.conf
|
||||
|
||||
Now, edit the config file `/etc/smtpd.conf`
|
||||
|
||||
{{< file "sys-devuan-opensmtpd-smtpd.conf-auth-example" sh "/etc/smtpd.conf" >}}
|
||||
```cfg
|
||||
# $OpenBSD: smtpd.conf,v 1.10 2018/05/24 11:40:17 gilles Exp $
|
||||
|
||||
# This is the smtpd server system-wide configuration file.
|
||||
# See smtpd.conf(5) for more information.
|
||||
|
||||
table aliases file:/etc/aliases
|
||||
table secrets file:/home/your-id/.config/mail/secrets
|
||||
|
||||
queue compression
|
||||
|
||||
# To accept external mail, replace with: listen on all
|
||||
|
||||
listen on localhost
|
||||
|
||||
action "local" maildir alias <aliases>
|
||||
action "relay" relay host smtp+tls://identifiant@server auth <secrets> mail-from "@your-domain.tld"
|
||||
|
||||
# Uncomment the following to accept external mail for domain "example.org"
|
||||
#
|
||||
# match from any for domain "example.org" action "local"
|
||||
match for local action "local"
|
||||
match from local for any action "relay"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
@ -91,23 +115,31 @@ Now, edit the config file `/etc/smtpd.conf`
|
|||
|
||||
So compared to the original version, we added:
|
||||
|
||||
* the line `table secrets`: it call the secrets file — *write your custom filename*.
|
||||
* the line `table secrets`: it call the secrets file
|
||||
— *write your custom filename*.
|
||||
* the line `action relay`: to define the necessary action to send emails
|
||||
to the server.
|
||||
* NOTE about `identifiant@serveur`:
|
||||
* you have to replace the string `identifiant` by your created.
|
||||
* and too, to replace the `serveur` by the name of SMTP server.
|
||||
* the string `smtp+tls` is the used protocol to connect at the SMTP server. <br>
|
||||
* the string `smtp+tls` is the used protocol to connect at the SMTP
|
||||
server. <br>
|
||||
others protocols are:
|
||||
* `lmtp`: to connect on a {{< abbr LMTP "Local Mail Transfer Protocol" >}} session.
|
||||
* `smtp`: to attempt a connection with a STARTTLS session, if possible.
|
||||
* `lmtp`: to connect on a
|
||||
{{< abbr LMTP "Local Mail Transfer Protocol" >}} session.
|
||||
* `smtp`: to attempt a connection with a STARTTLS session, if
|
||||
possible.
|
||||
* `smtp+tls`: to force the connection on a STARTTLS session.
|
||||
* `smtp+notls`: to use a plain text SMTP session without TLS.
|
||||
* `smtps`: to force the connexion via {{< abbr TLS "Transport Layer Secure" >}} — *default port: 465*
|
||||
* with no specified protocol, the connection will be done on the default port: 25.
|
||||
* `smtps`: to force the connexion via
|
||||
{{< abbr TLS "Transport Layer Secure" >}}
|
||||
— *default port: 465*
|
||||
* with no specified protocol, the connection will be done on the
|
||||
default port: 25.
|
||||
* the string `auth`: to specify the secrets table.
|
||||
* the string `mail-from`: to specify the domain name to use.
|
||||
* the line `match … action "relay"`: this is the action that will be triggered to send the emails.
|
||||
* the line `match … action "relay"`: this is the action that will be
|
||||
triggered to send the emails.
|
||||
|
||||
### aliases
|
||||
|
||||
|
@ -146,14 +178,24 @@ So:
|
|||
|
||||
For all cases, the log will display messages, as:
|
||||
|
||||
{{< file "sys-devuan-opensmtpd-auth-example-log" sh "/var/log/mail.log" >}}
|
||||
```log
|
||||
(…)
|
||||
Apr 27 09:16:47 pc-z smtpd[1718]: 09cca279ca1178e4 smtp connected address=local host=***
|
||||
Apr 27 09:16:47 pc-z smtpd[1718]: 09cca279ca1178e4 smtp message msgid=85868a25 size=474 nrcpt=1 proto=ESMTP
|
||||
Apr 27 09:16:47 pc-z smtpd[1718]: 09cca279ca1178e4 smtp envelope evpid=85868a25fcb1569a from=<my-id@***> to=<my-id@***>
|
||||
Apr 27 09:16:47 pc-z smtpd[1718]: 09cca279ca1178e4 smtp disconnected reason=quit
|
||||
Apr 27 09:16:51 pc-z smtpd[1718]: 09cca27892fa38ea mta delivery evpid=85868a25fcb1569a from=<my-id@huc.fr.eu.org> to=<email@nom-de-domaine.tld> rcpt=<my-id@***> source="192.168.47.47" relay="80.67.160.70 (lautre.net)" delay=4s result="Ok" stat="250 2.0.0 Ok: queued as 53C92112839"
|
||||
Apr 27 09:17:02 pc-z smtpd[1718]: 09cca27892fa38ea mta disconnected reason=quit messages=2
|
||||
(…)
|
||||
```
|
||||
|
||||
Now, you can send email from console/terminal or yours scripts shell with
|
||||
SMTP authentification!
|
||||
Now, you can send email from console/terminal or yours scripts shell
|
||||
with SMTP authentification!
|
||||
|
||||
### Errors
|
||||
|
||||
Look the different possible errors on my article {{< inside2 a="errors" l="sys:openbsd:smtpd-config-auth" >}}
|
||||
Look the different possible errors on my article
|
||||
{{< inside2 a="errors" l="sys:openbsd:smtpd-config-auth" >}}
|
||||
|
||||
## Documentations
|
||||
|
||||
|
|
|
@ -30,7 +30,8 @@ and finally on my "owners" MX*.
|
|||
|
||||
## Installation
|
||||
|
||||
Since OpenBSD 6.4, inton the base system, we have the new version of OpenSMTPD.
|
||||
Since OpenBSD 6.4, inton the base system, we have the new version of
|
||||
OpenSMTPD.
|
||||
|
||||
To start the service: `# rcctl start smtpd`
|
||||
|
||||
|
@ -73,14 +74,45 @@ place on your system.
|
|||
It's better put rights `0400` on this secrets file.
|
||||
|
||||
Even, it's possible for the service to access at your secrets file, with
|
||||
your personal rights as `$USER:$USER`, it's better to put the right group `_smtpd`.
|
||||
your personal rights as `$USER:$USER`, it's better to put the right group
|
||||
`_smtpd`.
|
||||
{{< /note >}}
|
||||
|
||||
### File `smtpd.conf`
|
||||
|
||||
Now, we modify the config file `/etc/mail/smtpd.conf`.
|
||||
|
||||
{{< file "sys-openbsd-smptd-auth-config-example" sh "/etc/mail/smtpd.conf" >}}
|
||||
```cfg
|
||||
# $OpenBSD: smtpd.conf,v 1.14 2019/11/26 20:14:38 gilles Exp $
|
||||
|
||||
# This is the smtpd server system-wide configuration file.
|
||||
# See smtpd.conf(5) for more information.
|
||||
|
||||
table aliases file:/etc/mail/aliases
|
||||
table secrets file:/etc/mail/secrets
|
||||
|
||||
queue compression
|
||||
|
||||
# To accept external mail, replace with: listen on all
|
||||
#
|
||||
## add on 6.7
|
||||
listen on socket
|
||||
|
||||
listen on lo0
|
||||
|
||||
action "local_mail" mbox alias <aliases>
|
||||
action "unbound" relay host smtp+tls://identifiant@server auth <secrets> mail-from "@your-domain.tld"
|
||||
|
||||
# Uncomment the following to accept external mail for domain "example.org"
|
||||
#
|
||||
# match from any for domain "example.org" action "local"
|
||||
### 6.6 writings
|
||||
#match for local action "local_mail"
|
||||
#match for any action "unbound"
|
||||
### 6.7 writings
|
||||
match from local for local action "local_mail"
|
||||
match from local for any action "outbound"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
@ -88,7 +120,8 @@ Now, we modify the config file `/etc/mail/smtpd.conf`.
|
|||
|
||||
So compared to the original version, we added:
|
||||
|
||||
* the line `table secrets`: it call the secrets file — *write your custom filename*.
|
||||
* the line `table secrets`: it call the secrets file
|
||||
— *write your custom filename*.
|
||||
* the line `action unbound`: to define the necessary action to send emails
|
||||
to the SMTP server.
|
||||
* NOTE about `identifiant@serveur`:
|
||||
|
@ -98,14 +131,19 @@ So compared to the original version, we added:
|
|||
* the string [`smtp+tls`](https://man.openbsd.org/smtpd.conf#host) is
|
||||
the used protocol to connect at the SMTP server. <br>
|
||||
others protocols are:
|
||||
* `lmtp`: to connect on a {{< abbr LMTP "Local Mail Transfer Protocol" >}} session.
|
||||
* `smtp`: to attempt a connection with a STARTTLS session, if possible.
|
||||
* `lmtp`: to connect on a
|
||||
{{< abbr LMTP "Local Mail Transfer Protocol" >}} session.
|
||||
* `smtp`: to attempt a connection with a STARTTLS session, if
|
||||
possible.
|
||||
* `smtp+tls`: to force the connection on a STARTTLS session.
|
||||
* `smtp+notls`: to use a plain text SMTP session without TLS.
|
||||
* `smtps`: to force the connexion via {{< abbr TLS "Transport Layer Secure" >}} — *default port: 465*
|
||||
* with no specified protocol, the connection will be done on the default port: 25.
|
||||
* the string [`auth`](https://man.openbsd.org/smtpd.conf#auth): to specify
|
||||
the secret table.
|
||||
* `smtps`: to force the connexion via
|
||||
{{< abbr TLS "Transport Layer Secure" >}}
|
||||
— *default port: 465*
|
||||
* with no specified protocol, the connection will be done on the
|
||||
default port: 25.
|
||||
* the string [`auth`](https://man.openbsd.org/smtpd.conf#auth): to
|
||||
specify the secret table.
|
||||
* the string [`mail-from`](https://man.openbsd.org/smtpd.conf#mail_-from):
|
||||
to specify the domain name to use.
|
||||
* the line `match … action "relay"`: this is the action that will be
|
||||
|
@ -116,14 +154,16 @@ So compared to the original version, we added:
|
|||
OpenBSD 6.7 makes minor syntax changes:
|
||||
|
||||
- add `listen on socket` *{{< man smtpd.conf 5 "listen~2" >}}*
|
||||
- modification of match actions for the **local** queue manager *{{< man smtpd.conf 5 match >}}*: <br>
|
||||
- modification of match actions for the **local** queue manager
|
||||
*{{< man smtpd.conf 5 match >}}*: <br>
|
||||
`match from local for local action "local_mail"` <br>
|
||||
`match from local for any action "outbound"` <br>
|
||||
|
||||
|
||||
#### Changes on 6.6
|
||||
|
||||
The syntax of the action names has changed slightly between versions 6.4 and 6.6:
|
||||
The syntax of the action names has changed slightly between versions 6.4
|
||||
and 6.6:
|
||||
|
||||
* `local` becomes `local_mail`
|
||||
* `relay` becomes `unbound`
|
||||
|
@ -139,7 +179,8 @@ Edit the file `/etc/mail/aliases`, with rights admin. <br>
|
|||
At the end of file, modify `root` with your desired address email. <br>
|
||||
Do the same for your system user. ;)
|
||||
|
||||
And, do not forget to reload the aliases base, with the command `newaliases`!
|
||||
And, do not forget to reload the aliases base, with the command
|
||||
`newaliases`!
|
||||
|
||||
## Utilisation
|
||||
|
||||
|
|
|
@ -15,8 +15,8 @@ translationKey: "devuan-opensmtpd-auth-client"
|
|||
machines ordinaire d'échanger des mails avec d'autres systèmes
|
||||
parlant le protocole SMTP.
|
||||
|
||||
**OpenSMTPD** fait partie du système de base du système d'exploitation OpenBSD.
|
||||
Il a été "porté" sur d'autres OS, tel Devuan.
|
||||
**OpenSMTPD** fait partie du système de base du système d'exploitation
|
||||
OpenBSD. Il a été "porté" sur d'autres OS, tel Devuan.
|
||||
|
||||
Informations :
|
||||
|
||||
|
@ -28,7 +28,8 @@ Informations :
|
|||
|
||||
Parce qu'OpenSMTPD est :
|
||||
|
||||
- **facile à {{< anchor configurer configuration >}}** : un seul fichier texte !
|
||||
- **facile à {{< anchor configurer configuration >}}** : un seul fichier
|
||||
texte !
|
||||
- reconnu comme étant fiable ET sécurisé.
|
||||
|
||||
---
|
||||
|
@ -67,18 +68,19 @@ Ensuite, il est nécessaire de le remplir de telle manière : <br>
|
|||
remplacez-là par les informations ci-dessous :
|
||||
|
||||
* où `identifiant` est l'identifiant que vous choisissez soigneusement,
|
||||
et qui vous servira plus tard dans la configuration du fichier `smtpd.conf` ;
|
||||
et qui vous servira plus tard dans la configuration du fichier
|
||||
`smtpd.conf` ;
|
||||
* `username` est votre identifiant de connexion mail au service mail de
|
||||
votre fournisseur - *généralement votre adresse mail* - ;
|
||||
* `password` étant le mot de passe lié à votre identification mail.
|
||||
|
||||
{{< note warning >}}
|
||||
Il est possible de nommer autrement ce fichier secrets, et de le mettre
|
||||
ailleurs dans votre système de fichier ; comprenez-le principe et modifier
|
||||
en conséquence.
|
||||
ailleurs dans votre système de fichier ; comprenez-le principe et
|
||||
modifier en conséquence.
|
||||
|
||||
De même, je vous encourage fortement à ne mettre QUE des droits **0440** sur
|
||||
le fichier - *par défaut : 0640*.
|
||||
De même, je vous encourage fortement à ne mettre QUE des droits **0440**
|
||||
sur le fichier - *par défaut : 0640*.
|
||||
|
||||
Même si l'accès au fichier par smtpd peut sans soucis être fait avec vos
|
||||
droits personnels `$USER:$USER`, il est préférable de mettre à minima les
|
||||
|
@ -141,18 +143,25 @@ Par rapport à la version originale, nous avons donc rajouté :
|
|||
`mail.gandi.net`.
|
||||
* la chaîne `smtp+tls` est le protocol que nous utilisons pour nous
|
||||
connecter au service de l'hôte mail relais… <br>
|
||||
il est bien sûr possible d'utiliser les autres protocoles, tel que :
|
||||
* `lmtp` pour se connecter avec une session {{< abbr LMTP "Local Mail Transfer Protocol" >}}.
|
||||
* `smtp` pour essayer de se connecter avec une session STARTTLS si possible
|
||||
* `smtp+tls` pour obliger une connexion par le biais d'une session STARTTLS.
|
||||
il est bien sûr possible d'utiliser les autres protocoles, tel
|
||||
que :
|
||||
* `lmtp` pour se connecter avec une session
|
||||
{{< abbr LMTP "Local Mail Transfer Protocol" >}}.
|
||||
* `smtp` pour essayer de se connecter avec une session STARTTLS
|
||||
si possible
|
||||
* `smtp+tls` pour obliger une connexion par le biais d'une
|
||||
session STARTTLS.
|
||||
* `smtp+notls` pour se connecter "en clair", sans chiffrement
|
||||
* `smtps` pour se connecter en forçant la connexion {{< abbr TLS "Transport Layer Secure" >}} -
|
||||
*port par défaut : 465*.
|
||||
* si rien n'est spécifié, alors la connexion se fera sur le port 25.
|
||||
* `smtps` pour se connecter en forçant la connexion
|
||||
{{< abbr TLS "Transport Layer Secure" >}}
|
||||
- *port par défaut : 465*.
|
||||
* si rien n'est spécifié, alors la connexion se fera sur le port
|
||||
25.
|
||||
* la chaîne `auth` permet de spécifier la table `secrets` fournissant
|
||||
les données d'identification mail nécessaires.
|
||||
* la chaîne `mail-from` nous permet de spécifier le nom de domaine -
|
||||
ce qui permet d'éviter l'erreur `Sender address rejected: Domain not found` ; <br>
|
||||
ce qui permet d'éviter l'erreur
|
||||
`Sender address rejected: Domain not found` ; <br>
|
||||
*il faut bien sûr que ce domaine vous appartienne…*
|
||||
* la ligne `match … action "relay"` est l'action qui sera déclenchée
|
||||
lors de l'envoi de mails à l'extérieur !
|
||||
|
@ -165,9 +174,9 @@ Il est intéressant de gérer l'alias relatif à votre compte `root` voire
|
|||
celui de votre utilisateur principal…
|
||||
|
||||
Éditez le fichier `/etc/aliases`, avec des droits administrateurs. <br>
|
||||
Vers la fin du fichier, modifiez `root` en lui indiquant vers quelle adresse
|
||||
mail vous désirez que les messages systèmes adressés au compte root vous
|
||||
soit envoyés !
|
||||
Vers la fin du fichier, modifiez `root` en lui indiquant vers quelle
|
||||
adresse mail vous désirez que les messages systèmes adressés au compte
|
||||
root vous soit envoyés !
|
||||
|
||||
Faites de même pour votre utilisateur système ;)
|
||||
|
||||
|
@ -183,17 +192,20 @@ configuration : <br> `# smtpd -n` <br>
|
|||
qui devrait réponde par : `configuration OK` <br>
|
||||
informant ainsi que tout va bien…
|
||||
|
||||
Sinon, rééditez le fichier de configuration à la ligne indiquée en premier ;
|
||||
c'est d'elle que vient l'erreur principale !
|
||||
Sinon, rééditez le fichier de configuration à la ligne indiquée en
|
||||
premier ; c'est d'elle que vient l'erreur principale !
|
||||
{{< /note >}}
|
||||
|
||||
Il est nécessaire de redémarrer le service : <br>
|
||||
`# service opensmtpd restart`, ou <br>
|
||||
`# /etc/init.d/opensmtpd restart` - si vous utilisez **openrc** en tant que gestionnaire de service !
|
||||
`# /etc/init.d/opensmtpd restart` - si vous utilisez **openrc** en tant
|
||||
que gestionnaire de service !
|
||||
|
||||
### Envois
|
||||
|
||||
{{< note info >}}L'outil **mail** fait partie du paquet **mailutils** !{{</note>}}
|
||||
{{< note info >}}
|
||||
L'outil **mail** fait partie du paquet **mailutils** !
|
||||
{{</note>}}
|
||||
|
||||
Soit :
|
||||
|
||||
|
@ -203,14 +215,24 @@ Soit :
|
|||
Dans un cas, comme dans l'autre, le journal vous indiquera
|
||||
l'équivalent, en cas de réussite, d'un tel message :
|
||||
|
||||
{{< file "sys-devuan-opensmtpd-auth-example-log" sh "/var/log/mail.log" >}}
|
||||
```log
|
||||
(…)
|
||||
Apr 27 09:16:47 pc-z smtpd[1718]: 09cca279ca1178e4 smtp connected address=local host=***
|
||||
Apr 27 09:16:47 pc-z smtpd[1718]: 09cca279ca1178e4 smtp message msgid=85868a25 size=474 nrcpt=1 proto=ESMTP
|
||||
Apr 27 09:16:47 pc-z smtpd[1718]: 09cca279ca1178e4 smtp envelope evpid=85868a25fcb1569a from=<my-id@***> to=<my-id@***>
|
||||
Apr 27 09:16:47 pc-z smtpd[1718]: 09cca279ca1178e4 smtp disconnected reason=quit
|
||||
Apr 27 09:16:51 pc-z smtpd[1718]: 09cca27892fa38ea mta delivery evpid=85868a25fcb1569a from=<my-id@huc.fr.eu.org> to=<email@nom-de-domaine.tld> rcpt=<my-id@***> source="192.168.47.47" relay="80.67.160.70 (lautre.net)" delay=4s result="Ok" stat="250 2.0.0 Ok: queued as 53C92112839"
|
||||
Apr 27 09:17:02 pc-z smtpd[1718]: 09cca27892fa38ea mta disconnected reason=quit messages=2
|
||||
(…)
|
||||
```
|
||||
|
||||
À partir de maintenant, vous pourrez envoyer depuis votre console ou vos
|
||||
scripts shell des mails avec authentification SMTP !
|
||||
|
||||
### Erreurs
|
||||
|
||||
Retrouvez les différentes erreurs possibles sur mon article {{< inside2 a="Gestion des erreurs" l="sys:openbsd:smtpd-config-auth" >}}
|
||||
Retrouvez les différentes erreurs possibles sur mon article
|
||||
{{< inside2 a="Gestion des erreurs" l="sys:openbsd:smtpd-config-auth" >}}
|
||||
|
||||
## Documentations
|
||||
|
||||
|
|
|
@ -43,8 +43,8 @@ fonctionnera normalement sur votre machine !
|
|||
Une petite précision sur les fichiers :
|
||||
|
||||
* le fichier de configuration est : `/etc/mail/smtpd.conf`.
|
||||
* le fichier log est `/var/log/maillog` et permet de surveiller toute l'activité
|
||||
liée à SMTP, vous y retrouverez aussi les erreurs d'envois.
|
||||
* le fichier log est `/var/log/maillog` et permet de surveiller toute
|
||||
l'activité liée à SMTP, vous y retrouverez aussi les erreurs d'envois.
|
||||
|
||||
## Configuration
|
||||
|
||||
|
@ -54,13 +54,14 @@ un premier temps, un fichier `secrets` avec les droits adéquats sur
|
|||
votre système, ensuite il nous reste à configurer le fichier
|
||||
`smtpd.conf`.
|
||||
|
||||
Le manpage nous donne un [exemple](https://man.openbsd.org/smtpd.conf#EXAMPLES) de ce
|
||||
qu'il faut faire - regardez le premier exemple, si besoin, mais je le
|
||||
restitue ici - :
|
||||
Le manpage nous donne un [exemple](https://man.openbsd.org/smtpd.conf#EXAMPLES)
|
||||
de ce qu'il faut faire - regardez le premier exemple, si besoin, mais je
|
||||
le restitue ici - :
|
||||
|
||||
### Fichier secrets
|
||||
|
||||
Il nous faut créer ce fichier `/etc/mail/secrets` : `# touch /etc/mail/secrets`
|
||||
Il nous faut créer ce fichier `/etc/mail/secrets` :
|
||||
`# touch /etc/mail/secrets`
|
||||
|
||||
**Donnons lui les droits adéquats pour le "sécuriser", selon la section
|
||||
"Exemples" du manpage** :
|
||||
|
@ -76,8 +77,10 @@ Ensuite, il est nécessaire de le remplir de telle manière : <br>
|
|||
remplacez-là par les informations ci-dessous :
|
||||
|
||||
* où `identifiant` est l'identifiant que vous choisissez soigneusement,
|
||||
et qui vous servira plus tard dans la configuration du fichier `smtpd.conf` ;
|
||||
*admettons pour l'exemple que ce sera la chaine de caractères : **perso**.*
|
||||
et qui vous servira plus tard dans la configuration du fichier
|
||||
`smtpd.conf` ;
|
||||
*admettons pour l'exemple que ce sera la chaine de caractères :
|
||||
**perso**.*
|
||||
* `username` est votre identifiant de connexion mail au service mail de
|
||||
votre fournisseur - *généralement votre adresse mail* - ;
|
||||
* `password` étant le mot de passe lié à votre identification mail.
|
||||
|
@ -87,8 +90,8 @@ Il est possible de nommer autrement ce fichier secrets, et de le mettre
|
|||
ailleurs dans votre système de fichier ; comprenez-le principe et modifier
|
||||
en conséquence.
|
||||
|
||||
De même, je vous encourage fortement à ne mettre QUE des droits **0400** sur
|
||||
le fichier.
|
||||
De même, je vous encourage fortement à ne mettre QUE des droits **0400**
|
||||
sur le fichier.
|
||||
|
||||
Même si l'accès au fichier par smtpd peut sans soucis être fait avec vos
|
||||
droits personnels `$USER:$USER`,
|
||||
|
@ -100,7 +103,37 @@ de mettre à minima les droits avec le groupe `_smtpd`.
|
|||
|
||||
Maintenant modifions le fichier `/etc/mail/smtpd.conf`
|
||||
|
||||
{{< file "sys-openbsd-smptd-auth-config-example" sh "/etc/mail/smtpd.conf" >}}
|
||||
```cfg
|
||||
# $OpenBSD: smtpd.conf,v 1.14 2019/11/26 20:14:38 gilles Exp $
|
||||
|
||||
# This is the smtpd server system-wide configuration file.
|
||||
# See smtpd.conf(5) for more information.
|
||||
|
||||
table aliases file:/etc/mail/aliases
|
||||
table secrets file:/etc/mail/secrets
|
||||
|
||||
queue compression
|
||||
|
||||
# To accept external mail, replace with: listen on all
|
||||
#
|
||||
## add on 6.7
|
||||
listen on socket
|
||||
|
||||
listen on lo0
|
||||
|
||||
action "local_mail" mbox alias <aliases>
|
||||
action "unbound" relay host smtp+tls://identifiant@serveur auth <secrets> mail-from "@your-domain.tld"
|
||||
|
||||
# Uncomment the following to accept external mail for domain "example.org"
|
||||
#
|
||||
# match from any for domain "example.org" action "local"
|
||||
### 6.6 writings
|
||||
#match for local action "local_mail"
|
||||
#match for any action "unbound"
|
||||
### 6.7 writings
|
||||
match from local for local action "local_mail"
|
||||
match from local for any action "outbound"
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
|
|
Loading…
Reference in New Issue