
Hey everybody!
I have a strange problem using mailman 2.1.13: Every time, a mail is sent to one of the lists, the real sender address is replaced by somelocaluser@example.com (somelocaluser being a unix user on the server and example.com being the domain). This is very inconvenient since some of the addresses doesn't even exist. Interestingly only the address is changed; the name is unaltered. For example "John Doe <john@thedoefamily.com>" might become "John Doe <root@example.com>".
In all the logs that I checked, the sender address was the correct one. Even in the pipermail archives the address is correct but not in the various MUAs of the subscribers. In every case the header information itself was wrong in the source code of the mail. Sending e-mails to the recipient directly through the mail server worked fine in every case (this is why I assume the problem lies with mailman).
This problem is driving me crazy...
Cheers Michael

Michael Smith wrote:
I have been working a similar but not identical problem (From: header replaced with one containing Sender: or the envelope sender). See the thread at <http://mail.python.org/pipermail/mailman-users/2013-February/074709.html> for the start of this.
I gave him the attached patch to Mailman/Handlers/SMTPDirect.py, which logs the content of the messages From: and Message-ID: headers upon entry to SMTPDirect.py and after delivery to the outgoing MTA. The From: is unchanged in these log messages, and the ultimate, erroneous From: has been added after (above in the message headers) the Received: header added by the outgoing MTA.
Thus, it seems that the header must be munged or removed after initial SMTP delivery to the outgoing MTA. You might try the patch and see if the same appears true in your case.
The instructions I provided with the patch (his MTA is Postfix) are:
SMTPDirect.patch.txt is a patch you can apply to Mailman/Handlers/SMTPDirect.py via the command
patch /path/to/Mailman/Handlers/SMTPDirect.py /path/to/SMTPDirect.patch.txt
(all on one line). This adds two statements to log to Mailman's 'debug' log the values of each message's From: header and Message-ID: header upon entry and after sending the message. Apply this patch and restart Mailman and then look at Mailman's 'debug' log after a post.
Then you can remove the patch via
patch -R /path/to/Mailman/Handlers/SMTPDirect.py /path/to/SMTPDirect.patch.txt
(again, all on one line) and restart Mailman. The information in the debug log will tell us whether the message had a good From: upon entry to SMTPDirect and whether it had a good From: upon delivery to Postfix.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

- Michael Smith <msmith13337@gmail.com>:
I missed the patch... Could you send it to me and I can comment on that :)
Could you share the log-lines (in private, won't disclose them).
The culprit COULD be the Postfix settings: local_header_rewrite_clients remote_header_rewrite_domain
Their defaults are: local_header_rewrite_clients = permit_inet_interfaces remote_header_rewrite_domain =
Personally, I'm using local_header_rewrite_clients = remote_header_rewrite_domain = (never ever rewrite)
-- Ralf Hildebrandt Charite Universitätsmedizin Berlin ralf.hildebrandt@charite.de Campus Benjamin Franklin http://www.charite.de Hindenburgdamm 30, 12203 Berlin Geschäftsbereich IT, Abt. Netzwerk fon: +49-30-450.570.155

- Ralf Hildebrandt <Ralf.Hildebrandt@charite.de>:
I missed the patch... Could you send it to me and I can comment on that :)
Found it. Hm. Postfix definitely logs rewrite operations.
-- Ralf Hildebrandt Charite Universitätsmedizin Berlin ralf.hildebrandt@charite.de Campus Benjamin Franklin http://www.charite.de Hindenburgdamm 30, 12203 Berlin Geschäftsbereich IT, Abt. Netzwerk fon: +49-30-450.570.155

Hey there.
After a while, I found out that this problem only occurred with some addresses. I found out that all addresses in the postfix sender-table were replaced by (v)username@domain.tld . This is very bad, because the mail domain for real (unix) users has to differ from the one for virtual users in postfix (of course forwarding could be used; but because I didn't, the addresses didn't exist). I still don't know, why this started to happen from one day to another, but the solution suggested by Ralf omits the issue: just set
local_header_rewrite_clients =
in the postfix config.
Cheers and thanks for the help Michael
On 19 February 2013 15:36, Ralf Hildebrandt <Ralf.Hildebrandt@charite.de>wrote:

Michael Smith wrote:
I have been working a similar but not identical problem (From: header replaced with one containing Sender: or the envelope sender). See the thread at <http://mail.python.org/pipermail/mailman-users/2013-February/074709.html> for the start of this.
I gave him the attached patch to Mailman/Handlers/SMTPDirect.py, which logs the content of the messages From: and Message-ID: headers upon entry to SMTPDirect.py and after delivery to the outgoing MTA. The From: is unchanged in these log messages, and the ultimate, erroneous From: has been added after (above in the message headers) the Received: header added by the outgoing MTA.
Thus, it seems that the header must be munged or removed after initial SMTP delivery to the outgoing MTA. You might try the patch and see if the same appears true in your case.
The instructions I provided with the patch (his MTA is Postfix) are:
SMTPDirect.patch.txt is a patch you can apply to Mailman/Handlers/SMTPDirect.py via the command
patch /path/to/Mailman/Handlers/SMTPDirect.py /path/to/SMTPDirect.patch.txt
(all on one line). This adds two statements to log to Mailman's 'debug' log the values of each message's From: header and Message-ID: header upon entry and after sending the message. Apply this patch and restart Mailman and then look at Mailman's 'debug' log after a post.
Then you can remove the patch via
patch -R /path/to/Mailman/Handlers/SMTPDirect.py /path/to/SMTPDirect.patch.txt
(again, all on one line) and restart Mailman. The information in the debug log will tell us whether the message had a good From: upon entry to SMTPDirect and whether it had a good From: upon delivery to Postfix.
-- Mark Sapiro <mark@msapiro.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan

- Michael Smith <msmith13337@gmail.com>:
I missed the patch... Could you send it to me and I can comment on that :)
Could you share the log-lines (in private, won't disclose them).
The culprit COULD be the Postfix settings: local_header_rewrite_clients remote_header_rewrite_domain
Their defaults are: local_header_rewrite_clients = permit_inet_interfaces remote_header_rewrite_domain =
Personally, I'm using local_header_rewrite_clients = remote_header_rewrite_domain = (never ever rewrite)
-- Ralf Hildebrandt Charite Universitätsmedizin Berlin ralf.hildebrandt@charite.de Campus Benjamin Franklin http://www.charite.de Hindenburgdamm 30, 12203 Berlin Geschäftsbereich IT, Abt. Netzwerk fon: +49-30-450.570.155

- Ralf Hildebrandt <Ralf.Hildebrandt@charite.de>:
I missed the patch... Could you send it to me and I can comment on that :)
Found it. Hm. Postfix definitely logs rewrite operations.
-- Ralf Hildebrandt Charite Universitätsmedizin Berlin ralf.hildebrandt@charite.de Campus Benjamin Franklin http://www.charite.de Hindenburgdamm 30, 12203 Berlin Geschäftsbereich IT, Abt. Netzwerk fon: +49-30-450.570.155

Hey there.
After a while, I found out that this problem only occurred with some addresses. I found out that all addresses in the postfix sender-table were replaced by (v)username@domain.tld . This is very bad, because the mail domain for real (unix) users has to differ from the one for virtual users in postfix (of course forwarding could be used; but because I didn't, the addresses didn't exist). I still don't know, why this started to happen from one day to another, but the solution suggested by Ralf omits the issue: just set
local_header_rewrite_clients =
in the postfix config.
Cheers and thanks for the help Michael
On 19 February 2013 15:36, Ralf Hildebrandt <Ralf.Hildebrandt@charite.de>wrote:
participants (3)
-
Mark Sapiro
-
Michael Smith
-
Ralf Hildebrandt