Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to get incoming e-mail to automatically go directly into whichever queue/ticket they are related to or create a new one if none exist and the right queue e-mail setup in the web interface is used.

I will have too many queues to have two line items within mailgate per queue.

A similar issue was discussed here (, but I thought it best to open a new case instead of tagging on what appeared to be an answer to that person's query.

I'm able to send and receive e-mail (via PostFix) to the default rt user and this user successfully accepts all e-mail for the relative domain.

I have no idea where the e-mail goes - it's successfully delivered, but it does not update existing tickets (with a Subject line match) and it does not create any new.

Here's and example of my ./procmail.log:

procmail: [23048] Mon Aug 23 14:26:01 2010
procmail: Assigning "
procmail: Assigning "RT_MAILGATE=/opt/rt3/bin/rt-mailgate
procmail: Assigning "RT_URL=
procmail: Assigning "LOGABSTRACT=all
procmail: Skipped "
procmail: Skipped "
procmail: Assigning "LASTFOLDER={
procmail: Opening "{
procmail: Acquiring kernel-lock
procmail: Notified comsat: "rt@18337:./{
From  Mon Aug 23 14:26:01 2010
 Subject: RE: [ #1] Test Ticket 
  Folder: {            1616

Does the notified comsat portion mean that it notified RT?

The contents of my ./procmailrc:

 SHELL=/bin/sh               #Use the Bourne shell (check your path!)
 #MAILDIR=${HOME}        #First check what your mail directory is!
 LOG="--- Logging ${LOGFILE} for ${LOGNAME}, "


 # the following line extracts the recipient from Received-headers.
 # Simply using the To: does not work, as tickets are often created
 # by sending a CC/BCC to RT
 TO=`formail -c -xReceived: |grep $MAILDOMAIN |sed -e 's/.*for *<*\(.*\)>* *;.*$/\1/'`
 QUEUE=`echo $TO| $HOME/`
 ACTION=`echo $TO| $HOME/`
 :0 h b w 
 |/usr/bin/perl $RT_MAILGATE --queue $QUEUE --action $ACTION --url $RT_URL

I know that my and scripts work, as those have been previously tested.

Any help and/or guidance you can give would be greatly appreciated.

  • Nicôle
share|improve this question
I've not used a catchall with RT, only /etc/aliases with specific addresses. – Andrew Aug 24 '10 at 6:21
Thanks for replying. Anyone else has used scripts to auto-sort e-mails into RT queues? We have over 100 queues, so to create 2 line items per queue would be a bit much. – user52095 Aug 24 '10 at 18:51

You might want to push the routing function onto RT instead of trying to implement it in procmail. Let the email be sent to RT, and then use something like the EmailRouting or SetOwnerAndQueueBySubject scrip examples to short the email into the appropriate queue.

From the RT Wiki ( ) :

EmailRouting ->

SetOwnerAndQueueBySubject ->

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.