Procmail not posting incoming emails to RT

I had RT working fine a week ago. All of the sudden procmail is not
redirecting emails to the proper queues. This was working before and not
now. Something must have changed but I’m not sure what. Can anyone help?

This is how my .procmailrc looks like

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/

if you use mailman before the mail reaches RT uncomment the folowing

line so ‘Precedence:’ header will be stripped and auto-reply will

function correctly

#REMOVE_HEADER=“-I Precedence:”

#:0 h b w
#| formail $REMOVE_HEADER | /usr/bin/perl $RT_MAILGATE --queue $QUEUE
–action $ACTION --url $RT_URL


  • ^TO.*
    | /usr/bin/rt-mailgate --queue “Full Name” --action correspond --url

I dont remember making any changes to this .procmailrc since the last time
it worked.

When I looked at the maillog the sendmail is not even invoking the

I’m using sendmail, as far as I know the way this work is like this. If I
send an email to my email address the RT senmail gets the
message, looks at the aliases on /etc/aliases. On their I have an alias name
user: rt

So it points to the rt name which then uses the .procmailrc to triggered the

Any inputs?

Here I’m pasting the information I’m getting from the different logs when
opening a ticket on RT by sending an email to

Procmail.log Information

— Logging /var/rt/home/procmail.log for rt, procmail: [13052] Thu Jun 7
11:40:13 2007
procmail: Assigning “
procmail: Assigning “RT_MAILGATE=/usr/bin/rt-mailgate”
procmail: Assigning “RT_URL=
procmail: Assigning “LOGABSTRACT=all”
procmail: Match on
procmail: Executing “/usr/bin/rt-mailgate,–queue,My
procmail: Assigning “LASTFOLDER=/usr/bin/rt-mailgate --queue My Name
–action correspond --url
procmail: Notified comsat: “rt@:/usr/bin/rt-mailgate --queue My Name
–action correspond --url

From Thu Jun 7 11:40:13 2007
Folder: /usr/bin/rt-mailgate --queue My Name --action correspo 1783
An Error Occurred

302 Found

Maillog Information:
Jun 7 11:40:13 rt sendmail[13050]: l57FeDS1013050: from=< >, size=1503, class=0, nrcpts=1, msgid=<
002f01c7a91a$23182fe0$7100000a@computer>, proto=ESMTP, daemon=MTA, relay= [ ]
Jun 7 11:40:13 rt sendmail[13051]: l57FeDS1013050:,
delay=00:00:00, xdelay=00:00:00, mailer=local, pri=31694, dsn=2.0.0,

Apache Access Log:

x.x.x.x - - [07/Jun/2007:11:49:35 -0400] “POST
//REST/1.0/NoAuth/mail-gateway HTTP/1.1” 302 314 “-” “libwww-perl/5.79”

This is how the mail log looked like the email was working and getting sent
to the proper Queue:

May 23 11:52:50 rt sendmail[22635]: l4NFqo34022635:,
ctladdr=apache (48/48), delay=00:00:00, xdelay=00:00:00, mailer=relay,

pri=139404, relay=[] [], dsn=2.0.0, stat=Sent
(l4NFqolM022636 Message accepted for delivery)

May 23 11:52:50 rt sendmail[22638]: l4NFqolM022636:, (87/87), delay=00:00:00, xdelay=00:00:

00, mailer=esmtp, pri=229569, [], dsn=
2.0.0, stat=Sent (Ok: queued as 63E7812C059D)

May 23 11:52:50 rt sendmail[22624]: l4NFqncX022621:
to=“|/usr/bin/rt-mailgate --queue General --action correspond --url”, c (8/0), delay=00:00:01, xdelay=00:00:01,
mailer=prog, pri=33089, dsn=2.0.0, stat=Sent