You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Stefan Vater <st...@web.de> on 2011/04/21 09:57:57 UTC

converting author variable using mailer.py

Hi,

I have a problem configuring my post-commit hook for sending emails about 
commits. I am using mailer.py with the configuration file mailer.conf.

The problem is that I need to modify the author variable from 
"author1@domainA" (which is given to me by %(author)s as a whole) to 
"author1@domainB" in order to have a valid from_addr to send the mail by 
sendmail.

Right now, I have to convert every single author individually using the maps 
feature, i.e. the configuration file looks like

[maps]
from_addr = [authors]

[authors]
author1@domainA = author1@domainB
author2@domainA = author2@domainB

[example-group]
from_addr = %(author)s

Although this seems to work, it is very inconvenient, since I have to add 
each possible author this way. A better way would be to convert the author 
by some regular expression or something like this. domainA and domainB are 
static in my case.

I have to say that my access to the svn-server is very restricted, and 
changes in mailer.conf would be the best way. Other possibilities, which 
came into my mind, like changing mailer.py or a script in between mailer.py 
and sendmail to convert the mail address might be also possible, but I am 
not experienced in scripting it :-(

Any suggestions would be appreciated!

Regards,
Stefan