Custom Header for loop prevention

What value in this custom header: “X-RT-Loop-Prevention” will make RT
not respond with email?
Do I need to modify Scrips to make it X-RT-Loop-Prevention aware?

Situation: our email client messes up RT custom headers.
I didn’t have much luck messing around with
/pathtort3/lib/RT/Interface/Email.pm or /pathtort3/lib/RT/EmailParser.pm

It occured to me that I could use procmail to identify offending subject
lines “out of office”, and use formail to insert a X-RT-Loop-Prevention
Header value.
before passing it on to rt-mailgate. (simply sending it to a different
queue in mailgate isn’t sufficient on correspondence/comments because it
takes actions on which queue the existing ticket is already in).

Another possibility would be “Custom Conditions in Scrips” which appear
to be new to the 3.x series.
Does anyone have any tips/examples of using custom conditions in scrips
(e.g. to not send email if Subject~=Out of Office).

Thanks,
Mike

Mike Patterson wrote:

It occured to me that I could use procmail to identify offending subject
lines “out of office”, and use formail to insert a X-RT-Loop-Prevention
Header value.

Or drop the message entirely. Or kick your MUA vendor hard
for sending broken OOO replies. (Not that that’s likely to
help much, but it feels gratifying…)

Abusing the loop prevention header for this would probably
work, but it’s really not how it’s supposed to work. :slight_smile:

A better (?) “fix” might be to educate
RT::Interface::email::CheckForAutoGenerated() to check
the Subject header.
Phil Homewood, Systems Janitor, http://www.SnapGear.com
pdh@snapgear.com Ph: +61 7 3435 2810 Fx: +61 7 3891 3630
SnapGear - Custom Embedded Solutions and Security Appliances

On Thu, Oct 16, 2003 at 04:19:01PM -0700, Mike Patterson said:

What value in this custom header: “X-RT-Loop-Prevention” will make RT
not respond with email?
Do I need to modify Scrips to make it X-RT-Loop-Prevention aware?

Situation: our email client messes up RT custom headers.
I didn’t have much luck messing around with
/pathtort3/lib/RT/Interface/Email.pm or /pathtort3/lib/RT/EmailParser.pm

It occured to me that I could use procmail to identify offending subject
lines “out of office”, and use formail to insert a X-RT-Loop-Prevention
Header value.
before passing it on to rt-mailgate. (simply sending it to a different
queue in mailgate isn’t sufficient on correspondence/comments because it
takes actions on which queue the existing ticket is already in).

Another possibility would be “Custom Conditions in Scrips” which appear
to be new to the 3.x series.
Does anyone have any tips/examples of using custom conditions in scrips
(e.g. to not send email if Subject~=Out of Office).

We ran into the same problem, but it occurs when clueless users or
admins setup autoresponders yet send stuff in.

RT properly sets autoresponses with Precedence: bulk, but many OOO
responders and such ignore this and autoreply anyway creating a
brand-new message without any of the original message included. Of
course, this creates a new ticket, which generates an autoreply. Sigh.
Would someone please kick Bill G. in the nuts for me???

Anyway, I’m working on my own pattern list which I will use in a mail
filter before it even gets to RT. It seems that this would be the
easiest to implement. I’m not sure yet if I will do this via procmail or
an exim filter, but I’m leaning towards exim filters.

“WR” == Walt Reed rt@linuxguy.com writes:

WR> RT properly sets autoresponses with Precedence: bulk, but many OOO
WR> responders and such ignore this and autoreply anyway creating a
WR> brand-new message without any of the original message included. Of
WR> course, this creates a new ticket, which generates an autoreply. Sigh.
WR> Would someone please kick Bill G. in the nuts for me???

This should be of interest to anyone building an application that
replies to email automatically. Unfortunately, there are a few
“hyperintelligent” people out there that have decided that an
“autogenerated” header is appropriate for sending in a DSN bounce.
The next draft of this document will address that issue (are you
listening, AOL?)

http://www.ietf.org/internet-drafts/draft-moore-auto-email-response-04.txt

Walt Reed wrote:

We ran into the same problem, but it occurs when clueless users or
admins setup autoresponders yet send stuff in.

RT properly sets autoresponses with Precedence: bulk, but many OOO
responders and such ignore this and autoreply anyway creating a
brand-new message without any of the original message included. Of
course, this creates a new ticket, which generates an autoreply. Sigh.
Would someone please kick Bill G. in the nuts for me???

Anyway, I’m working on my own pattern list which I will use in a mail
filter before it even gets to RT. It seems that this would be the
easiest to implement. I’m not sure yet if I will do this via procmail or
an exim filter, but I’m leaning towards exim filters.

Yeah our loops update existing tickets (rather than completely messing
up the subject line and creating new tickets).

Even if I do an information campaign and get most of our users to modify
their client side vacation rules to put an exception for rt@myorg.com I
doubt I would get every last person trained so I need to be ready for it
on the server side. Also I don’t believe you can make GroupWise 5.5
take actions on the Precedence header.
BTW we’re building a new standards compliant mail server, but until that
happens I need this to work.

I’d be satisfied aim “out of office” replies to create a new ticket in a
queue that does not have any email actions.
I was thinking that if I replaced “[” and “]” with “-” in the subject
line (e.g. [myorg.com #5555] (out of office) Subject: -myorg.com #5555-
(out of office) ) or adding some other header to it before throwing it
to rt-mailgate. Then our helpdesk staff could link to the existing
tickets as appropriate and we wouldn’t be throwing away false positives.

Does anyone use procmail (possibly in conjuction with another program
such as formail) to alter the content of the message before throwing it
to rt-mailgate?
I already have procmail setup to be able to throw messages to
appropriate rt-mailgate queues.

Is there a better way?

From: Phil Homewood pdh@snapgear.com

snip

Abusing the loop prevention header for this would probably
work, but it’s really not how it’s supposed to work.

True, but the loop prevention header is already black and blue from our
non-standards compliant mailclients :slight_smile: .
Do you know what value the header would recognize to not send mail?

A better (?) “fix” might be to educate
RT::Interface::email::CheckForAutoGenerated() to check
the Subject header.

  1. Ok, so I added the Vacation Test info to this page
    /path-to-rt3/lib/RT/Interface/Email.pm

{{{ sub CheckForAutoGenerated

sub CheckForAutoGenerated {
my $head = shift;

my $Precedence = $head->get("Precedence") || "" ;
my $VacTest = $head->get("Subject") || "" ;
if (($Precedence =~ /^(bulk|junk)/i) OR ($VacTest =~ /(Out of 

Office|vacation)/i)){
return (1);
}
else {
return (0);
}
}

  1. I stopped and then started apache

  2. Result, I send a test message (Subject: test) all mail doesn’t seem
    to get in to create any tickets.
    /var/log/maillog

Oct 17 08:03:02 myserver sm-mta[5888]: h9HF2xOA005887:
to=“|/usr/local/rt3/bin/rt-mailgate --queue general --action correspond
–url http://myserver.myorg.com/rt3/”, ctladdr=rt@myservermyorg.com
(26/0), delay=00:00:03, xdelay=00:00:02, mailer=prog, pri=30707,
dsn=4.0.0, stat=Deferred: prog mailer (/bin/sh) exited with EX_TEMPFAIL

  1. When I undo my changes and stop and start the server again, then the
    mail gets through as normal.
    My Perl knowledge is obviously limited. Do I need to register the
    module again somehow?
    This same result seems to happen everytime I try an experiment on these
    modules.