Help with mailgate after upgrade

Hi,

I had a working RT 4.0.4 and did the upgrade to the new 4.2.0. Upgrade went
fine after all the make testdeps/fixdeps/upgrade/upgrade-database but now
the mailgate is broken! My system is a debian stable and the latest perl
libraries from CPAN (installed with make fixdeps). When I try to open a
ticket by email I got the following:

from apache error log:

[14196] [Fri Nov 1 17:03:04 2013] [warning]: Use of uninitialized value
$NewSubject in scalar chomp at /opt/rt4/sbin/…/lib/RT/Interface/Email.pm
line 1330. (/opt/rt4/sbin/…/lib/RT/Interface/Email.pm:1330)
[14196] [Fri Nov 1 17:03:04 2013] [error]: Couldn’t parse or find sender’s
address (/opt/rt4/sbin/…/lib/RT/Interface/Email/Auth/MailFrom.pm:74)
[14196] [Fri Nov 1 17:03:04 2013] [error]: Could not record email: Could
not load a valid user (/opt/rt4/share/html/REST/1.0/NoAuth/mail-gateway:75)

from procmail:

— Logging /home/rt/procmail.log for rt, procmail: [17692] Fri Nov 1
15:03:02 2013
procmail: Assigning “MAILDOMAIN=mydomain”
procmail: Assigning “RT_MAILGATE=/opt/rt4/bin/rt-mailgate”
procmail: Assigning “RT_URL=http://mydomain/rt
procmail: Assigning “LOGABSTRACT=all”
procmail: Executing “formail -c -xTo: |grep $MAILDOMAIN |sed -e ‘s/.for
<(.
)>* ;.$/\1/’”
procmail: Assigning “TO= “rti@mydomain” rti@mydomain
procmail: Executing “echo $TO| $HOME/get_queue.pl”
procmail: Assigning “QUEUE=rti”
procmail: Executing “echo $TO| $HOME/get_action.pl”
procmail: Assigning “ACTION=correspond”
procmail: Executing
“/usr/bin/perl,/opt/rt4/bin/rt-mailgate,–debug,–queue,rti,–action,correspond,–url,
http://mydomain/rt
/opt/rt4/bin/rt-mailgate: temp file is ‘/tmp/kb3fog0szG/3wYOMoZmOS’
/opt/rt4/bin/rt-mailgate: connecting to
http://mydomain/rt/REST/1.0/NoAuth/mail-gateway
not ok - Could not load a valid user

procmail: [17692] Fri Nov 1 15:03:04 2013
procmail: Assigning “LASTFOLDER=/usr/bin/perl /opt/rt4/bin/rt-mailgate
–debug --queue rti --action correspond --url http://mydomain/rt
procmail: Notified comsat: “rt@:/usr/bin/perl /opt/rt4/bin/rt-mailgate
–debug --queue rti --action correspond --url http://mydomain/rt

From lyra@mydomain Fri Nov 1 15:03:02 2013
Folder: /usr/bin/perl /opt/rt4/bin/rt-mailgate --debug --queue rti -
2666

Now the strange part: If i try to open the ticket from command line as:

cat email.txt | /opt/rt4/bin/rt-mailgate --debug --queue rti --action
correspond --url http://mydomain/rt
/opt/rt4/bin/rt-mailgate: temp file is ‘/tmp/8JZz6PkHMz/d_rvgfpGHN’
/opt/rt4/bin/rt-mailgate: connecting to
http://mydomain/rt/REST/1.0/NoAuth/mail-gateway
ok
Ticket: 67098
Queue: RTI
Owner: Nobody
Status: new
Requestor: lyra@mydomain

It works! Any clues?

Christian Lyra
PoP-PR/RNP

[14196] [Fri Nov 1 17:03:04 2013] [warning]: Use of uninitialized value $NewSubject in scalar
chomp at /opt/rt4/sbin/…/lib/RT/Interface/Email.pm line 1330.
(/opt/rt4/sbin/…/lib/RT/Interface/Email.pm:1330)
[14196] [Fri Nov 1 17:03:04 2013] [error]: Couldn’t parse or find sender’s address
(/opt/rt4/sbin/…/lib/RT/Interface/Email/Auth/MailFrom.pm:74)

These two errors imply that the email RT receives does not have a
error)

I’d be looking at what in your formail/procmail/get_*.pl scrips is
munging the mail before delivery to RT.

It doesn’t appear to be an RT error since piping the mail directly to
rt-mailgate (as your later test shows) works as expected.

-kevin

Hi,

I think you are right, but something has changed between versions. Digging
a little further I found that fetchmail/procmail is adding a line like
“>From rt Fri Nov 1 18:08:01 2013” at the top of the headers! It seems
that this line was not parsed before but now it is and cause all that
problem! Removing “-f %F” from procmail seem to solve that. Not sure about
what this would break next :-)On Fri, Nov 1, 2013 at 5:54 PM, Kevin Falcone falcone@bestpractical.comwrote:

On Fri, Nov 01, 2013 at 03:36:00PM -0200, Christian Lyra wrote:

[14196] [Fri Nov 1 17:03:04 2013] [warning]: Use of uninitialized
value $NewSubject in scalar
chomp at /opt/rt4/sbin/…/lib/RT/Interface/Email.pm line 1330.
(/opt/rt4/sbin/…/lib/RT/Interface/Email.pm:1330)
[14196] [Fri Nov 1 17:03:04 2013] [error]: Couldn’t parse or find
sender’s address
(/opt/rt4/sbin/…/lib/RT/Interface/Email/Auth/MailFrom.pm:74)

These two errors imply that the email RT receives does not have a
Subject: line (the warning) or any of Reply-To:, From:, Sender: (second
error)

I’d be looking at what in your formail/procmail/get_*.pl scrips is
munging the mail before delivery to RT.

It doesn’t appear to be an RT error since piping the mail directly to
rt-mailgate (as your later test shows) works as expected.

-kevin

Christian Lyra
PoP-PR/RNP