jeboehm / docker-mailserver

Docker Mailserver based on the famous ISPMail guide
MIT License
353 stars 92 forks source link

Add authentication to smtp relay host #204

Open Bonno opened 1 year ago

Bonno commented 1 year ago

I've added configuration to provide TLS SMTP authentication for relayhosts. This is necessary when using gmail as relayhost for your mailserver for example. To make use of the TLS authentication you need to follow these steps:

  1. Create a config file './config/mta/sasl_passwd' with the following contents: [smtp.gmail.com]:587 username:password

  2. Add the following volume to 'docker-compose.override.yml' for the 'mta' service: ./config/mta/sasl_passwd:/etc/postfix/sasl_passwd

  3. Add the following lines to your '.env' file

    RELAYHOST=[smtp.gmail.com]:587
    RELAY_PASSWD_FILE=/etc/postfix/sasl_passwd
    RELAY_OPTIONS=
jeboehm commented 1 year ago

Hi @Bonno thank you very much for your contribution! What I'm missing is test coverage to see the authentication working. Could you add a case for that please?

Bonno commented 1 year ago

I'm not sure how to create tests for an authentication flow.