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

Proposed by Ankush Sharma
Status: Rejected
Rejected by: Barry Warsaw
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 Needs Fixing
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.
Revision history for this message
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
Revision history for this message
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.

Revision history for this message
Barry Warsaw (barry) wrote :

Thanks!

Unmerged revisions

7304. By black-perl <email address hidden>

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
=== modified file 'src/mailman/rest/root.py'
--- src/mailman/rest/root.py 2015-02-13 08:13:06 +0000
+++ src/mailman/rest/root.py 2015-03-13 09:28:31 +0000
@@ -23,6 +23,7 @@
2323
2424
25import falcon25import falcon
26import urllib.parse
2627
27from base64 import b64decode28from base64 import b64decode
28from mailman.config import config29from mailman.config import config
@@ -192,7 +193,9 @@
192 else:193 else:
193 # list-id is preferred, but for backward compatibility,194 # list-id is preferred, but for backward compatibility,
194 # fqdn_listname is also accepted.195 # fqdn_listname is also accepted.
195 list_identifier = segments.pop(0)196 enc_list_identifier = segments.pop(0)
197 # decoding the percent encoded list_identifier
198 list_identifier = urllib.parse.unquote(enc_list_identifier)
196 return AList(list_identifier), segments199 return AList(list_identifier), segments
197200
198 @child()201 @child()