How to prevent Out-of-the-office Mails hitting RT?

Hello,

I’m quite new into RT and I have the below problem:

When user creating a manual ticket, and ad an e-mail address for the
Requestor, and this
Requestor has his e-mail system giving an Auto-Reply saying “Mr. X is not
in the office”,
This Auto-Reply is pulling everytime a new Ticket-number in RT.

Is there a possiblity to filter the subject of each inbound e-mail to RT,
that e-mails with
certain subjects like the string “is not in the office” are not creating a
Ticket in RT ?

Do you have any sample code I could use ?

Many thanks for your help :wink:

Steffen

Important Email Information

The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it,
is prohibited and may be unlawful. If you are not the intended addressee please
contact the sender and dispose of this e-mail.

Steffen Heinzmann Steffen.Heinzmann@exel.com writes:

Is there a possiblity to filter the subject of each inbound e-mail
to RT, that e-mails with certain subjects like the string “is not in
the office” are not creating a Ticket in RT ?

That’s best done outside of RT. I use procmail to filter the incoming
request stream.

Leif Nixon - Systems expert
National Supercomputer Centre - Linkoping University

Stephen,

:I used to get a lot of those when people used vacation rules that
don’t understand “bulk” headers and changed the subject line (before we
upgraded our mail server).

When we had that problem, I used procmail to filter the mail before it
got to RT. If something slipped through, I’d stop sendmail, move the
ticket to “nomail” then startup sendmail again (and sometimes update my
procmail filter). I suppose you could also customize all of the scrips
involving autoreplies and correspondence to do a regexp search for “out
of office” subject line before sending mail.

I used procmail to put “out of office” subject lines into a queue I
created called “nomail” that does not autorespond.
I setup procmail based on these tips:
http://download.bestpractical.com/pub/rt/contrib/3.0/rt_procmail.html

Some more tips on procmail filtering here:
http://wiki.bestpractical.com/index.cgi?SpamFiltering

My setup files are below:

My /etc/aliases looked like this. It pipes mail for “general” to
procmail instead of directly to a RT queue.
general: “|/usr/local/bin/procmail -m /etc/procmailrcs/rt”

My /etc/procmailrcs/rt file looks like this
#this must be owned by root
HOME=/home/rt_distpatch
INCLUDERC=$HOME/.procmailrc

#are we still here after including? Dump it to someone
:0
! root@mymailserver.com

My /home/rt_distpatch/.procmailrc looked like this
If the subject line matches it puts it into the “nomail” queue
Otherwise it puts it in the “general” queue.
SHELL=/bin/sh #Use the Bourne shell (check your path!)
MAILDIR=${HOME} #First check what your mail directory is!
LOGFILE=${MAILDIR}/procmail.log
LOG=“— Logging ${LOGFILE} for ${LOGNAME}, "
VERBOSE=yes
MAILDOMAIN=mymaildomain.com
RT_MAILGATE=”/usr/local/rt3/bin/rt-mailgate"
RT_URL=“http://myrtserver.com

LOGABSTRACT=all

#sounds like out of office, send to “nomail” queue
:0
* ^Subject:.(out of office|vacation|family leave|out of the
office|no longer work at|left the building|leave of
absence|mailer-daemon|message status).

:0
{
| $HOME/dash.pl |/usr/bin/perl $RT_MAILGATE --queue nomail
–action corr
espond --url $RT_URL
#if error email my account
:0e
! mailme@mymaildomain.com
}
#general correspondence
:0
{
:0
|/usr/bin/perl $RT_MAILGATE --queue general --action correspond
–url $RT_URL
#if error email my account
:0e
! mailme@mymaildomain.com
}

Steffen Heinzmann wrote:

Hello,

I’m quite new into RT and I have the below problem:

When user creating a manual ticket, and ad an e-mail address for the
Requestor, and this

Requestor has his e-mail system giving an Auto-Reply saying “Mr. X is
not in the office”,

This Auto-Reply is pulling everytime a new Ticket-number in RT.

Is there a possiblity to filter the subject of each inbound e-mail to
RT, that e-mails with

certain subjects like the string “is not in the office” are not
creating a Ticket in RT ?

Do you have any sample code I could use ?

Many thanks for your help :wink:

Steffen

Important Email Information

The information in this email is confidential and may be legally privileged.
It is intended solely for the addressee. Access to this email by anyone else
is unauthorized. If you are not the intended recipient, any disclosure, copying,
distribution or any action taken or omitted to be taken in reliance on it,
is prohibited and may be unlawful. If you are not the intended addressee please
contact the sender and dispose of this e-mail.



The rt-users Archives

Be sure to check out the RT Wiki at http://wiki.bestpractical.com

Download a free sample chapter of RT Essentials from O’Reilly Media at http://rtbook.bestpractical.com

WE’RE COMING TO YOUR TOWN SOON - RT Training in Amsterdam, Boston and
San Francisco - Find out more at http://bestpractical.com/services/training.html

Mike Patterson
Systems Manager
UC Berkeley Extension