[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] mail address handling in mailer.py

From: Mathias Weinert <mathias.weinert_at_gfa-net.de>
Date: 2006-07-04 13:59:12 CEST

Mathias Weinert wrote:
> Agreed. But we cannot be sure that this is the case all the time.
> IMHO, I would not open a possible security hole (even if it's very
> unlike that it can be used to do any harm) as long as there is an
> other possibility to achieve a similar result.
>
> My favourite solution is to allow to define the split character in front
> of the mail addresses. For me
> to_addr = [,] "Wallace" <wallace@atanyaddress>, "Grommit" <grommit@same>
> would be okay.

Hi,

It's me again, resuming the discussion about the mailer.py to addresses
split char...

What do you think of the following patch? For me this is a nifty little
solution that doesn't cause pain with new, removed or duplicated
parameters.

Mathias

--- mailer.py.orig 2006-06-06 10:09:06.000000000 +0200
+++ mailer.py 2006-06-12 10:42:04.291902100 +0200
@@ -183,9 +183,17 @@
     OutputBase.__init__(self, cfg, repos, prefix_param)

   def start(self, group, params):
- # whitespace-separated list of addresses; split into a clean list:
- self.to_addrs = \
- filter(None, string.split(self.cfg.get('to_addr', group, params)))
+ # whitespace (or another character) separated list of addresses;
+ # split into a clean list:
+ to_addr_in = self.cfg.get('to_addr', group, params)
+ # if list of addresses starts with '[.]'
+ # use the character between the square brackets as split char
+ if len(to_addr_in) >= 3 and to_addr_in[0] == '[' \
+ and to_addr_in[2] == ']':
+ self.to_addrs = \
+ filter(None, string.split(to_addr_in[3:], to_addr_in[1]))
+ else:
+ self.to_addrs = filter(None, string.split(to_addr_in))
     self.from_addr = self.cfg.get('from_addr', group, params) \
                      or self.repos.author or 'no_author'
     self.reply_to = self.cfg.get('reply_to', group, params)
--- mailer.conf.example.orig 2006-06-06 10:08:56.000000000 +0200
+++ mailer.conf.example 2006-06-12 10:41:59.433273500 +0200
@@ -167,7 +167,10 @@
 from_addr = invalid@example.com

 # The default To: addresses for message. One or more addresses,
-# separated by whitespace (no commas):
+# separated by whitespace (no commas).
+# NOTE: If you want to use a different character for separating the
+# addresses put it in front of the addresses included in square
+# brackets '[ ]'.
 to_addr = invalid@example.com

 # If this is set, then a Reply-To: will be inserted into the message.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue Jul 4 13:59:55 2006

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.