Auto replies create tickets

Hi all,

I’ve already sent this to the user’s list on Thursday but have not got a reply yet.
As I need to solve this relevantly fast and my solution is to modify RT’s code base I decided to send it to the rt-devel list in hope to get some feedback. Please read below and let me know of any thoughts.

We have an application that generates messages and sends them to our users.
Our mail system is configures so that anyone that replies to these emails, a ticket is created in one of our queues.

My problem is that auto replies (ie. out of office messages) are creating tickets.
I’ve found a function in …/lib/RT/Interface/Email.pm that is checking the headers of the emails but the value returned from the function is always the same (as I understand from my limited perl skills).

sub CheckForAutoGenerated {
my $head = shift;

my $Precedence = $head->get(“Precedence”) || “”;
if ( $Precedence =~ /^(bulk|junk)/i ) {
return (1);
}

Per RFC3834, any Auto-Submitted header which is not “no” means

it is auto-generated.

my $AutoSubmitted = $head->get(“Auto-Submitted”) || “”;
if ( length $AutoSubmitted and $AutoSubmitted ne “no” ) {
return (1);
}

First Class mailer uses this as a clue.

my $FCJunk = $head->get(“X-FC-Machinegenerated”) || “”;
if ( $FCJunk =~ /^true/i ) {
return (1);
}

return (0);
}

Does the above function always return “0”? If so, is this correct? I modified the function on my test system so that if one of the conditions are met the returned value is “1” and it seems that RT is now filtering out any auto replies.
Am I missing something here, maybe a dependency? Is the function above right?

The strange thing I noticed is that if RT sends an email (ie. from a ticket comment/reply) and it gets an auto reply, then it is filtered by the system and the auto reply does not get recorded in any ticket or even create a new one.

Thanks in advance

Nik

Hi all,

We have an application that generates messages and sends them to our users.
Our mail system is configures so that anyone that replies to these emails, a ticket is created in one of our queues.

My problem is that auto replies (ie. out of office messages) are creating tickets.
I’ve found a function in …/lib/RT/Interface/Email.pm that is checking the headers of the emails but the value returned from the function is always the same (as I understand from my limited perl skills).

sub CheckForAutoGenerated {
my $head = shift;

my $Precedence = $head->get(“Precedence”) || “”;
if ( $Precedence =~ /^(bulk|junk)/i ) {
return (1);
}

Per RFC3834, any Auto-Submitted header which is not “no” means

it is auto-generated.

my $AutoSubmitted = $head->get(“Auto-Submitted”) || “”;
if ( length $AutoSubmitted and $AutoSubmitted ne “no” ) {
return (1);
}

First Class mailer uses this as a clue.

my $FCJunk = $head->get(“X-FC-Machinegenerated”) || “”;
if ( $FCJunk =~ /^true/i ) {
return (1);
}

return (0);
}

Does the above function always return “0”? If so, is this correct? I modified the function on my test system so that if one of the conditions are met the returned value is “1” and it seems that RT is now filtering out any auto replies.
Am I missing something here, maybe a dependency? Is the function above right?

The strange thing I noticed is that if RT sends an email (ie. from a ticket comment/reply) and it gets an auto reply, then it is filtered by the system and the auto reply does not get recorded in any ticket or even create a new one.

Thanks in advance

Nik

Hi all,

I need some feedback on this before I push any changes out to our live system.
I need to fix this relatively soon as I have 10-12 tickets created from auto replies every day.
I would appreciate any thoughts as it would be very helpful for me.

Thanks again

Nik----- “n chrysandreas” n.chrysandreas@albourne.com wrote:

Hi all,

We have an application that generates messages and sends them to our
users.
Our mail system is configures so that anyone that replies to these
emails, a ticket is created in one of our queues.

My problem is that auto replies (ie. out of office messages) are
creating tickets.
I’ve found a function in …/lib/RT/Interface/Email.pm that is checking
the headers of the emails but the value returned from the function is
always the same (as I understand from my limited perl skills).

sub CheckForAutoGenerated {
my $head = shift;

my $Precedence = $head->get(“Precedence”) || “”;
if ( $Precedence =~ /^(bulk|junk)/i ) {
return (1);
}

Per RFC3834, any Auto-Submitted header which is not “no” means

it is auto-generated.

my $AutoSubmitted = $head->get(“Auto-Submitted”) || “”;
if ( length $AutoSubmitted and $AutoSubmitted ne “no” ) {
return (1);
}

First Class mailer uses this as a clue.

my $FCJunk = $head->get(“X-FC-Machinegenerated”) || “”;
if ( $FCJunk =~ /^true/i ) {
return (1);
}

return (0);
}

Does the above function always return “0”? If so, is this correct? I
modified the function on my test system so that if one of the
conditions are met the returned value is “1” and it seems that RT is
now filtering out any auto replies.
Am I missing something here, maybe a dependency? Is the function above
right?

The strange thing I noticed is that if RT sends an email (ie. from a
ticket comment/reply) and it gets an auto reply, then it is filtered
by the system and the auto reply does not get recorded in any ticket
or even create a new one.

Hi all,

I need some feedback on this before I push any changes out to our live system.
I need to fix this relatively soon as I have 10-12 tickets created from auto replies every day.
I would appreciate any thoughts as it would be very helpful for me.
[…]

I’ve found a function in …/lib/RT/Interface/Email.pm that is checking
the headers of the emails but the value returned from the function is
always the same (as I understand from my limited perl skills).
[…]
Does the above function always return “0”? […]

No. The function returns 1 when it matches a header that is known to
mark some kind of auto-generated message. Now, I have observed that
there are automated messages that don’t trigger the rule, but never
enough to have me actually go up and improve the function to catch
those. Looks like you’re luckier than me.

Start by isolating a few samples of those auto-reply messages that are
indeed showing up in your queues and possibly put them somewhere where
people in the list can take a look at them (including the headers, of
course). Then post the URL here.

Regards.

-lem

Hi Lem,

Thanks for the reply.

The headers of the auto reply emails that pass through to RT are as below

Received: XXXXXXX
Received: YYYYYYY
Received: ZZZZZZZ
MIME-Version: 1.0
In-Reply-To: 78e4706e7c8637f1c0db00ad4003559f@mydomain.com
Auto-Submitted: auto-replied (zimbra; vacation)
Precedence: bulk
Content-Type: text/plain; charset=utf-8
X-Virus-Scanned: amavisd-new at server.mydomain.com
Message-ID: 464307537.2782761266397684254.JavaMail.root@server
Content-Transfer-Encoding: 7bit
X-RT-Original-Encoding: utf-8
RT-Squelch-Replies-To: USER@mydomain.com
RT-DetectedAutoGenerated: true
Content-Length: 196

[Message body]

Why would the function not detect
-Precedence: bulk
-Auto-Submitted: auto-replied
in the header?

Thanks
Nik

I am not near a pc at the moment to check on this again, but I recall when I
had looked at this same issue, I found that where CheckForAutoGenerated was
called from was not always reacting how you’d expect. We ended up
pre-filtering auto gen email in postfix… just had to be careful not to
filter rt’s own autoresponses :slight_smile:

You can see on your headers that rt added an RT-DetectedAutoGenerated
header, but still accepted it… So I’d look at that other code.On Feb 22, 2010 10:10 AM, n.chrysandreas@albourne.com wrote:

Hi Lem,

Thanks for the reply.

The headers of the auto reply emails that pass through to RT are as below

Received: XXXXXXX
Received: YYYYYYY
Received: ZZZZZZZ
MIME-Version: 1.0
Subject: Re: SOME TITLE
In-Reply-To: 78e4706e7c8637f1c0db00ad4003559f@mydomain.com
Date: Wed, 17 Feb 2010 09:08:04 +0000 (GMT)
Auto-Submitted: auto-replied (zimbra; vacation)
Precedence: bulk
Content-Type: text/plain; charset=utf-8
X-Virus-Scanned: amavisd-new at server.mydomain.com
Message-ID: 464307537.2782761266397684254.JavaMail.root@server
To: theQUEUE@mydomain.com
Content-Transfer-Encoding: 7bit
From: USER USER@mydomain.com
X-RT-Original-Encoding: utf-8
RT-Squelch-Replies-To: USER@mydomain.com
RT-DetectedAutoGenerated: true
Content-Length: 196

[Message body]

Why would the function not detect
-Precedence: bulk
-Auto-Submitted: auto-replied
in the header?

Thanks
Nik

http://lists.bestpractical.com/cgi-bin/mailman/listi

Hi Brian,

You can see on your headers that rt added an RT-DetectedAutoGenerated
header, but still accepted it… So I’d look at that other code.

I’ve been looking to find the code that is responsible for this but can’t find it.
Can you please point out the modules that are responsible for this so I can investigate?

Thanks
Nik