docker-mailserver icon indicating copy to clipboard operation
docker-mailserver copied to clipboard

Add authentication to smtp relay host

Open Bonno opened this issue 3 years ago • 2 comments

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=

Bonno avatar Aug 17 '22 21:08 Bonno

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?

jeboehm avatar Aug 23 '22 16:08 jeboehm

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

Bonno avatar Mar 17 '23 09:03 Bonno