[Mailman-Developers] Personal patch

Mark Sapiro mark at msapiro.net
Mon Jun 18 06:22:41 CEST 2012


Lindsay Haisley wrote:

>Can someone give me some feedback on the following patch to
>SMTPDirect.py - whatever I've overlooked, or done that might be
>dangerous?
[...]
>--- SMTPDirect.py.orig	2012-06-17 17:16:25.000000000 -0500
>+++ SMTPDirect.py	2012-06-17 21:17:25.000000000 -0500
>@@ -43,6 +43,8 @@
> from email.Utils import formataddr
> from email.Header import Header
> from email.Charset import Charset
>+from md5crypt import md5crypt
>+from random import choice
> 
> DOT = '.'
> 
>@@ -307,6 +309,9 @@
>                  'host'   : DOT.join(rdomain),
>                  }
>             envsender = '%s@%s' % ((mm_cfg.VERP_FORMAT % d), DOT.join(bdomain))
>+            saltmarsh = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrsyuvwxyz1234567890./"
>+            if not msgdata.has_key("X-subdata"):
>+                msgcopy["X-Subdata"] = md5crypt(rmailbox + "@" + DOT.join(rdomain), choice(saltmarsh) + choice(saltmarsh)) 


    rmailbox + "@" + DOT.join(rdomain)

just does the inverse of 

    rmailbox, rdomain = Utils.ParseEmail(recip)

So why not just make the above

>+                msgcopy["X-Subdata"] = md5crypt(recip, choice(saltmarsh) + choice(saltmarsh)) 


Other than that, it looks OK assuming there is an appropriate md5crypt
module in Mailman's path.

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Developers mailing list