# Problem with Email Notifications in VisualSVN Server

I have a dedicated server running windows 2003 server and Visual SVN Server 2.0.8.

I'm trying to configure it to send email notifications on commit. So I found this article on Visual SVN site.

It says I have to edit the Post-commit hook and set it to the following:

"%VISUALSVN_SERVER%\bin\VisualSVNServerHooks.exe" ^
--from <from-email> --to <to-email> ^
--smtp-server <smtp-server>


Of course I've replaced the variables there.

The problem is when someone commits something, the svn client throws the following error:

post-commit hook failed (exit code 1) with no output.
VisualSVNServerHooks: Error resolving case of '<path-to-repository>'


The commit process runs with no problems, I mean it does commit the files. But it won't send any email notification. If I remove the post-commit hook, then I don't get the error (and of course I don't get any notification).

Manually running the VisualSVNServerHook.exe using cmd.exe with the following code works fine (sends the email).

"%VISUALSVN_SERVER%\bin\VisualSVNServerHooks.exe" commit-notification ^
<path-to-repository> -r <some-revision_number> ^
--from <from-email> --to <to-email> ^
--smtp-server <smtp-server>


Could you help me out with it? The error doesn't tell too much =S

Thank you!

EDIT: Ok... so I've tried replacing %1 and %2 with static values (using the actual repository path and some existing revision number), just as I tested using cmd.exe. But it didn't work. So I went further and I replaced the entire hook with a simple call to C:\hook.bat, same error. It seems no matter what I put on the hook, it won't work.

• I had issues with it not picking up the $1 and$2 var's.. didn't resolve.. (its only for me, so wasn't too worried).. does it work if you replaced those vars with static values (I know, that defeats the purpose, but you will know WHERE the problem is then) – Grizly Apr 7 '10 at 6:58
• I've edited the hook and replaced the %1 and %2 variables with actual static values and it didn't work. Same error =( – emzero Apr 7 '10 at 16:53

I have had problems with case sensitivity and subversion on windows before. Could that be the problem?

I would try this:

 echo "%VISUALSVN_SERVER%\bin\VisualSVNServerHooks.exe" ^
--from <from-email> --to <to-email> ^
--smtp-server <smtp-server> > <somepath>\text.txt


Check that the command echoed in text.txt works.

• It throws "Access is denied" – emzero Apr 7 '10 at 16:48
• <somepath> must be a path that the visual svn server have write-acces to. – Bård Apr 8 '10 at 6:45

This problem fixed in VisualSVN Server 2.1.3:

Fixed: VisualSVNServerHooks.exe does not work if VisualSVN Server service account doesn't have access permissions to all parents of the repositories folder.

See change log entry for VisualSVN Server 2.1.3 for more details.

Try running the VisualSVNServerHooks.exe from the command line with your parameters. It will display an error message that might help you.

I would check that you don't use fake address and that it exists on your mail server.

• I said that manually running the VisualSVNServerHooks.exe using cmd.exe works fine. Please read the whole question. – emzero Apr 7 '10 at 5:34