Closed Bonno closed 2 months 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?
I'm not sure how to create tests for an authentication flow.
@Bonno @jeboehm is this now abandoned? I'm hoping not as it's something I now need. I'd like to help, but I have no idea how to write the test, although I'm willing to try to learn if someone can point me in the right direction.
Hi @tiberios1 no, not abandoned. But the usual lack of time... :) I'm sorry!
Totally understand the lack of time issue. Any chance you can give me some detail as to what needs doing and I'll see if I can help out?
Hi @tiberios1 Thanks for your understanding! The relay host scenario is tested here: https://github.com/jeboehm/docker-mailserver/blob/main/test/rootfs/usr/share/tests/080_relayhost.bats
https://github.com/jeboehm/docker-mailserver/blob/main/.github/workflows/integration-tests.yml describes, how tests are executed. In your case:
An instance of mailhog is started (defined in https://github.com/jeboehm/docker-mailserver/blob/main/docker-compose.test.yml) and used to fake an external relay host. Problem here: mailhog doesn't support SMTP authentication.
I think mailpit is a good alternative for mailhog, as it supports smtp auth.
I hope this helps!
Thanks to the breakdown from @jeboehm I was able to change a few bits and now we have a successful test scenario for this PR.
Hi @Bonno awesome! Thanks for your work!
Merged.
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:
Create a config file './config/mta/sasl_passwd' with the following contents:
[smtp.gmail.com]:587 username:password
Add the following volume to 'docker-compose.override.yml' for the 'mta' service:
./config/mta/sasl_passwd:/etc/postfix/sasl_passwd
Add the following lines to your '.env' file