[Mailman-Developers] Personal patch

Lindsay Haisley fmouse-mailman at fmp.com
Mon Jun 18 17:20:41 CEST 2012


On Sun, 2012-06-17 at 21:22 -0700, Mark Sapiro wrote:
>     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)) 
> 

Thanks, Mark.  I discovered that rdomain is a list and couldn't use it
as-is, and I assumed that recip was a data structure other than a simple
string and contained the subscriber name, but apparently it's only used
as an index to look up the name.

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

md5crypt is a Python module distributed, in Ubuntu and Mint at least,
with the Landscape admin tool.  It seems that crypt.crypt is limited to
8 characters in cleartext and is therefore mostly useful for passwords.
Any function that will generate a hash of an arbitrarily long email
address would do.

A simpler, better choice might be hashlib.md5(recip).hexdigest(), and no
need to mess with a salt, or a special purpose module.  Strong security
isn't an issue.  I only need a one-way hash that's quick to generate and
easily reproducible from cleartext. 

-- 
Lindsay Haisley       | "The only unchanging certainty
FMP Computer Services |    is the certainty of change"
512-259-1190          |
http://www.fmp.com    | - Ancient wisdom, all cultures



More information about the Mailman-Developers mailing list