Mathias Weinert wrote:
> 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.
> 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
If there are no objections against this patch I will now commit it.
--- 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 == '[' \
+ and to_addr_in == ']':
+ self.to_addrs = \
+ filter(None, string.split(to_addr_in[3:], to_addr_in))
+ 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 = firstname.lastname@example.org
# 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 = email@example.com
# If this is set, then a Reply-To: will be inserted into the message.
To unsubscribe, e-mail: firstname.lastname@example.org
For additional commands, e-mail: email@example.com
Received on Mon Aug 14 10:35:27 2006