Spamming the in-boxes of your project with notification mails? This is a reblog of Marks internal blog.
The RTC Mail Filtering Problem
A common requirement for Rational Team Concert administrators is the need for limiting email notifications for a single RTC project or user. There are many scenarios which might drive this need. Here are some examples:
- Thousands of work items are imported and you want to not cause notifications for the new work items.
- A new field is added and data from the old field is copied over, affecting many work items. We don’t want users to be notified.
- A subset of users now use a different RTC server, and they no longer want notifications from the old project, but they need to remain active in the old project.
Unfortunately, the current RTC product as of version 6.0.1 does not support this requirement. Notifications are controlled at the Jazz Team Server level. The JTS may control multiple RTC, Rational Quality Manager, and Rational Doors Next Generation repositories. Turning off notifications in the JTS turns off mail for all RTC, RQM, and RDNG projects from all repositories controlled by that JTS server. Mail generated for all of those RTC, RQM, and RDNG projects while notifications are off in the JTS are lost.
This leaves administrators with a tough choice: lose all mail for everything connected to the JTS, or live with excessive and unwanted notifications for a single project.
A Solution: Milters
We have found and implemented a solution for this requirement, milters. Milters are plugins for Sendmail that add additional functionality to Sendmail. The “milter-regex” milter plugin permits filtering mail using regular expressions.
These are the overall steps for utilizing the regex milter:
- Set up a machine with Sendmail and install the milter-regex plugin
- Configure Sendmail to allow mail from the JTS server machine in /etc/mail/access
- Develop a set of regular expressions which cause mail from a particular project or user to be found and filtered out and update the /etc/mail/milter-regex.conf configuration file
- Restart the milter-regex service
- Edit the email settings of the JTS to point to your Sendmail machine as the mail SMTP Server
You can easily add and remove projects and users from the filtering list by editing the /etc/mail/milter-regex.conf file. You can turn off filtering completely by restoring the JTS SMTP Server value back to its original setting.
You’ll have to examine your email templates to determine the project and user information for the various email formats. Here’s an example of the configuration statements for our email templates to filter out all mail for project “Project XYZ”:
reject “Mail filtered for project: Project XYZ”
body ,Team Area:.* Project XYZ,i
body ,Project Area:.* Project XYZ,i
Both “body” statements are required. The “reject” statement defines a message which is logged into the /var/log/messages log file when a piece of mail is filtered out.
This is an example of filtering for a single user:
reject “Mail filtered for user: Mark E. Ingebretson”
body ,The user ‘Mark E. Ingebretson’ made a .* request,i*
body ,Mark E. Ingebretson mentioned you in,i
body ,Mark E. Ingebretson.*changed on,i
If you are a user of our IBM Systems servers and need email filtering, you can submit an ITHELP request.
There is another approach from Sam provided on the Jazz.net forum here: Manage User E-mail Preferences for Mass Updates. It has been sitting on my Interesting Links page for a while. Time to show it here.
A new solution s available for RTC 6.0 starting with iFix03 if you are using the Java API. Use the Skip Mail Save Parameter.
I found the topic very interesting and related questions also come up on Jazz.net, so I decided to re-blog and promote this when Mark showed this to me. I hope it helps our users all over the world. I hope that this solution can help other RTC administrators address this important requirement.