CVSNT contains a trigger library which is capable of sending notification emails on commit, tag or notify. It allows you to put any contents in the emails, but the output format is fairly simple - it is no substitute for a purpose designed notification program.
Email sending is disabled by default. To configure it for use you must do the following.
The commit support files commit_email, tag_email and notify_email contain the names of the template files to use for commit, tag and notify respectively. Each line in these files is a regular expression followed by a filename. The filename is always relative to the CVSROOT directory and may not be an absolute path for security reasons.
The first matching line for each directory committed is used. If there is no match the DEFAULT line is used.
The name of the template file should also be listed in the checkoutlist file so that it is available for the script to use.
The CVSROOT/users file is used to lookup the username -> email mapping. This file is a list of colon separated username/email pairs. If this file does not exist or the username is not listed the default domain name set in the global configuration is used.
The template file is a simple text file listing the exact text of the email to send including headers. The To:, From:, Cc: and Bcc: lines are used by the sending software to determing the addresses to use.
An example commit template is:
From: [email] To: email@example.com Subject: Commit to [module] CVSROOT: [repository] Module name: [module] Changes by: [email] [date] On host: [hostname] [begin_directory] Directory: [directory] [begin_file] [change_type] [filename] [tag] [old_revision] -> [new_revision] [bugid] [end_file] [end_directory] Log message: [message]
A number of replacements are done on the file to format it for final sending. This differs for each file, and is listed below.
There are two ways that CVSNT can send email. The simplest is to set the SMTP Server and default domain in the global configuration (Control Panel in win32, /etc/cvsnt/PServer in Unix) and let the internal SMTP client send the emails.
This will not work in the case where authenticaton is required or the server is not capable of SMTP. In these cases you instead set the Email Command. This command should take a list of 'to' addresses as parameters, and a raw RFC822 email as its standard input.
A suitable configuration for Unix systems is
Similar programs exist for Win32.
The following are the global keywords used in the email template files.
Client hostname, it known
Local hostname of server
User who is performing the action
Email address, as looked up from CVSROOT/users
Date/time of action
Message associated with action, if any
Module associated with action
Lines between these tags (which must be on their own on the line) are repeated for each directory referenced by the operation.
Lines between these tags (which must be on their own on the line) are repeated for each file referenced by the operation. These tags can only exist inside begin/end directory tags.
Each type of template also has its own keywords that is uses:
Revision number of previous revision.
Revision number of new revision.
Tag for file.
Code for change made by this commit.. 'M', 'A', etc.
Type of tag operation.
What is being done with the tag.
Tag for file
File revision that is being tagged.