Merge lp:~black-perl/mailman/handling-special-chars-in-email into lp:mailman

Proposed by Ankush Sharma on 2015-03-13
Status: Rejected
Rejected by: Barry Warsaw on 2015-05-12
Proposed branch: lp:~black-perl/mailman/handling-special-chars-in-email
Merge into: lp:mailman
Diff against target: 22 lines (+4/-1)
1 file modified
src/mailman/rest/root.py (+4/-1)
To merge this branch: bzr merge lp:~black-perl/mailman/handling-special-chars-in-email
Reviewer Review Type Date Requested Status
Barry Warsaw 2015-03-13 Needs Fixing on 2015-05-12
Review via email: mp+252867@code.launchpad.net

Description of the change

In case the mailman-client percent encodes any special character appeared in the list_id's or fqdn_listname's, the REST server should be able to decode it back. Added decoding support for it.
As discussed here: http://www.mail-archive.com/mailman-developers%40python.org/msg15317.html
Now mailman can also use emails with special characters [1] which earlier caused postorius to crash as discussed in the linked bug report.

[1] : http://oi58.tinypic.com/33u689i.jpg

To post a comment you must log in.
Barry Warsaw (barry) wrote :

Could you please add a test for this case, and port your branch over to gitlab:

https://gitlab.com/mailman/mailman

Thanks!

review: Needs Fixing
Ankush Sharma (black-perl) wrote :

Actually, discussed the bug with florianf. The endoded endpoint has to be decoded on the "core" end and therefore I did the patch in mailman-core. But, later I get to know that Falcon is smart and automatically decodes any encoded character in the URL. Therefore, I guess the "core" patch can be closed.

Barry Warsaw (barry) wrote :

Thanks!

Unmerged revisions

7304. By black-perl <email address hidden> on 2015-03-13

Added decoding support for the list identifier as per the fix for the issue #1429366.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/mailman/rest/root.py'
2--- src/mailman/rest/root.py 2015-02-13 08:13:06 +0000
3+++ src/mailman/rest/root.py 2015-03-13 09:28:31 +0000
4@@ -23,6 +23,7 @@
5
6
7 import falcon
8+import urllib.parse
9
10 from base64 import b64decode
11 from mailman.config import config
12@@ -192,7 +193,9 @@
13 else:
14 # list-id is preferred, but for backward compatibility,
15 # fqdn_listname is also accepted.
16- list_identifier = segments.pop(0)
17+ enc_list_identifier = segments.pop(0)
18+ # decoding the percent encoded list_identifier
19+ list_identifier = urllib.parse.unquote(enc_list_identifier)
20 return AList(list_identifier), segments
21
22 @child()