[rt-users] Sorting e-mail into queues automatically using procmail

Kevin Falcone falcone at bestpractical.com
Wed Aug 25 10:54:47 EDT 2010


On Tue, Aug 24, 2010 at 04:37:11PM -0400, Nicôle Layne wrote:
>    This is under the assumption that all queues are correctly setup and e-mail enabled through
>    the web interface, and the reply address has format <queue-name>@rt.mydomain.com and comment
>    address has format <queue-name>-comment at rt.mydomain.com.
> 
> 
> 
>    I'm trying to get incoming e-mail to automatically go directly into whichever queue/ticket
>    they are related to or create a new ticket if no matching ones exist.
> 
> 
> 
>    I will have too many queues to have two line items within mailgate or the aliases file per
>    queue.
> 
> 
> 
>    I'm able to send and receive e-mail (via PostFix) to the default rt user and this user
>    successfully accepts all e-mail for the rt.mydomain.com domain.
> 
> 
> 
>    Since enabling procmail and the following scripts, I have no idea where the e-mail goes - it's
>    successfully delivered, but it does not update existing tickets (with a Subject line match)
>    and it does not create any new. It's not even in rt's mailbox.

Your mail is full of extra newlines, so it is really hard to tell what
is going on, but do you have a { file in your user's homedir
containing the mail content?

-kevin

>    Here's an example of my procmail.log:
> 
> 
> 
>    --- Logging /home/rt/procmail_log.log
> 
>    for rt,
> 
>    procmail: [8153] Mon Aug 23 21:30:56 2010
> 
>    procmail: Assigning "MAILDOMAIN=rt.mydomain.com
> 
>    "
> 
>    procmail: Assigning "RT_MAILGATE=/opt/rt3/bin/rt-mailgate
> 
>    "
> 
>    procmail: Assigning "RT_URL=http://rt.mydomain.com/
> 
>    "
> 
>    procmail: Assigning "LOGABSTRACT=all
> 
>    "
> 
>    procmail: Skipped "
> 
>    "
> 
>    procmail: Skipped "
> 
>    "
> 
>    procmail: Assigning "LASTFOLDER={
> 
>    "
> 
>    procmail: Opening "{
> 
>    "
> 
>    procmail: Acquiring kernel-lock
> 
>    procmail: Notified comsat: "rt at 35475:./{
> 
>    "
> 
>    From me at mydomain.com Mon Aug 23 21:30:56 2010
> 
>    Subject: Creating environmental ticket
> 
>    Folder: {
> 
> 
> 
>    The contents of my ./procmailrc:
> 
> 
> 
>    #Preliminaries
> 
>    SHELL=/bin/sh #Use the Bourne shell (check your path!)
> 
>    #MAILDIR=${HOME} #First check what your mail directory is!
> 
>    MAILDIR="/var/mail/rt/"
> 
>    #LOGFILE=${MAILDIR}/procmail.log
> 
>    LOGFILE="/home/rt/procmail_log.log"
> 
>    LOG="--- Logging ${LOGFILE} for ${LOGNAME}, "
> 
>    VERBOSE=yes
> 
>    MAILDOMAIN="rt.telebarbados.com"
> 
>    RT_MAILGATE="/opt/rt3/bin/rt-mailgate"
> 
>    #RT_MAILGATE="/usr/local/bin/rt-mailgate"
> 
>    RT_URL="http://rt.telebarbados.com/"
> 
> 
> 
>    LOGABSTRACT=all
> 
> 
> 
> 
> 
>    :0
> 
>    {
> 
>    # the following line extracts the recipient from Received-headers.
> 
>    # Simply using the To: does not work, as tickets are often created
> 
>    # by sending a CC/BCC to RT
> 
>    TO=`formail -c -xReceived: |grep $MAILDOMAIN |sed -e 's/.*for *<*\(.*\)>* *;.*$/\1/'`
> 
>    QUEUE=`echo $TO| $HOME/get_queue.pl`
> 
>    ACTION=`echo $TO| $HOME/get_action.pl`
> 
>    :0 h b w
> 
>    |/usr/bin/perl $RT_MAILGATE --queue $QUEUE --action $ACTION --url $RT_URL
> 
>    }
> 
> 
> 
>    I have tested get_queue.pl and get_action.pl scripts successfully but let me know if including
>    them helps.
> 
> 
> 
>    Any help and/or guidance you can give would be greatly appreciated.
> 
> 
> 
>    Kind regards,
>    Nicole
> 
> 
> 
> 

> 
> RT Training in Washington DC, USA on Oct 25 & 26 2010
> Last one this year -- Learn how to get the most out of RT!

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 195 bytes
Desc: not available
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20100825/8a97a547/attachment.sig>


More information about the rt-users mailing list