[rt-users] How I setup procmail+fetchmail for RT

Phil Labonte philfromwork at gmail.com
Tue Dec 23 13:54:13 EST 2008

Hello all,

I thought I would share with others how I setup procmail to filter out
emails on my RT 3.6.5 system. My server is Fedora Core based.
If you do not have either of these two packages installed you can
installed them via yum or yumex.

I configured my .procmailrc file as follows:


* ^From:.*noreply at mail.badcompany.com*

* ^From:.*another at badcompanyname.com*

* ^TO.*rt at mydomain.com
|/usr/sbin/rt-mailgate --queue "CustomerSupport" --action correspond
--url http://my-rt-url.com/

* ^TO.*rt2address at mydomain.com
|/usr/sbin/rt-mailgate --queue "CustomerOther" --action correspond
--url http://my-rt-url.com/

*************end of .procmailrc********************

Let me explain a little.
1. I am filtering out the noreply at mail.badcompany.com and
another at badcompanyname.com email addresses before they get to the
2. I have two queues setup and I have a specific email address for
each. If you wanted to you can have a single email address for Request
Tracker and use Procmail to filter out and send the message to the
correct queue but that is not what I am doing.

Now to get the emails to my Request Tracker server I am retrieving
them from our Exchange server via fetchmail with the following
fetchmail -m "/usr/bin/procmail -f %F" --daemon 120
-m send the email to procmail for processing
-f is to specify a non standard .procmailrc file... I am using the
standard file but for some reason it does not work without the -f for
-F flushes the email on the server once it is procesed.
--daemon 120 run fetchmail every 2 minutes.

If you want some statistics on what procmail has filtered out you can
you mailstat...BE CAREFULL

mailstat -kl /root/procmail.log (if this is what you specified in your
.procmailrc file)
if you do not put the -k in the logfile will be truncated to 0

I hope this helps some people.


More information about the rt-users mailing list