<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=SendingCommentsDirectlyToATicketWithExim4</id>
	<title>SendingCommentsDirectlyToATicketWithExim4 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://rt-wiki.bestpractical.com/index.php?action=history&amp;feed=atom&amp;title=SendingCommentsDirectlyToATicketWithExim4"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=SendingCommentsDirectlyToATicketWithExim4&amp;action=history"/>
	<updated>2026-08-23T18:54:38Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.41.1</generator>
	<entry>
		<id>https://rt-wiki.bestpractical.com/index.php?title=SendingCommentsDirectlyToATicketWithExim4&amp;diff=3478&amp;oldid=prev</id>
		<title>Admin: 7 revisions imported</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=SendingCommentsDirectlyToATicketWithExim4&amp;diff=3478&amp;oldid=prev"/>
		<updated>2016-04-06T20:37:40Z</updated>

		<summary type="html">&lt;p&gt;7 revisions imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;We want to send comments directly to a ticket. As we uses exim4 for our MTA, here&amp;#039;s a quick guide.&lt;br /&gt;
&lt;br /&gt;
To send a comment directly to a ticket number, set up an exim router and transport:&lt;br /&gt;
 rt_router:&lt;br /&gt;
   driver = accept&lt;br /&gt;
   local_part_prefix = rt-&lt;br /&gt;
   transport = rt_transport&lt;br /&gt;
 &lt;br /&gt;
 rt_transport:&lt;br /&gt;
   driver = pipe&lt;br /&gt;
   environment = EXTENSION=${local_part}&lt;br /&gt;
   command = rt-mailgate --action comment --queue General --extension ticket --url http://rt.xxxx.com&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Any email addressed to rt-{TicketID} will be added to that ticket as a comment.&lt;br /&gt;
&lt;br /&gt;
We also use a custome field for work order numbers. Sending comments to a ticket based on a custom field value is a bit more complicated but uses the same framework. Any email sent to wo-{WorkOrderNo} will be handled by this router. First the exim router and transport:&lt;br /&gt;
 wo_router:&lt;br /&gt;
   driver = accept&lt;br /&gt;
   local_part_prefix = wo-&lt;br /&gt;
   transport = wo_transport&lt;br /&gt;
 &lt;br /&gt;
 wo_transport:&lt;br /&gt;
   driver = pipe&lt;br /&gt;
   return_fail_output&lt;br /&gt;
   user = rt&lt;br /&gt;
   command = /usr/local/bin/rtcat&lt;br /&gt;
Notice that we have a shell script intead of rt-mailgate. This is to allow ticket id lookup based on the custom field.&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 &lt;br /&gt;
 export EXTENSION=`rt ls -i &amp;quot;&amp;#039;CF.{WorkOrderNo}&amp;#039;=${LOCAL_PART}&amp;quot; | sed -e s+^.*/++`&lt;br /&gt;
 if [[ -z $EXTENSION[[ -z $EXTENSION | ]]]] ; then&lt;br /&gt;
     echo &amp;quot;Work Order ${LOCAL_PART} not found&amp;quot;&lt;br /&gt;
     exit 1&lt;br /&gt;
 fi&lt;br /&gt;
 cat - | rt-mailgate --action comment --queue General --extension ticket --url http://rt.xxxx.com&lt;br /&gt;
I tried to give the user some feedback if s/he specifies a work order that doesn&amp;#039;t exist. They get back a &amp;quot;delivery failed&amp;quot; message from exim that says the Work Order was not found.&lt;br /&gt;
&lt;br /&gt;
In the transport, we have set the user &amp;#039;rt&amp;#039;. You can use any user; however that user must have the correct rt credentials in ~/.rtrc:&lt;br /&gt;
 server http://rt.xxxx.com&lt;br /&gt;
 user UUU&lt;br /&gt;
 passwd PPP&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>