![](https://secure.gravatar.com/avatar/a6453955dbc8c95002035100afe8036d.jpg?s=120&d=mm&r=g)
Hi!
i'm using mailman 2.1.5 on a Solaris box, and i've got a very rare issue...
if i try to post a list using a non-suscribed email address, and this email address is included in non-suscribers allowed senders, it accepts my post... but if i use a regular expression like this ^[A-Za-z0-9.\-_%]+@[A-Za-z0-9.-]*mynet.com$ and try to post using a from line using more than 30 characters (from line splits in two in mail header then) and an accent. Then, mailman doesn't accept this mail and return it to me, although this email address is under my.net.com domain.
Anyone can help, plz? =)
![](https://secure.gravatar.com/avatar/746f7519ba02fb0d815e59f305c53fa2.jpg?s=120&d=mm&r=g)
Jesús Oliván wrote:
First, while it is not the issue you are asking about, your regexp is probably more liberal than you want. I suggest something like
^[A-Za-z0-9.\-_%]+@([A-Za-z0-9.-]*\.)?mynet\.com$
to preclude matching things like
user@xyz.aaamynet.com
and
user@host.mynetxcom
As far as your question is concerned, the sender address is retrieved from the From: header using Python email library methods and functions. If there is a bug there, we'd have to see an exact copy of the split From: header to check that out.
Also, when your MUA folds the from header into multiple lines, it should not be folding inside the email address. If by chance, it is, then it is your MUA that is at fault.
In any case, I don't understand why this would affect only a regexp match and not a string match. The address that is being checked is the same in both cases.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/a6453955dbc8c95002035100afe8036d.jpg?s=120&d=mm&r=g)
I've applied changes in my regexp like u said, thanks!
and this is the From line you requested:
From: =?ISO-8859-1?Q?123456789-123456789-12345678=E99-123456789-123456789?= =?ISO-8859-1?Q?-123456789-123456789-?= <ccmjs@cc.mynet.com>
This one comes from a mail that has not beed accepted by mailman, although address in from is allowed by regexp in Allowed senders.
Thanks for your help.
Mark Sapiro escribió:
![](https://secure.gravatar.com/avatar/746f7519ba02fb0d815e59f305c53fa2.jpg?s=120&d=mm&r=g)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Jesús Oliván wrote:
The problem is a bug in some versions of the Python email library. This problem will occur whether the 'address' in *_these_nonmembers is a regexp or a string. It also does not depend on the 'real name' being RFC 2047 encoded. All that is required is that the 'real name' be long enough that the From: header folds into two lines. In this case, the email.Utils function getaddresses() returns a spurious extra 'address' based on the first line of the folded header and this is the 'address' we check against *_these_nonmembers instead of checking the real address.
This bug exists in Mailman through 2.1.9. I will work around it for Mailman 2.1.10.
Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32)
iD8DBQFGhSXFVVuXXpU7hpMRAkRpAKDYF1Lk1dsNRfVAgX8QomeswrkadwCfbmVN Yk6i/KOIfDCFHUrUGUhurq4= =dH8a -----END PGP SIGNATURE-----
![](https://secure.gravatar.com/avatar/a6453955dbc8c95002035100afe8036d.jpg?s=120&d=mm&r=g)
We've got this mailman version in a production environment and users that are not suscribed to a list cannot publish any message and the worst fact is that sender cannot know if his message has been sended, cause "From" address doesn't exist. Is there any modification we can do (some code inside a function) to patch this little bug?
Thanks for your great help =)
Mark Sapiro escribió:
![](https://secure.gravatar.com/avatar/746f7519ba02fb0d815e59f305c53fa2.jpg?s=120&d=mm&r=g)
Jesús Oliván wrote:
The workaround is rev 984 at <http://codebrowse.launchpad.net/~mailman-coders/mailman/2.1/changes>.
The patch is also attached to this message.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/a6453955dbc8c95002035100afe8036d.jpg?s=120&d=mm&r=g)
Thanks for your help, but problem still persists: i'm trying to send a test mail from cmd line, with a from that's not suscribed to list "prova-rest-l" but it's included in authorized senders pattern (*@uab.es): /opt/mailman/mail/mailman post prova-rest-l < correu.txt correu.txt: ----------- Return-Path: <prova@uab.cat> Received: from tvenezia.uab.es ([127.0.0.1]) by tvenezia.uab.es (Sun Java System Messaging Server 6.1 HotFix 0.10 (built Jan 6 2005)) id <0JKN00M01L79UU00@tvenezia.uab.es> (original mail from prova@uab.cat) for prova-rest-l@llistes.uab.es; Wed, 04 Jul 2007 13:57:09 +0200 (CEST) Received: from tvenezia.uab.es ([127.0.0.1]) by tvenezia.uab.es (Sun Java System Messaging Server 6.1 HotFix 0.10 (built Jan 6 2005)) with ESMTP id <0JKN0035KL77ME00@tvenezia.uab.es> for prova-rest-l@llistes.uab.es; Wed, 04 Jul 2007 13:57:08 +0200 (CEST) Received: from [158.109.164.123] by tvenezia.uab.es (Sun Java System Messaging Server 6.1 HotFix 0.10 (built Jan 6 2005)) with ESMTPS id <0JKN00G0OL765Z00@tvenezia.uab.es> for prova-rest-l@llistes.uab.es; Wed, 04 Jul 2007 13:57:06 +0200 (CEST) Date: Wed, 04 Jul 2007 13:57:02 +0200 From: =?ISO-8859-1?Q?test12345=E16789-12345=E16789-12345=E16789-12345=E16?= =?ISO-8859-1?Q?789-12345=E16789-?= <prova@uab.cat> Subject: tttt To: prova-rest-l@llistes.uab.es Message-id: <468B8B0E.2000503@uab.cat> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) tttt -------------- we greatly appreciate your help :) Mark Sapiro escribió:
![](https://secure.gravatar.com/avatar/746f7519ba02fb0d815e59f305c53fa2.jpg?s=120&d=mm&r=g)
Jesús Oliván wrote:
Thanks for your help, but problem still persists:
I assume you installed the patch.
The address in the mail is <prova@uab.cat> which doesn't match this pattern.
/opt/mailman/mail/mailman post prova-rest-l < correu.txt
And what happens when you post the message?
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/a6453955dbc8c95002035100afe8036d.jpg?s=120&d=mm&r=g)
Yes, patch is installed.
Sorry, pattern was *@uab.cat, but we own uab.es too.
When message is sent, we receive this response:
El missatge adjunt ha estat automàticament descartat.
Asunto: tttt De: test12345á6789-12345á6789-12345á6789-12345á6789-12345á6789- <prova@uab.cat> Fecha: Wed, 04 Jul 2007 13:57:02 +0200
Para: prova-rest-l@llistes.uab.es
Return-path: <prova@uab.cat> Received: from tvenezia.uab.es ([127.0.0.1]) by tvenezia.uab.es (Sun Java System Messaging Server 6.1 HotFix 0.10 (built Jan 6 2005)) id <0JKN00M01L79UU00@tvenezia.uab.es> (original mail from prova@uab.cat) for prova-rest-l@llistes.uab.es; Wed, 04 Jul 2007 13:57:09 +0200 (CEST) Received: from tvenezia.uab.es ([127.0.0.1]) by tvenezia.uab.es (Sun Java System Messaging Server 6.1 HotFix 0.10 (built Jan 6 2005)) with ESMTP id <0JKN0035KL77ME00@tvenezia.uab.es> for prova-rest-l@llistes.uab.es; Wed, 04 Jul 2007 13:57:08 +0200 (CEST) Received: from [158.109.164.123] by tvenezia.uab.es (Sun Java System Messaging Server 6.1 HotFix 0.10 (built Jan 6 2005)) with ESMTPS id <0JKN00G0OL765Z00@tvenezia.uab.es> for prova-rest-l@llistes.uab.es; Wed, 04 Jul 2007 13:57:06 +0200 (CEST) Message-ID: <468B8B0E.2000503@uab.cat> MIME-Version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit Agente de usuario:: Thunderbird 2.0.0.4 (Windows/20070604)
tttt
Mark Sapiro escribió:
![](https://secure.gravatar.com/avatar/746f7519ba02fb0d815e59f305c53fa2.jpg?s=120&d=mm&r=g)
Jesús Oliván wrote:
So it appears that with the patch installed, Mailman is properly unfolding and decoding the the folded RFC 2047 encoded From: header in the post.
However, I find it very curious that this 'forwarded post' seems to be missing the Date:, From:, Subject and To: headers from the original post and the User-Agent: header has been changed to 'Agente de usuario::'.
What happens if you attempt to post a message with simply
From: test <prova@uab.cat>
instead of the RFC 2047 encoded and folded From: header?
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/a6453955dbc8c95002035100afe8036d.jpg?s=120&d=mm&r=g)
Sorry for delay, it was holidays time and today i've returned.
When i try to send a mail with a from like this:
From: test <prova@uab.cat>
It works fine and mail arrived to list.
Problem seems to appear when From line exceeds certain number of characters (>50) and contains accents, when it occurs From line splits in two, and mail didn't arrive to destiny list. Another problem comes when system tries to send returned mail to sender and From line didn't exist, then sender never knows that its mail hasd not arrived to list.
Thanks!
Mark Sapiro escribió:
![](https://secure.gravatar.com/avatar/746f7519ba02fb0d815e59f305c53fa2.jpg?s=120&d=mm&r=g)
Jesús Oliván wrote:
Have you installed the patch I gave you in an earlier reply and which can be found at <http://mail.python.org/pipermail/mailman-users/attachments/20070709/c08e6575...>, and did you restart mailman (bin/mailmanctl restart) after installing the patch?
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/746f7519ba02fb0d815e59f305c53fa2.jpg?s=120&d=mm&r=g)
Jesús Oliván wrote:
First, while it is not the issue you are asking about, your regexp is probably more liberal than you want. I suggest something like
^[A-Za-z0-9.\-_%]+@([A-Za-z0-9.-]*\.)?mynet\.com$
to preclude matching things like
user@xyz.aaamynet.com
and
user@host.mynetxcom
As far as your question is concerned, the sender address is retrieved from the From: header using Python email library methods and functions. If there is a bug there, we'd have to see an exact copy of the split From: header to check that out.
Also, when your MUA folds the from header into multiple lines, it should not be folding inside the email address. If by chance, it is, then it is your MUA that is at fault.
In any case, I don't understand why this would affect only a regexp match and not a string match. The address that is being checked is the same in both cases.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/a6453955dbc8c95002035100afe8036d.jpg?s=120&d=mm&r=g)
I've applied changes in my regexp like u said, thanks!
and this is the From line you requested:
From: =?ISO-8859-1?Q?123456789-123456789-12345678=E99-123456789-123456789?= =?ISO-8859-1?Q?-123456789-123456789-?= <ccmjs@cc.mynet.com>
This one comes from a mail that has not beed accepted by mailman, although address in from is allowed by regexp in Allowed senders.
Thanks for your help.
Mark Sapiro escribió:
![](https://secure.gravatar.com/avatar/746f7519ba02fb0d815e59f305c53fa2.jpg?s=120&d=mm&r=g)
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Jesús Oliván wrote:
The problem is a bug in some versions of the Python email library. This problem will occur whether the 'address' in *_these_nonmembers is a regexp or a string. It also does not depend on the 'real name' being RFC 2047 encoded. All that is required is that the 'real name' be long enough that the From: header folds into two lines. In this case, the email.Utils function getaddresses() returns a spurious extra 'address' based on the first line of the folded header and this is the 'address' we check against *_these_nonmembers instead of checking the real address.
This bug exists in Mailman through 2.1.9. I will work around it for Mailman 2.1.10.
Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32)
iD8DBQFGhSXFVVuXXpU7hpMRAkRpAKDYF1Lk1dsNRfVAgX8QomeswrkadwCfbmVN Yk6i/KOIfDCFHUrUGUhurq4= =dH8a -----END PGP SIGNATURE-----
![](https://secure.gravatar.com/avatar/a6453955dbc8c95002035100afe8036d.jpg?s=120&d=mm&r=g)
We've got this mailman version in a production environment and users that are not suscribed to a list cannot publish any message and the worst fact is that sender cannot know if his message has been sended, cause "From" address doesn't exist. Is there any modification we can do (some code inside a function) to patch this little bug?
Thanks for your great help =)
Mark Sapiro escribió:
![](https://secure.gravatar.com/avatar/746f7519ba02fb0d815e59f305c53fa2.jpg?s=120&d=mm&r=g)
Jesús Oliván wrote:
The workaround is rev 984 at <http://codebrowse.launchpad.net/~mailman-coders/mailman/2.1/changes>.
The patch is also attached to this message.
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/a6453955dbc8c95002035100afe8036d.jpg?s=120&d=mm&r=g)
Thanks for your help, but problem still persists: i'm trying to send a test mail from cmd line, with a from that's not suscribed to list "prova-rest-l" but it's included in authorized senders pattern (*@uab.es): /opt/mailman/mail/mailman post prova-rest-l < correu.txt correu.txt: ----------- Return-Path: <prova@uab.cat> Received: from tvenezia.uab.es ([127.0.0.1]) by tvenezia.uab.es (Sun Java System Messaging Server 6.1 HotFix 0.10 (built Jan 6 2005)) id <0JKN00M01L79UU00@tvenezia.uab.es> (original mail from prova@uab.cat) for prova-rest-l@llistes.uab.es; Wed, 04 Jul 2007 13:57:09 +0200 (CEST) Received: from tvenezia.uab.es ([127.0.0.1]) by tvenezia.uab.es (Sun Java System Messaging Server 6.1 HotFix 0.10 (built Jan 6 2005)) with ESMTP id <0JKN0035KL77ME00@tvenezia.uab.es> for prova-rest-l@llistes.uab.es; Wed, 04 Jul 2007 13:57:08 +0200 (CEST) Received: from [158.109.164.123] by tvenezia.uab.es (Sun Java System Messaging Server 6.1 HotFix 0.10 (built Jan 6 2005)) with ESMTPS id <0JKN00G0OL765Z00@tvenezia.uab.es> for prova-rest-l@llistes.uab.es; Wed, 04 Jul 2007 13:57:06 +0200 (CEST) Date: Wed, 04 Jul 2007 13:57:02 +0200 From: =?ISO-8859-1?Q?test12345=E16789-12345=E16789-12345=E16789-12345=E16?= =?ISO-8859-1?Q?789-12345=E16789-?= <prova@uab.cat> Subject: tttt To: prova-rest-l@llistes.uab.es Message-id: <468B8B0E.2000503@uab.cat> MIME-version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) tttt -------------- we greatly appreciate your help :) Mark Sapiro escribió:
![](https://secure.gravatar.com/avatar/746f7519ba02fb0d815e59f305c53fa2.jpg?s=120&d=mm&r=g)
Jesús Oliván wrote:
Thanks for your help, but problem still persists:
I assume you installed the patch.
The address in the mail is <prova@uab.cat> which doesn't match this pattern.
/opt/mailman/mail/mailman post prova-rest-l < correu.txt
And what happens when you post the message?
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/a6453955dbc8c95002035100afe8036d.jpg?s=120&d=mm&r=g)
Yes, patch is installed.
Sorry, pattern was *@uab.cat, but we own uab.es too.
When message is sent, we receive this response:
El missatge adjunt ha estat automàticament descartat.
Asunto: tttt De: test12345á6789-12345á6789-12345á6789-12345á6789-12345á6789- <prova@uab.cat> Fecha: Wed, 04 Jul 2007 13:57:02 +0200
Para: prova-rest-l@llistes.uab.es
Return-path: <prova@uab.cat> Received: from tvenezia.uab.es ([127.0.0.1]) by tvenezia.uab.es (Sun Java System Messaging Server 6.1 HotFix 0.10 (built Jan 6 2005)) id <0JKN00M01L79UU00@tvenezia.uab.es> (original mail from prova@uab.cat) for prova-rest-l@llistes.uab.es; Wed, 04 Jul 2007 13:57:09 +0200 (CEST) Received: from tvenezia.uab.es ([127.0.0.1]) by tvenezia.uab.es (Sun Java System Messaging Server 6.1 HotFix 0.10 (built Jan 6 2005)) with ESMTP id <0JKN0035KL77ME00@tvenezia.uab.es> for prova-rest-l@llistes.uab.es; Wed, 04 Jul 2007 13:57:08 +0200 (CEST) Received: from [158.109.164.123] by tvenezia.uab.es (Sun Java System Messaging Server 6.1 HotFix 0.10 (built Jan 6 2005)) with ESMTPS id <0JKN00G0OL765Z00@tvenezia.uab.es> for prova-rest-l@llistes.uab.es; Wed, 04 Jul 2007 13:57:06 +0200 (CEST) Message-ID: <468B8B0E.2000503@uab.cat> MIME-Version: 1.0 Content-type: text/plain; charset=ISO-8859-1; format=flowed Content-transfer-encoding: 7bit Agente de usuario:: Thunderbird 2.0.0.4 (Windows/20070604)
tttt
Mark Sapiro escribió:
![](https://secure.gravatar.com/avatar/746f7519ba02fb0d815e59f305c53fa2.jpg?s=120&d=mm&r=g)
Jesús Oliván wrote:
So it appears that with the patch installed, Mailman is properly unfolding and decoding the the folded RFC 2047 encoded From: header in the post.
However, I find it very curious that this 'forwarded post' seems to be missing the Date:, From:, Subject and To: headers from the original post and the User-Agent: header has been changed to 'Agente de usuario::'.
What happens if you attempt to post a message with simply
From: test <prova@uab.cat>
instead of the RFC 2047 encoded and folded From: header?
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
![](https://secure.gravatar.com/avatar/a6453955dbc8c95002035100afe8036d.jpg?s=120&d=mm&r=g)
Sorry for delay, it was holidays time and today i've returned.
When i try to send a mail with a from like this:
From: test <prova@uab.cat>
It works fine and mail arrived to list.
Problem seems to appear when From line exceeds certain number of characters (>50) and contains accents, when it occurs From line splits in two, and mail didn't arrive to destiny list. Another problem comes when system tries to send returned mail to sender and From line didn't exist, then sender never knows that its mail hasd not arrived to list.
Thanks!
Mark Sapiro escribió:
![](https://secure.gravatar.com/avatar/746f7519ba02fb0d815e59f305c53fa2.jpg?s=120&d=mm&r=g)
Jesús Oliván wrote:
Have you installed the patch I gave you in an earlier reply and which can be found at <http://mail.python.org/pipermail/mailman-users/attachments/20070709/c08e6575...>, and did you restart mailman (bin/mailmanctl restart) after installing the patch?
-- Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
participants (2)
-
Jesús Oliván
-
Mark Sapiro