Maybe it is explained somewhere on the docs, but I couldn't find it out.
I'd like to use the mailserver for multiple mail domains.
What is the recommended way for adding virtual_alias_domains?
Hey there @dashohoxha.
Although I do not know the answer to your question, I will mark @erik-wramner / @casperklein. They know better than I do :)
If this use case really is not documented, we will add this to the documentation.
By testing I found out that mailserver supports multiple email domains out of the box. So, no need to add virtual_alias_domains or anything else on the configuration. All that is need is to use ./setup.sh to add email accounts or aliases (forwarders). For example:
./setup.sh email add [email protected] pass123
./setup.sh email add [email protected] pass123
./setup.sh alias add [email protected] [email protected]
./setup.sh alias add [email protected] [email protected]
Everything works as expected. I am sorry for opening this issue without proper testing.
However, maybe it is worth to mention somewhere on the docs that mailserver supports multiple email domains out of the box.
Oh, then I misread your question. I thought there were some other difficulties involved. Sorry, I could've told you that earlier:) But your suggestion is good, I will make sure this note ends up somewhere in the README.
Done with ec290acd1f92e1e44773085df8d8872f6f13cb25.
I think virtual_alias_domains is needed for ldap setups.
Currently investigating with another test, will let you know soon
Test added as https://github.com/desportes/infrastructure/commit/1ae727a49f808115ad489a2ad10a1e44d387c17a
Reproduced (log) !
run-tests_1 | PHPUnit 9.5.0 by Sebastian Bergmann and contributors.
run-tests_1 |
run-tests_1 | ........sendmail: RCPT TO:<[email protected]> (554 5.7.1 <[email protected]>: Relay access denied)
run-tests_1 | F 9 / 9 (100%)
run-tests_1 |
run-tests_1 | Time: 00:14.819, Memory: 18.00 MB
run-tests_1 |
run-tests_1 | There was 1 failure:
run-tests_1 |
run-tests_1 | 1) Desportes\Infrastructure\tests\SendAndReceiveTest::testFromExternalToInternalAlias
run-tests_1 | Message could not be sent. Mailer Error: Could not instantiate mail function.
run-tests_1 |
run-tests_1 | FAILURES!
run-tests_1 | Tests: 9, Assertions: 17, Failures: 1.
I am working on a fix.
I have tried a LDAP setup, as described here: https://github.com/tomav/docker-mailserver/wiki/Forward-Only-mailserver-with-LDAP-authentication
In this case I didn't have to use virtual_alias_domains. I even delete /etc/postfix/ldap-domains.cf on the customization script (config/user-patches.sh).
But my edge case is
Domain: a.tld
User1: [email protected],[email protected]
Send from [email protected] to [email protected] does not work
Send email from @a.ltd to @bbb.tld works (internal server agrees with itself)
Are you in the same edge case?
sendmail: RCPT TO:<[email protected]> (450 4.2.0 <[email protected]>: Recipient address rejected: Delayed by postgrey) is my new error but this is for me a success :rocket:
To conclude: the fix https://github.com/desportes/infrastructure/commit/b7df3264105b16dad78cff0b418fc2fed8edbfb8 is needed to add virtual_alias_domains for ldap setups
@aendeavor Do I create a PR to add this config value?
sendmail: RCPT TO:<[email protected]> (450 4.2.0 <[email protected]>: Recipient address rejected: Delayed by postgrey)is my new error but this is for me a success :rocket:To conclude: the fix https://github.com/desportes/infrastructure/commit/b7df3264105b16dad78cff0b418fc2fed8edbfb8 is needed to add
virtual_alias_domainsfor ldap setups@aendeavor Do I create a PR to add this config value?
What you're seeing is not an error, but the default action taken by Postgrey - i.e. this is a success.
Sure, a PR is the way to go. Just keep in mind that the image-pull-policy of Docker may cause problems in the next 6 hours.
is needed to add
virtual_alias_domainsfor ldap setups
I just want to point out that LDAP setups are highly dependent on the layout of the LDAP data structures and how you want to use it. So, maybe you should also specify which LDAP setup are you talking about. As far as I know this is not explained anywhere in the docs of this project (I searched for it and couldn't find anything).
is needed to add
virtual_alias_domainsfor ldap setupsI just want to point out that LDAP setups are highly dependent on the layout of the LDAP data structures and how you want to use it. So, maybe you should also specify which LDAP setup are you talking about. As far as I know this is not explained anywhere in the docs of this project (I searched for it and couldn't find anything).
I agree and this is why I just want to have the option to fill the domain list myself by hand or in a file
See my pull-request in https://github.com/tomav/docker-mailserver/pull/1739
By the way https://github.com/desportes/infrastructure/commit/2c557529c5d750673eb0b87c8b797d9dbe5cef8d made sure the email is received and that greylist works. So the fix I am using in production is in the pull-request.