problem: since upgrating to ubuntu 9.04 commit mailer was not working.

here is the solution from:


Setting up

How would you like to receive an e-mail every time a commit is made to a certain subversion repository? No problem. SSH into your server and do the following.

Firstly, change your working directory to the hooks directory of your repository. For example, if my repository is located at /var/svn/myproject I would type the following:

cd /var/svn/myproject/hooks

If you haven't done this already, enable the post-commit hook.

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

Get the script. You can search for it on your local system. For example:


And you might get something like:


If you do, it would normally be the easiest just to copy this file, for example:

cp /usr/share/doc/subversion-1.2.3/tools/hook-scripts/ .

Otherwise, download the script:


If you download the above file, you need to replace all occurrences of @SVN_BINDIR@ with the directory of your subversion tools. First, find this directory. For example, if you type:

whereis svn

You might get:

svn: /usr/bin/svn /usr/share/man/man1/svn.1.gz

In this case, your directory will be /usr/bin. Just run the replace, for example with sed:

sed 's/@SVN_BINDIR@/\/usr\/bin/' >

Now of course just make sure this script is executable:

chmod +x

Now test the script as there is probably like a million things that can go wrong here:

./ /var/svn/myproject 1 

In my case, I got this:

./ use of either `-h' or `--from' is mandatory when sending email using direct SMTP.

At least simple to fix:

./ /var/svn/myproject 1  --from 

Now it works. Well, if you see nothing, it should work. Check your inbox. If you don't receive the mail, maybe you're just being impatient, but if you don't after a day or two, you're not necessarily farked, but good luck in debugging that bastard...

(By the way, in this case with me, I received the mail but the mail headers were stuffed.)

That was with the script I downloaded, if I try the copy that existed on my machine, I got this:

Use of uninitialized value in -d at ./ line 224.

On line 224, we have:

my $tmp_dir = ( -d $ENV{'TEMP'} ? $ENV{'TEMP'} : '/tmp' );

I just replaced this with:

my $tmp_dir = '/tmp';

Now it worked perfectly, no obvious issues.

Anyway, next thing is to trigger this from your post-commit script. Just edit the script with whatever you want, like:

vim post-commit

Then add this line:

$REPOS/hooks/ "$REPOS" "$REV"