feat: Add list of allowed recipient domains#130
feat: Add list of allowed recipient domains#130dosmanak wants to merge 3 commits intojuanluisbaptiste:masterfrom
Conversation
|
Hi @dosmanak, thanks for your PR. Code LGTM, will test it and let you know. |
|
After various container restarts, the allowed domains are being duplicated in the /etc/postfix/transport file: And the container logs: |
|
I have not assumed the scenario where the container restarts as I always delete it. Will look into it. |
|
When the container is restarted, for example because the docker daemon was restarted because of an upgrade, or a server restart, in such cases the containers will not be recreated and this will happen. |
|
I added simple truncate of the file prior addind allowed domain and discard default. The solution is not very extendable but for now I think it will serve its purpose. |
|
I think it would be cleaner if you look for the string you are adding first, instead of blindly adding it and truncate it before doing that. What if another feature in the future also touches that file? |
|
@dosmanak did you have some time to update this PR? |
Well I did not planned it to be super strong. But I will look into that. |
discard all email for not listed domains
keep the file frech after container restart
add function 'set_line_in_file' to check if line is not present before adding
5e18db9 to
8d14977
Compare
|
What about this? Still not great, as it does not concerns line orders... |
…start What PR #130 was trying to fix.
discard all email for not listed domains
Description of the change
Regarding an issue #90 but not exactly. This Feature enables to setup nonprod smtp-relay that allows to send e-mails only to allowed domains.
Other e-mails are silently discarded.
Motivation and Context
Tested application allows to send any e-mail without error but only particular recipient domains get through.
How Has This Been Tested?
Types of Changes
Checklist:
.env.examplefile accordingly.And lastly, many thanks for taking your time to help us improve this project !