Closed sujitph closed 7 months ago
Hi,
this project is not a generic Postfix help tool. To do that you need to look at the documentation elsewhere. I'd be happy to help, but simply cannot answer every Postfix question on my own time.
That being said, I am using a similar configuration and I might be able to point you in the right direction.
My configuration is as follows:
POSTFIX_sender_dependent_relayhost_maps: "lmdb:/etc/postfix/sender_dependent_relayhost"
POSTFIX_smtp_sasl_auth_enable: "yes"
POSTFIX_smtp_sasl_password_maps: "lmdb:/etc/postfix/sasl_password"
POSTFIX_smtp_sender_dependent_authentication: "yes"
POSTFIX_smtp_sasl_security_options: "noanonymous"
POSTFIX_smtp_tls_policy_maps = "lmdb:/etc/postfix/smtp_tls_policy"
Then in sasl_password
:
<email> <username>:<password>
<email> <username>:<password>
<email> <username>:<password>
...
in sender_dependent_relayhost
:
<email> [<host>]:<port>
<email> [<host>]:<port>
<email> [<host>]:<port>
...
@<domain> [<host>]:<port>
@<domain> [<host>]:<port>
@<domain> [<host>]:<port>
...
in smtp_tls_policy
:
[<server>]:<port> encrypt
...
[smtp.gmail.com]:587 secure
.google.com:587 secure
.googlemail.com:587 secure
[127.0.0.2]:20025 none
...
I suggest checking out Mail station example as well.
Hope this helps.
Cheers, B
Hi there,
This is not an issue, more of a question. I am sure I am doing something wrong.
I am trying to relay the mail through Mailgun. I have 3 domains added in my mailgun account and unfortunately mailgun gives separate username/password for each domain for SMTP authentication. I believe you can configure the postfix to use different username/password based on the sending domain.
This is how I've setup my docker run command. Unfortunately, while relaying it not using the username and password from the sasl_passwd file and mailgun is rejecting the request. Can anyone share what am I doing wrong?
Content of /etc/postfix/sasl_passwd
Content of /etc/postfix/sender_dependent_relayhost