Send Commit Mails

Dec 16, 2013
1 min read
May 27, 2023 09:13 EEST

At first search the path for the mailer.py on FreeBSD it is:

/usr/local/share/subversion/hook-scripts/mailer/mailer.py

On Debian:

/usr/share/subversion/hook-scripts/mailer/mailer.py

I will continue with configuration for FreeBSD feel free to replace the path for other systems.

Go into your repository hook path, in my case /usr/local/svn/test/hooks

mv post-commit.tmpl post-commit
chmod +x post-commit

Now edit post-commit and add the link to the commit notify program (maybe you have to delete a link to a perl script):

/usr/local/share/subversion/hook-scripts/mailer/mailer.py commit "$REPOS" "$REV"

Now search on your disk for the file mailer.conf.example and copy it into the conf directory under your repository:

cp /usr/local/share/subversion/hook-scripts/mailer/mailer.conf.example /usr/local/svn/test/conf/mailer.conf

Edit the file, I had to change:

mail_command = /usr/sbin/sendmail
from_addr = commit@bla
to_addr = email@bla
reply_to = commit@bla

No commit something to your repository and check if it sends mails.

Send Basic Commit Mails

In your repository on your server there is a directory hooks. Copy the file post-commit.tmpl to post-commit. Now edit it and adapt the lines, I use the following:

/usr/share/subversion/hook-scripts/commit-email.pl "$REPOS" "$REV" svn-commit@<host> \
        --from svn-commit@<host>

Now make it executable. At every checkin an e-mail is sent to the above mentioned email address.


Related Posts