You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Mathias Weinert <ma...@gfa-net.de> on 2006/07/04 11:59:12 UTC

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

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" <wa...@atanyaddress>, "Grommit" <gr...@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