-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Return-Path and thus bounce handling not working #908
Comments
Are you able to check the Return-Path header on the SMTP side? Maybe the SMTP server is overriding the header you’re setting in listmonk? |
I can confirm that the Return-Path custom header setting as described in the documentation does NOT work (see https://listmonk.app/docs/bounces/). The workaround I found is to change it via mimedefang:
|
That means the header set by listmonk isn't respected by the SMTP server. Since you mentioned sendmail, how exactly is listmonk connecting to your SMTP server? |
Actually Listmonk is configured to connect via smtp to localhost. The Sendmail log shows: The "from" address in Sendmail is the Mail-From address (also called "envelope sender" or "return-path") passed by the application. There's no way to change it unless using a milter like mimedefang. |
I just came about this issue as well. My conclusion from some research is, that I think the receiving SMTP server is correct in ignoring the RFC2821 (SMTP) states on p. 51
The RFC elaborates a bit on this on the page. In my understanding, the correct way would be to not set a Looking at the source of smtppool.email, this could be done by setting the As this is a bit different than setting a header, but still a very desired functionality, I see two possible options to implement this:
On a side note: |
Sender / From wouldn't make a difference. It looks like the |
Sorry, I missed your reply before. You closed the issue, but I think this is not yet resolved. I think there is a slight misunderstanding with the different Often, these two The email library you forked handles these two possible The from, err := e.parseSender() instead of from, err := mail.ParseAddress(e.From) Then the After this is changed, we would need a way to actually set the I want to also detail a bit the workaround I described: While this works (a comment describes that the ( |
Ah, just realised, the https://github.com/knadh/smtppool/blob/master/pool.go#L373 if err = c.conn.Mail(from.Address); err != nil {
return true, err
} There's no way to set a separate envelope sender and a from address. We can only pass one address via the |
The The necessary headers are created by email.go before. |
Duh! Understood, finally! Will test this out and figure out a way to incorporate on the UI. Maybe it can just be picked up from the custom headers input rather than a new field. |
The |
I also think I could try to create a PR if you want, even though my Go skills are still very limited. |
The return-path branch has this change. The However, when I tried this with Gmail and SES and both, both still inject their own |
I would like to test it but I can only install/update Liskmonk from a Linux binary file (listmonk_2.X.X_linux_amd64.tar.gz). I can provide the smtp servers. My experience is mostly on Sendmail but a temporary Postfix instance should not be a problem. |
@andreafa here's the compiled binary for the If you're unable to run this, please e-mail the test credentials to kailash [at] nadh.in |
The Return-Path header WORKS, well done! It does NOT work in "Settings -> SMTP -> Custom headers box" |
Could you please try this updated build? listmonk-return-path.tar.gz
|
Verified. Now it works fine with the Return-Path header Thanks! P.S. I don't think I need to check this with Postfix, they should behave the same way. |
Thanks for your patience! This is good to be merged. Needn't test with Postfix. |
Sorry for the delay. But I would suggest a slightly different implementation:
See my suggestin in PR #1008 |
Great, thanks. |
Version:
Some configuration infos:
Bounce handling is listmonk is on and listmonk expects bounces in a pop3 mailbox.
Description of the bug:
For all outgoing e-mails sent from listmonk, the "Return-Path" header is always exactly the same as the "From" header. Changing the "Return-Path" via custom headers in the campaign settings does not seem to do anything. Changing other headers such as "Errors-To" works.
For us, this means, that currently bounces are not sent back to the correct mailbox.
It has to be possible in listmonk to set "Return-Path" to a custom mail address, especially considering that our installation will use many different "From" addresses.
Steps to reproduce:
The text was updated successfully, but these errors were encountered: