I worked things out by using the rt-mailgate --debug option, which
returns the ticket number as part of its output. This is what I see in
the third line:.
,okTicket: 105Queue: Owner:,NobodyStatus: Subject:,Requestor:
# pipe stderr to rt-mailgate & grab ticket ID (need to redirect stderr
in order for sed to access it)
:0
{
# put into RT (preserve ticket number).
:0fw c
{
TICKET=`/opt/local/rt/bin/rt-mailgate --debug --extension ticket
--queue ${RTQUEUE} --action correspond --url ${RT_URL} 3>&1 1>&2
2>&3|/usr/bin/sed -e '1,3d' -e 's/^\(.*Ticket:[
]*\)\([0-9]\{1,\}\)\(.*\)\$/\2/'`
}
Perhaps someone can think of an alternate solution, but this works
reliably for me.
W. Thornton Martin wrote:
_______________________________________________
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-usersCommunity help:
http://wiki.bestpractical.comCommercial support:
sales@...
Discover RT's hidden secrets with RT Essentials from O'Reilly Media.
Buy a copy at
http://rtbook.bestpractical.com