[Mailman-Users] Which user is harvesting sender emails?

Mark Sapiro mark at msapiro.net
Thu Aug 18 19:36:58 EDT 2016


On 08/18/2016 04:48 AM, Richard Hipp wrote:
>
> It would be great if there were some way to send a message where the
>>From field of each recipient was slightly different, and different in
> a way that was traceable back to the list member.  That would allow me
> to identify the leaker.


There are various things such as VERP and full personalization that add
recipient specific information to the envelope sender and headers such
as Sender:, Errors-To: and even To:, but these probably won't help.

Altering the From: based on recipient can be done by modifying the code.
Say you have a message "From: Ann User <ann at example.com>" and you want
to change that to "From: Ann User <ann+xxx at example.com>" where xxx is a
unique code for each recipient.

First, ensure that either

VERP_DELIVERY_INTERVAL = 1

is in mm_cfg.py to enable VERP or that the list's Non-digest options ->
personalize is Yes or Full personalization. This will make SMTPDirect.py
use the verpdeliver function to deliver a separate message to each
recipient.

Then you need to create a mapping from list members to the 'xxx' codes.
You can for example create a file with one line per list member of the form:

member1 at example.com code1
member2 at example.com code2
...

with a single space between the member address and the code.

Finally, at the beginning of Mailman/Handlers/SMTPDirect.py, following
the line

DOT = '.'

put

import re
CODES = {}
for line in open('path/to/above/file'):
    addr, code = line.split(' ')
    CODES[addr.lower()] = code

And then at the end of the verpdeliver function just before the line

        bulkdeliver(mlist, msgcopy, msgdata, envsender, failures, conn)

put

        code = CODES[recip.lower()]
        msgfrom = msgcopy['from']
        del msgcopy['from']
        msgcopy['From'] = re.sub('@', '+' + code + '@', msgfrom)

to add the +code to the From: address.

-- 
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-Users mailing list