Handle tickets via Mail, but Problems with space in queue-name

Hello,

I’ve got a problem with handling tickets in queues containing spaces.

Description:
The mails are being fetched via fetchmail and delivered to rt-mailgate via procmail.
All things work fine, but I still couldn’t deliver Mails to Queuenames containing spaces.
I have already searched for a solution in the web, but the most mentioned hint, to put
the queue-name between single quotes behind the --queue option of rt-mailgate, doesn’t
work. For better understanding, my code in the .procmailrc

– SNIP: .procmailrc –

… setting some variables

:0
{

getting action from Recipient

TO=formail -c -xReceived: |grep $MAILDOMAIN |sed -e 's/.*for *<*\(.*\)>* *;.*$/\1/'
ACTION=echo $TO| $HOME/get_action.pl
QUEUE=formail -c -xSubject: | awk -F[ '{ print $2 }' | awk -F] '{ print $1 }'

… change something within the mailheader

:0 h b w
|/usr/bin/perl $RT_MAILGATE --queue “${QUEUE}” --action $ACTION --url ${RT_URL}
}
– SNAP –

The procmail.log returns:
– SNIP: procmail.log –

procmail: Assigning “QUEUE=Queue with Spaces”

procmail: Executing "/usr/bin/perl,/usr/local/rt3/bin/rt-mailgate,–queue,Queue with Spaces,–action,correspond,–url,http://rt.domain.com/"
procmail: Assigning "LASTFOLDER=/usr/bin/perl /usr/local/rt3/bin/rt-mailgate --queue Queue with Spaces --action correspond --url http://rt.domain.com/"
procmail: Notified comsat: “rt_dispatcher@:/usr/bin/perl /usr/local/rt3/bin/rt-mailgate --queue Queue with Spaces --action correspond --url http://rt.domain.com/

From Stefan.Oeser@emendis.de Wed Nov 7 13:17:00 2007
Folder: /usr/bin/perl /usr/local/rt3/bin/rt-mailgate --queue Queue 1606
– SNAP –

Additional Information:
I’m trying to use only two mailadresses: rt@rt.domain.com and rt-comment@rt.domain.com,
the Mailsubject must be written like ‘[Queuename #TicketID] TicketSubject’ to answer a ticket
and like ‘[Queuename] TicketSubject’ to create a Ticket. I use procmail to deliver the mails into
rt-mailgate and rewrite the Mailsubject.

I would be very grateful for some help :slight_smile:
Best regards,
Stefan Oeser

We use spaces in our queue names, here is an excerpt from our aliases
file

rttechnicalservices: “|/opt/rt3/bin/rt-mailgate --queue ‘technical
services’ --action correspond --url http://MyUrlHere.com
rttechnicalservices-comment: “|/opt/rt3/bin/rt-mailgate --queue
‘technical services’ --action comment --url http://MyUrlHere.com

[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Stefan
Oeser - emendis GmbHSent: Wednesday, November 07, 2007 7:52 AM
To: rt-users@lists.bestpractical.com
Subject: [rt-users] handle tickets via Mail,but Problems with space in
queue-name

Hello,

I’ve got a problem with handling tickets in queues containing spaces.

Description:
The mails are being fetched via fetchmail and delivered to rt-mailgate
via procmail.
All things work fine, but I still couldn’t deliver Mails to Queuenames
containing spaces.
I have already searched for a solution in the web, but the most
mentioned hint, to put
the queue-name between single quotes behind the --queue option of
rt-mailgate, doesn’t
work. For better understanding, my code in the .procmailrc

– SNIP: .procmailrc –

… setting some variables

:0
{

getting action from Recipient

TO=formail -c -xReceived: |grep $MAILDOMAIN |sed -e 's/.*for *<*\(.*\)>* *;.*$/\1/'
ACTION=echo $TO| $HOME/get_action.pl
QUEUE=formail -c -xSubject: | awk -F[ '{ print $2 }' | awk -F] '{ print $1 }'

… change something within the mailheader

:0 h b w
|/usr/bin/perl $RT_MAILGATE --queue “${QUEUE}” --action $ACTION --url
${RT_URL}
}
– SNAP –

The procmail.log returns:
– SNIP: procmail.log –

procmail: Assigning “QUEUE=Queue with Spaces”

procmail: Executing
“/usr/bin/perl,/usr/local/rt3/bin/rt-mailgate,–queue,Queue with
Spaces,–action,correspond,–url,http://rt.domain.com/
procmail: Assigning “LASTFOLDER=/usr/bin/perl
/usr/local/rt3/bin/rt-mailgate --queue Queue with Spaces --action
correspond --url http://rt.domain.com/
procmail: Notified comsat: “rt_dispatcher@:/usr/bin/perl
/usr/local/rt3/bin/rt-mailgate --queue Queue with Spaces --action
correspond --url http://rt.domain.com/

From Stefan.Oeser@emendis.de Wed Nov 7 13:17:00 2007
Folder: /usr/bin/perl /usr/local/rt3/bin/rt-mailgate --queue Queue
1606
– SNAP –

Additional Information:
I’m trying to use only two mailadresses: rt@rt.domain.com and
rt-comment@rt.domain.com,
the Mailsubject must be written like ‘[Queuename #TicketID]
TicketSubject’ to answer a ticket
and like ‘[Queuename] TicketSubject’ to create a Ticket. I use procmail
to deliver the mails into
rt-mailgate and rewrite the Mailsubject.

I would be very grateful for some help :slight_smile:
Best regards,
Stefan Oeser
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

SAVE THOUSANDS OF DOLLARS ON RT SUPPORT:

If you sign up for a new RT support contract before December 31, we’ll
take
up to 20 percent off the price. This sale won’t last long, so get in
touch today.
Email us at sales@bestpractical.com or call us at +1 617 812 0745.

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com