Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong domain name in postsrsd config #852

Closed
mherfurt opened this issue Feb 19, 2018 · 9 comments · Fixed by #906
Closed

Wrong domain name in postsrsd config #852

mherfurt opened this issue Feb 19, 2018 · 9 comments · Fixed by #906

Comments

@mherfurt
Copy link

Hi,
thanks for your excellent work with docker-mailserver!
Quite recently, some changes were introduced, that broke my setup. It took me some time to figure out, why some mailservers were rejecting my mails with the errorcode 554 "Sender address rejected: Domain not found (in reply to RCPT TO command)". The reason for this is, that the file /etc/defaults/postsrsd contains the local domain of my bare-metal CoreOS cluster, which is not resolvable outside my network.
From what I learned so far, the domain-name is derived from the hostname, which is not using the correct domain.

Since I am using the OVERRIDE_HOSTNAME environment variable, it would be great, if the postsrsd configuration would also use the name set in this variable.

Thank you,
Martin

@johansmitsnl
Copy link
Contributor

@17Halbe could you check this?

@17Halbe
Copy link
Contributor

17Halbe commented Feb 19, 2018

First of all try if this would help: #844 (comment)
It might be easier than you think. ;) If that's the case, a update is on the way.
If it's actually the sender rewriting scheme daemon, I would need some more information, since to my knowledge there hasn't been a change to the OVERRIDE_HOSTNAME implementation recently nor to postsrsd.
Could you provide a log output after a failed send attempt?

@mherfurt
Copy link
Author

I added the files postfix-send-access.cf and postfix-receive-access.cf yesterday... after seeing the deamon complain about their absence in the logs. IMHO the described postsrsd issue is not related.

When postsrsd is running (in my case with the option '-d coreos.local', the receiving mailserver bounces back mails due to the header generated by postsrsd. The bounce reads as follows:

This is the mail system at host mail.mydomain.com.

I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can
delete your own text from the attached returned message.

                   The mail system

<account@receiver.com>: host mx.receiver.com[1.2.3.4] said: 554 5.1.8
    <srs0=llwm=fi=mydomain.com=myaccount@coreos.local>: Sender address
    rejected: Domain not found (in reply to RCPT TO command)

After manually editing /etc/defaul/postsrsd in order to replace SRS_DOMAIN=coreos.local with SRS_DOMAIN=mydomain.com and restarting the postsrsd process, the issue with sending to account@receiver.com disappears.

I am sorry for not including a log. Not every receiving mailserver reacts to this misconfiguration in this way - which makes it even harder to spot.

@17Halbe
Copy link
Contributor

17Halbe commented Feb 19, 2018

I‘m still curious why it worked before?! Any idea?
Would you like to provide a pull request?

@mherfurt
Copy link
Author

I am still curious as well. Since I am not pulling every single image, the issue was maybe introduced a longer time ago. Or maybe the issue existed already in earlier versions of my mailserver and I just did not notice the problems.
I am sorry for not being able to provide a pull request for this.

@17Halbe
Copy link
Contributor

17Halbe commented Feb 20, 2018

No problem. I'll see if I can trace down, why and what has changed tomorrow..

@17Halbe
Copy link
Contributor

17Halbe commented Feb 25, 2018

Ok, took me some time..
Can you have a look at #849 and if this would fix your issue as well?
(It didn't for me)
Otherwise the "bug" got introduced here: #814
Quick workaround would be to delete those lines in the /etc/postfix/main.cf:

sender_canonical_maps = tcp:localhost:10001
sender_canonical_classes = envelope_sender
recipient_canonical_maps = tcp:localhost:10002
recipient_canonical_classes = envelope_recipient,header_recipient

(Command would be something like this: docker exec mail sed -i /sender_canonical_/# sender_canonical_/g and docker exec mail sed -i /recipient_canonical_/# recipient_canonical_/g and thereafter reload postfix: docker exec mail service postfix reload)

This is a bug and has to be fixed

@alexanderkjeldaas
Copy link

I'll just chime in and say that with a dog standard docker setup, I also had to remove those 4 lines to make it work.

They also removed this stream of warnings:

Mar  3 20:30:41 e174f068ae91 postfix/cleanup[10909]: warning: connect to TCP map localhost:10001: Cannot assign requested address
Mar  3 20:30:42 e174f068ae91 postfix/cleanup[10909]: warning: connect to TCP map localhost:10001: Cannot assign requested address
Mar  3 20:30:43 e174f068ae91 postfix/cleanup[10909]: warning: connect to TCP map localhost:10001: Cannot assign requested address
Mar  3 20:30:44 e174f068ae91 postfix/cleanup[10909]: warning: connect to TCP map localhost:10001: Cannot assign requested address
Mar  3 20:30:45 e174f068ae91 postfix/cleanup[10909]: warning: connect to TCP map localhost:10001: Cannot assign requested address
Mar  3 20:30:46 e174f068ae91 postfix/cleanup[10909]: warning: connect to TCP map localhost:10001: Cannot assign requested address
Mar  3 20:30:47 e174f068ae91 postfix/cleanup[10909]: warning: connect to TCP map localhost:10001: Cannot assign requested address
Mar  3 20:30:48 e174f068ae91 postfix/cleanup[10909]: warning: connect to TCP map localhost:10001: Cannot assign requested address
Mar  3 20:30:49 e174f068ae91 postfix/cleanup[10909]: warning: connect to TCP map localhost:10001: Cannot assign requested address
Mar  3 20:30:50 e174f068ae91 postfix/cleanup[10909]: warning: connect to TCP map localhost:10001: Cannot assign requested address

@17Halbe
Copy link
Contributor

17Halbe commented Mar 3, 2018

Thanks for reporting!

johansmitsnl pushed a commit that referenced this issue Mar 18, 2018
* making postsrsd optional
* added tests, added documentation
johansmitsnl added a commit that referenced this issue Mar 19, 2018
Release 5.8.0

* Adding daily mail review from Issue 839 (#881)
  You can enable REPORT_RECIPIENT for REPORT_INTERVAL
  reports. Default is disabled.
* introducing ENABLE_SRS env variable (#906, #852)
  In v3.2.0 was SRS introduced and enabled by default
  Now it is disabled by default and can be enabled with
  the new env variable.
* fixed delalias, added additional tests (#909)
  Fixes to setup where made for deletion and addition.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants