Automatic mail notification for subversion in centos 7

To set up automatic mail notifications for Subversion (SVN) on CentOS 7, you'll need to configure the svnserve daemon and the svnsync command. Here's a step-by-step guide:

Prerequisites:

  1. Install svnserve and svnsync packages:

    sudo yum install subversion
  2. Create a new SVN repository (if you haven't already):

    sudo svnadmin create /path/to/repo

    Configure svnserve for mail notifications:

  3. Edit the svnserve configuration file:

    sudo nano /etc/subversion/svnserve.conf

    Add the following lines at the end of the file:

    mail-from = [email protected]
    mail-command = /usr/bin/mail -s "SVN Notification" %r

    Replace [email protected] with the email address you want to use for notifications.

Configure svnsync for mail notifications:

  1. Create a new file for svnsync configuration:

    sudo nano /etc/subversion/svnsync.conf

    Add the following lines:

    sync-command = /usr/bin/svnserve --config-dir=/etc/subversion --sync %r
    sync-mail = /usr/bin/mail -s "SVN Notification" %r

    Enable and start svnserve and svnsync services:

  2. Enable the svnserve service:

    sudo systemctl enable svnserve
  3. Start the svnserve service:

    sudo systemctl start svnserve
  4. Enable the svnsync service:

    sudo systemctl enable svnsync
  5. Start the svnsync service:

    sudo systemctl start svnsync

    Test the setup:

  6. Make a change to your SVN repository (e.g., add a new file).

  7. Verify that you receive an email notification with the subject "SVN Notification" and the commit message.

That's it! You should now receive automatic mail notifications for Subversion changes on your CentOS 7 system.