Getting email to create a ticket

Hello all,

OK, here’s the basics of what I am trying to do: when you send e message to
the account ‘rtgate’ it will automatically create an rt ticket.
Current our servers are running RH9, with RT 3.0.8.
I have spoken with our sysadmins and the way they want me to do this is to
have all mail going to rtgate be forwarded to a procmail command sending the
message to rt-mailgate. So here’s what I’ve got so far. The .forward file
contains:
“|exec /usr/local/bin/procmail”
The .procmailrc file contains:
"
SHELL=/bin/sh
MAILDIR=${HOME}
LOGFILE=${MAILDIR}/procmail.log
LOG=“— Logging ${LOGFILE} for ${LOGNAME}, "
VERBOSE=yes
RT_MAILGATE=”/usr/local/bin/rt-mailgate"
RT_URL=“http://utility4.wpi.edu:8080/
LOGABSTRACT=all
|/usr/bin/perl $RT_MAILGATE --queue 5 --action correspond --url $RT_URL
"

Right now when I email rtgate nothing happens. Part of the problem is that I
do not fully understand 2 major portions of these actions:

  1. How the email is parsed into a ticket?
  2. how to name the queue I want it to be sent to. Is it the id#? The full
    name of the queue? Or am I way off base here?

Any advice would be VERY helpful.
Thank you.

–Alex

Alex Brelsfoard
Web Applications Developer
Web Development Office
Worcester Polytechnic Institute
508-831-6147
alexb@wpi.edu

Hello all,

OK, here’s the basics of what I am trying to do: when you send e message to
the account ‘rtgate’ it will automatically create an rt ticket.
Current our servers are running RH9, with RT 3.0.8.
I have spoken with our sysadmins and the way they want me to do this is to
have all mail going to rtgate be forwarded to a procmail command sending the
message to rt-mailgate. So here’s what I’ve got so far. The .forward file
contains:
“|exec /usr/local/bin/procmail”
The .procmailrc file contains:
"
SHELL=/bin/sh
MAILDIR=${HOME}
LOGFILE=${MAILDIR}/procmail.log
LOG=“— Logging ${LOGFILE} for ${LOGNAME}, "
VERBOSE=yes
RT_MAILGATE=”/usr/local/bin/rt-mailgate"
RT_URL=“http://utility4.wpi.edu:8080/
LOGABSTRACT=all
|/usr/bin/perl $RT_MAILGATE --queue 5 --action correspond --url $RT_URL
"

Right now when I email rtgate nothing happens. Part of the problem is that I
do not fully understand 2 major portions of these actions:

  1. How the email is parsed into a ticket?

That requires that you read RT documentation. Noone will explain that
here again, I am sure :wink:

  1. how to name the queue I want it to be sent to. Is it the id#? The full
    name of the queue? Or am I way off base here?

The simple queue name.

So your .procmailrc is the one with mistake. You must tell procmail
about where the rule begins. Something like this will do:

SHELL=/bin/sh
MAILDIR=${HOME}
LOGFILE=${MAILDIR}/procmail.log
LOG=“— Logging ${LOGFILE} for ${LOGNAME}, "
VERBOSE=yes
LOGABSTRACT=all
RT_MAILGATE=”/usr/local/bin/rt-mailgate"
RT_URL=“http://utility4.wpi.edu:8080/

:0

  • ! ^FROM_DAEMON
  • ! ^FROM_MAILER
    |$RT_MAILGATE --queue QUEUE_NAME --action correspond --url $RT_URL

Note:

  1. I believe $RT_MAILGATE is mode 755 and your system knows the
    location of the perl binary so there is really no need of invoking
    perl explicitly.

  2. If you have several queues, then all this becomes a whole new ball
    game.

If you search RT archives for “procmail”, you will find several
examples. Plus, you should read the RT Wiki - there are guidelines on
how to use RT with procmail.

here is the one referenced from the Wiki: http://www.geert.triple-it.nl/rt_procmail.html

    cheers
   - wash 

Odhiambo Washington . WANANCHI ONLINE LTD (Nairobi, KE) |
. 1ere Etage, Loita Hse, Loita St., |
GSM: (+254) 722 743 223 . # 10286, 00100 NAIROBI |
GSM: (+254) 733 744 121 . (+254) 020 313 985 - 9 |
“Oh My God! They killed init! You Bastards!”
–from a /. post

Thank you very much. This looks like it will be very helpfull. I will let
you know how my progress goes.

–AlexFrom: Odhiambo Washington [mailto:wash@wananchi.com]
Sent: Tue 8/17/2004 4:13 AM
To: Brelsfoard, Alex
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Getting email to create a ticket

Hello all,

OK, here’s the basics of what I am trying to do: when you send e message to
the account ‘rtgate’ it will automatically create an rt ticket.
Current our servers are running RH9, with RT 3.0.8.
I have spoken with our sysadmins and the way they want me to do this is to
have all mail going to rtgate be forwarded to a procmail command sending
the
message to rt-mailgate. So here’s what I’ve got so far. The .forward file
contains:
“|exec /usr/local/bin/procmail”
The .procmailrc file contains:
"
SHELL=/bin/sh
MAILDIR=${HOME}
LOGFILE=${MAILDIR}/procmail.log
LOG=“— Logging ${LOGFILE} for ${LOGNAME}, "
VERBOSE=yes
RT_MAILGATE=”/usr/local/bin/rt-mailgate"
RT_URL=“http://utility4.wpi.edu:8080/
LOGABSTRACT=all
|/usr/bin/perl $RT_MAILGATE --queue 5 --action correspond --url $RT_URL
"

Right now when I email rtgate nothing happens. Part of the problem is that
I
do not fully understand 2 major portions of these actions:

  1. How the email is parsed into a ticket?

That requires that you read RT documentation. Noone will explain that
here again, I am sure :wink:

  1. how to name the queue I want it to be sent to. Is it the id#? The full
    name of the queue? Or am I way off base here?

The simple queue name.

So your .procmailrc is the one with mistake. You must tell procmail
about where the rule begins. Something like this will do:

SHELL=/bin/sh
MAILDIR=${HOME}
LOGFILE=${MAILDIR}/procmail.log
LOG=“— Logging ${LOGFILE} for ${LOGNAME}, "
VERBOSE=yes
LOGABSTRACT=all
RT_MAILGATE=”/usr/local/bin/rt-mailgate"
RT_URL=“http://utility4.wpi.edu:8080/

:0

  • ! ^FROM_DAEMON
  • ! ^FROM_MAILER
    |$RT_MAILGATE --queue QUEUE_NAME --action correspond --url $RT_URL

Note:

  1. I believe $RT_MAILGATE is mode 755 and your system knows the
    location of the perl binary so there is really no need of invoking
    perl explicitly.

  2. If you have several queues, then all this becomes a whole new ball
    game.

If you search RT archives for “procmail”, you will find several
examples. Plus, you should read the RT Wiki - there are guidelines on
how to use RT with procmail.

here is the one referenced from the Wiki:
http://www.geert.triple-it.nl/rt_procmail.html

    cheers
   - wash

Odhiambo Washington . WANANCHI ONLINE LTD (Nairobi, KE)
|
. 1ere Etage, Loita Hse, Loita St.,
|
GSM: (+254) 722 743 223 . # 10286, 00100 NAIROBI
|
GSM: (+254) 733 744 121 . (+254) 020 313 985 - 9
|
“Oh My God! They killed init! You Bastards!”
–from a /. post

Quick question. If the name of the queue is more than one word (in other
words containing white space) should I use quotes? Or will it be fine on its
own?

–AlexFrom: Odhiambo Washington [mailto:wash@wananchi.com]
Sent: Tue 8/17/2004 4:13 AM
To: Brelsfoard, Alex
Cc: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Getting email to create a ticket

Hello all,

OK, here’s the basics of what I am trying to do: when you send e message to
the account ‘rtgate’ it will automatically create an rt ticket.
Current our servers are running RH9, with RT 3.0.8.
I have spoken with our sysadmins and the way they want me to do this is to
have all mail going to rtgate be forwarded to a procmail command sending
the
message to rt-mailgate. So here’s what I’ve got so far. The .forward file
contains:
“|exec /usr/local/bin/procmail”
The .procmailrc file contains:
"
SHELL=/bin/sh
MAILDIR=${HOME}
LOGFILE=${MAILDIR}/procmail.log
LOG=“— Logging ${LOGFILE} for ${LOGNAME}, "
VERBOSE=yes
RT_MAILGATE=”/usr/local/bin/rt-mailgate"
RT_URL=“http://utility4.wpi.edu:8080/
LOGABSTRACT=all
|/usr/bin/perl $RT_MAILGATE --queue 5 --action correspond --url $RT_URL
"

Right now when I email rtgate nothing happens. Part of the problem is that
I
do not fully understand 2 major portions of these actions:

  1. How the email is parsed into a ticket?

That requires that you read RT documentation. Noone will explain that
here again, I am sure :wink:

  1. how to name the queue I want it to be sent to. Is it the id#? The full
    name of the queue? Or am I way off base here?

The simple queue name.

So your .procmailrc is the one with mistake. You must tell procmail
about where the rule begins. Something like this will do:

SHELL=/bin/sh
MAILDIR=${HOME}
LOGFILE=${MAILDIR}/procmail.log
LOG=“— Logging ${LOGFILE} for ${LOGNAME}, "
VERBOSE=yes
LOGABSTRACT=all
RT_MAILGATE=”/usr/local/bin/rt-mailgate"
RT_URL=“http://utility4.wpi.edu:8080/

:0

  • ! ^FROM_DAEMON
  • ! ^FROM_MAILER
    |$RT_MAILGATE --queue QUEUE_NAME --action correspond --url $RT_URL

Note:

  1. I believe $RT_MAILGATE is mode 755 and your system knows the
    location of the perl binary so there is really no need of invoking
    perl explicitly.

  2. If you have several queues, then all this becomes a whole new ball
    game.

If you search RT archives for “procmail”, you will find several
examples. Plus, you should read the RT Wiki - there are guidelines on
how to use RT with procmail.

here is the one referenced from the Wiki:
http://www.geert.triple-it.nl/rt_procmail.html

    cheers
   - wash

Odhiambo Washington . WANANCHI ONLINE LTD (Nairobi, KE)
|
. 1ere Etage, Loita Hse, Loita St.,
|
GSM: (+254) 722 743 223 . # 10286, 00100 NAIROBI
|
GSM: (+254) 733 744 121 . (+254) 020 313 985 - 9
|
“Oh My God! They killed init! You Bastards!”
–from a /. post

Quick question. If the name of the queue is more than one word (in other
words containing white space) should I use quotes? Or will it be fine on its
own?

I think so, but I have no experience with queue names with spaces. I use
a single word naming scheme.

    cheers
   - wash 

Odhiambo Washington . WANANCHI ONLINE LTD (Nairobi, KE) |
. 1ere Etage, Loita Hse, Loita St., |
GSM: (+254) 722 743 223 . # 10286, 00100 NAIROBI |
GSM: (+254) 733 744 121 . (+254) 020 313 985 - 9 |
“Oh My God! They killed init! You Bastards!”
–from a /. post

Spaces work - I’ve got the following in my aliases file:

uk-support: …/rt-mailgate --queue ‘uk support’ …

-RonanOn Thu, 19 Aug 2004, Odhiambo Washington wrote:

Quick question. If the name of the queue is more than one word (in other
words containing white space) should I use quotes? Or will it be fine on its
own?

I think so, but I have no experience with queue names with spaces. I use
a single word naming scheme.

    cheers
   - wash

±---------------------------------±----------------------------------------+
Odhiambo Washington . WANANCHI ONLINE LTD (Nairobi, KE) |
. 1ere Etage, Loita Hse, Loita St., |
GSM: (+254) 722 743 223 . # 10286, 00100 NAIROBI |
GSM: (+254) 733 744 121 . (+254) 020 313 985 - 9 |
±--------------------------------±-----------------------------------------+
“Oh My God! They killed init! You Bastards!”
–from a /. post


The rt-users Archives

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

This email has been scanned by the MessageLabs Email Security System.
For more information please visit Email Security

Quick question. If the name of the queue is more than one word (in
other
words containing white space) should I use quotes? Or will it be fine
on its
own?

–Alex

Spaces in queue names work mostly, but I don’t think it’s guaranteed to
work. The exim4 transport stuff for RT3 breaks on spaces in queue
names, for example.

Regards,
Harald

Thanks all for your help. I’ve managed to get it working thanks to all your
help!
I really appreciate all the help.

Sidenote: I’ve noticed attachments sent in emails in RTF do not get
processed. Currently I’m wokring on converting all incoming mail to rt to
plain text through use of a perl script. But if any of you know an easier
way I’d be plenty happy to hear your thoughts. Thanks again.

–Alex

Alex Brelsfoard
Web Applications Developer
Web Development Office
Worcester Polytechnic Institute
508-831-6147
alexb@wpi.eduFrom: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Harald Wagener
Sent: Thursday, August 19, 2004 11:56 AM
To: ‘rt-users@lists.bestpractical.com’
Subject: Re: [rt-users] Getting email to create a ticket

Quick question. If the name of the queue is more than one word (in
other words containing white space) should I use quotes? Or will it
be fine on its own?

–Alex

Spaces in queue names work mostly, but I don’t think it’s guaranteed to work.
The exim4 transport stuff for RT3 breaks on spaces in queue names, for
example.

Regards,
Harald

http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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