[Mailman-Users] Help customizing VERP_CONFIRM_REGEXP

Mark Sapiro mark at msapiro.net
Fri Jul 18 05:46:18 CEST 2014


On 07/17/2014 08:28 AM, Pablo Montepagano wrote:
> 
> When confirmations are sent, the FROM header does not follow this
> pattern "Mailman <listaddr-confirm+cookie at example.org>", it just has
> the addres, i.e, "listaddr-confirm+cookie at example.org". I wolud like
> to add the "Mailman <" to the beginning and ">" at the end.


There are two ways to accomplish something like what you want. To do it
only in mm_cfg.py, there's no way to add the trailing '>', but you could set

VERP_CONFIRMATIONS = Yes
VERP_CONFIRM_FORMAT = '(Mailman) %(addr)s+%(cookie)s'
VERP_CONFIRM_REGEXP =
 r'(?s)^\(Mailman\) (.*<)?(?P<addr>.+)\+(?P<cookie>[0-9a-f]{40})@.*$'

That last should all be on one line. Also the "[0-9a-f]{40}" instead of
"[^@+]+" is not a necessary change, but it fixes a problem if the list
name contains a '+'

The above will create a From header "(Mailman)
listaddr-confirm+cookie at example.org and the regexp will recognize it in
replies, although the two MUAs I tried (Thunderbird and Mutt) will
address the reply to "Mailman <listaddr-confirm+cookie at example.org>"
which will be recognized by the default regexp.

The other way involves editing Mailman/MailList.py and changing

    def GetConfirmEmail(self, cookie):
        return mm_cfg.VERP_CONFIRM_FORMAT % {
            'addr'  : '%s-confirm' % self.internal_name(),
            'cookie': cookie,
            } + '@' + self.host_name

to

    def GetConfirmEmail(self, cookie):
        return 'Mailman <' + mm_cfg.VERP_CONFIRM_FORMAT % {
            'addr'  : '%s-confirm' % self.internal_name(),
            'cookie': cookie,
            } + '@' + self.host_name + '>'

This will produce a From: of "Mailman
<listaddr-confirm+cookie at example.org>" which will be recognized by the
default regexp, so only

VERP_CONFIRMATIONS = Yes

is needed in mm_cfg.py.

-- 
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