added example config for smtpd_sender_login_maps config
All checks were successful
/ build (push) Successful in 2m8s
All checks were successful
/ build (push) Successful in 2m8s
This commit is contained in:
parent
f4690f0490
commit
59fedb2489
1 changed files with 22 additions and 5 deletions
|
|
@ -267,14 +267,31 @@ That will work:
|
|||
<~ 250 2.0.0 Ok: queued as AFFF12292A
|
||||
```
|
||||
|
||||
<Aside type="tip" title="Allow aliases?">
|
||||
<Aside type="tip" title="Allow sending from an alias address?">
|
||||
|
||||
The setup so far works for personal mails from John. But if John would be a member of a distribution list
|
||||
`pizza@example.org` then would not be able to use `pizza@example.org` as a sender address.
|
||||
The setup so far works for personal mails from John. But if John was a member
|
||||
of a distribution list `pizza@example.org` then he would not be able to use
|
||||
`pizza@example.org` as a sender address.
|
||||
|
||||
If you want to allow that, create a new \*.cf file with a mapping query like this:
|
||||
`SELECT email FROM virtual_users WHERE email='%s' UNION SELECT destination FROM virtual_aliases WHERE source='%s'`.
|
||||
If you want to allow that, add an SQL mapping for the `smtpd_sender_login_maps`
|
||||
as follows:
|
||||
|
||||
```sh title="Add an SQL mapping file"
|
||||
cat > /etc/postfix/mariadb-sender-login-maps.cf <<EOF
|
||||
user = mailserver
|
||||
password = MAILSERVER-PASSWORD-HERE
|
||||
hosts = 127.0.0.1
|
||||
dbname = mailserver
|
||||
query = SELECT email FROM virtual_users WHERE email='%s' UNION SELECT source FROM virtual_aliases WHERE destination='%s';
|
||||
EOF
|
||||
|
||||
postconf smtpd_sender_login_maps=mysql:/etc/postfix/mariadb-sender-login-maps.cf
|
||||
```
|
||||
|
||||
This SQL query will return…
|
||||
|
||||
- the email address of the current user
|
||||
- all alias addresses that point to the current user
|
||||
</Aside>
|
||||
|
||||
<Aside type="danger" title="Check your $mydestination">
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue