[Bug 680447] [NEW] parts of recipients adresses between square brackets in are interpreted as seperate addresses
Public bug reported: We use max_num_recipients as a vague spam detector and came to the conclusion that when counting, extra addresses are counted if an address contains [square brackets]. Example: test@lists.example.net, jefke [jefke2@foo.example.net], jefke3@example.net, jefke4@example.net in the To: or Cc: field will be counted as 6 adresses. I reckon this is interpreted as an array and flattened or something. (Yes, []'s are illegal in mail adresses but we receive messages like that anyway). Proposed solution: 's/\]/\\]/g' 's/\[/\\[/g' ** Affects: mailman Importance: Undecided Status: New -- parts of recipients adresses between square brackets in are interpreted as seperate addresses https://bugs.launchpad.net/bugs/680447 You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman.
There's not much Mailman can easily do about this. The issue is in the Python email library. email.utils.getaddresses() is used by Mailman to get a list of addresses and the length of that list is used as the number of recipients. getaddresses() treats the brackets as a kind of delimiter. Thus, email.utils.getaddresses(['jefke [jefke2@foo.example.net]']) returns this list of (name, address) tuples [('', 'jefke'), ('', ''), ('', 'jefke2@foo.example.net'), ('', '')] of length 4 instead of the list [('jefke', 'jefke2@foo.example.net')] of length 1 that you expect. Escaping the brackets as you suggest changes the result only in that a '\' is appended to the jefke2@foo.example.net address returned in the third tuple. ** Changed in: mailman Importance: Undecided => Low ** Changed in: mailman Status: New => Won't Fix ** Changed in: mailman Assignee: (unassigned) => Mark Sapiro (msapiro) -- You received this bug notification because you are a member of Mailman Coders, which is subscribed to GNU Mailman. https://bugs.launchpad.net/bugs/680447 Title: parts of recipients adresses between square brackets in are interpreted as seperate addresses
participants (2)
-
Mark Sapiro
-
yalu