Re: [Mailman-Users] Help customizing VERP_CONFIRM_REGEXP

2014-07-18 Thread Pablo Montepagano
THANK YOU! Worked like a charm. I owe you a beer, at least. :)

On Fri, Jul 18, 2014 at 12:46 AM, Mark Sapiro m...@msapiro.net wrote:
 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+coo...@example.org, it just has
 the addres, i.e, listaddr-confirm+coo...@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\) (.*)?(?Paddr.+)\+(?Pcookie[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+coo...@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+coo...@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+coo...@example.org which will be recognized by the
 default regexp, so only

 VERP_CONFIRMATIONS = Yes

 is needed in mm_cfg.py.

 --
 Mark Sapiro m...@msapiro.netThe highway is for gamblers,
 San Francisco Bay Area, Californiabetter use your sense - B. Dylan
 --
 Mailman-Users mailing list Mailman-Users@python.org
 https://mail.python.org/mailman/listinfo/mailman-users
 Mailman FAQ: http://wiki.list.org/x/AgA3
 Security Policy: http://wiki.list.org/x/QIA9
 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
 Unsubscribe: 
 https://mail.python.org/mailman/options/mailman-users/pablo%40montepagano.com.ar
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org


[Mailman-Users] Help customizing VERP_CONFIRM_REGEXP

2014-07-17 Thread Pablo Montepagano
I have enabled in my server VERP_CONFIRMATIONS so that the subject of
email confirmations is more human-friendly. But I would also like to
change the format of the From: header of email confirmations.

Currently they follow the default value of VERP_CONFIRM_REGEXP. I've
been trying to change it so that I can get something like this:

From: Mailman listaddr-confirm+coo...@example.org


This is currently in my mm_cfg.py:

VERP_CONFIRM_REGEXP = r'(?s)^(.*)?(?Paddr.+)\+(?Pcookie[^@+]+)@.*$'
VERP_CONFIRMATIONS = Yes

Does anyone know how to do this?

I'm running mailman 2.1.13

Thanks in advance,

Pablo
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Help customizing VERP_CONFIRM_REGEXP

2014-07-17 Thread Mark Sapiro
On 07/16/2014 03:18 PM, Pablo Montepagano wrote:
 
 Currently they follow the default value of VERP_CONFIRM_REGEXP. I've
 been trying to change it so that I can get something like this:
 
 From: Mailman listaddr-confirm+coo...@example.org


That is what you get by default if VERP_CONFIRMATIONS = Yes


 This is currently in my mm_cfg.py:
 
 VERP_CONFIRM_REGEXP = r'(?s)^(.*)?(?Paddr.+)\+(?Pcookie[^@+]+)@.*$'

Wht are you changing this in this way? It should work, but so should the
default. You should only need to change VERP_CONFIRM_REGEXp if you've
changed VERP_CONFIRM_FORMAT.


 VERP_CONFIRMATIONS = Yes
 
 Does anyone know how to do this?


I do not understand what the problem is. Are you not getting the From:
you want? If not, did you restart Mailman after changing mm_cfg.py?

-- 
Mark Sapiro m...@msapiro.netThe highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Help customizing VERP_CONFIRM_REGEXP

2014-07-17 Thread Pablo Montepagano
I'm sorry for not being clear. VERP_CONFIRM_REGEXP is set to the same
value that comes with Defaults.py

When confirmations are sent, the FROM header does not follow this
pattern Mailman listaddr-confirm+coo...@example.org, it just has
the addres, i.e, listaddr-confirm+coo...@example.org. I wolud like
to add the Mailman  to the beginning and  at the end.

Why? So that those who receive the invitation/confirmation email see a
human readable name in the From header.

Hope I'm being clear. Thanks!

On Thu, Jul 17, 2014 at 11:21 AM, Mark Sapiro m...@msapiro.net wrote:
 On 07/16/2014 03:18 PM, Pablo Montepagano wrote:

 Currently they follow the default value of VERP_CONFIRM_REGEXP. I've
 been trying to change it so that I can get something like this:

 From: Mailman listaddr-confirm+coo...@example.org


 That is what you get by default if VERP_CONFIRMATIONS = Yes


 This is currently in my mm_cfg.py:

 VERP_CONFIRM_REGEXP = r'(?s)^(.*)?(?Paddr.+)\+(?Pcookie[^@+]+)@.*$'

 Wht are you changing this in this way? It should work, but so should the
 default. You should only need to change VERP_CONFIRM_REGEXp if you've
 changed VERP_CONFIRM_FORMAT.


 VERP_CONFIRMATIONS = Yes

 Does anyone know how to do this?


 I do not understand what the problem is. Are you not getting the From:
 you want? If not, did you restart Mailman after changing mm_cfg.py?

 --
 Mark Sapiro m...@msapiro.netThe highway is for gamblers,
 San Francisco Bay Area, Californiabetter use your sense - B. Dylan
 --
 Mailman-Users mailing list Mailman-Users@python.org
 https://mail.python.org/mailman/listinfo/mailman-users
 Mailman FAQ: http://wiki.list.org/x/AgA3
 Security Policy: http://wiki.list.org/x/QIA9
 Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
 Unsubscribe: 
 https://mail.python.org/mailman/options/mailman-users/pablo%40montepagano.com.ar
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org


Re: [Mailman-Users] Help customizing VERP_CONFIRM_REGEXP

2014-07-17 Thread Mark Sapiro
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+coo...@example.org, it just has
 the addres, i.e, listaddr-confirm+coo...@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\) (.*)?(?Paddr.+)\+(?Pcookie[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+coo...@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+coo...@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+coo...@example.org which will be recognized by the
default regexp, so only

VERP_CONFIRMATIONS = Yes

is needed in mm_cfg.py.

-- 
Mark Sapiro m...@msapiro.netThe highway is for gamblers,
San Francisco Bay Area, Californiabetter use your sense - B. Dylan
--
Mailman-Users mailing list Mailman-Users@python.org
https://mail.python.org/mailman/listinfo/mailman-users
Mailman FAQ: http://wiki.list.org/x/AgA3
Security Policy: http://wiki.list.org/x/QIA9
Searchable Archives: http://www.mail-archive.com/mailman-users%40python.org/
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-users/archive%40jab.org