<?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=ConfigEximFromRTDB</id>
	<title>ConfigEximFromRTDB - 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=ConfigEximFromRTDB"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ConfigEximFromRTDB&amp;action=history"/>
	<updated>2026-08-24T02:05:46Z</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=ConfigEximFromRTDB&amp;diff=563&amp;oldid=prev</id>
		<title>Admin: 3 revisions imported</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=ConfigEximFromRTDB&amp;diff=563&amp;oldid=prev"/>
		<updated>2016-04-06T20:03:26Z</updated>

		<summary type="html">&lt;p&gt;3 revisions imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Due to the time required to create new Queues and the fact that this is managed by more then 1 person, I created a workaround to automate the creation of new RT Queues in Exim.&lt;br /&gt;
&lt;br /&gt;
Note:&lt;br /&gt;
&lt;br /&gt;
* You need exim4.x with database support compiled in (4.5x probably supports Oracle and Interbase too, while older versions may only support mysql and pg). With debian, select exim4-daemon-heavy as the package to install.&lt;br /&gt;
&lt;br /&gt;
* All queues must have valid defined email addresses (localpart + domain)&lt;br /&gt;
* Multiple queues with the same defined email address will cause a problem. (Though multiple queues using the same default email address will not)&lt;br /&gt;
* There should probably be some mysql escaping in here to prevent SQL injection.&lt;br /&gt;
&lt;br /&gt;
For exim4.x and RT2.x put this in your exim router configuration:&lt;br /&gt;
&lt;br /&gt;
 rt_correspond:&lt;br /&gt;
   driver = redirect&lt;br /&gt;
   condition = ${lookup mysql{select 1 from Queues where CorrespondAddress \&lt;br /&gt;
               like &amp;#039;$local_part@$domain&amp;#039; and Disabled = 0}{$value}fail}&lt;br /&gt;
   debug_print = local_part@$domain&lt;br /&gt;
   user = nobody&lt;br /&gt;
   data = &amp;quot;|/home/rt2/bin/rt-mailgate --queue \&amp;quot;${lookup mysql{select name \&lt;br /&gt;
          from Queues where CorrespondAddress like &amp;#039;$local_part@$domain&amp;#039; \&lt;br /&gt;
          and Disabled = 0}{$value}{rt}}\&amp;quot; --action correspond&amp;quot;&lt;br /&gt;
   pipe_transport = address_pipe&lt;br /&gt;
 &lt;br /&gt;
 rt_comment:&lt;br /&gt;
   driver = redirect&lt;br /&gt;
   condition = ${lookup mysql{select 1 from Queues where CommentAddress \&lt;br /&gt;
               like &amp;#039;$local_part@$domain&amp;#039; and Disabled = 0}{$value}fail}&lt;br /&gt;
   user = nobody&lt;br /&gt;
   data = &amp;quot;|/home/rt2/bin/rt-mailgate --queue \&amp;quot;${lookup mysql{select \&lt;br /&gt;
           name from Queues where CommentAddress like &amp;#039;$local_part@$domain&amp;#039; \&lt;br /&gt;
           and Disabled = 0}{$value}{rt}}\&amp;quot; --action comment&amp;quot;&lt;br /&gt;
   pipe_transport = address_pipe&lt;br /&gt;
&lt;br /&gt;
And for RT3:&lt;br /&gt;
&lt;br /&gt;
 rt_correspond:&lt;br /&gt;
   driver = redirect&lt;br /&gt;
   condition = ${lookup mysql{select 1 from rtdb.Queues where CorrespondAddress \&lt;br /&gt;
               like &amp;#039;$local_part@$domain&amp;#039; and Disabled = 0}{$value}fail}&lt;br /&gt;
   debug_print = local_part@$domain&lt;br /&gt;
   user = nobody&lt;br /&gt;
   data = &amp;quot;|/usr/bin/rt-mailgate --queue \&amp;quot;${lookup mysql{select name \&lt;br /&gt;
          from rtdb.Queues where CorrespondAddress like &amp;#039;$local_part@$domain&amp;#039; \&lt;br /&gt;
          and Disabled = 0}{$value}{rt}}\&amp;quot; --action correspond --url http://url.to/rt/&amp;quot;&lt;br /&gt;
   pipe_transport = address_pipe&lt;br /&gt;
 &lt;br /&gt;
 rt_comment:&lt;br /&gt;
   driver = redirect&lt;br /&gt;
   condition = ${lookup mysql{select 1 from rtdb.Queues where CommentAddress \&lt;br /&gt;
               like &amp;#039;$local_part@$domain&amp;#039; and Disabled = 0}{$value}fail}&lt;br /&gt;
   user = nobody&lt;br /&gt;
   data = &amp;quot;|/usr/bin/rt-mailgate --queue \&amp;quot;${lookup mysql{select \&lt;br /&gt;
           name from rtdb.Queues where CommentAddress like &amp;#039;$local_part@$domain&amp;#039; \&lt;br /&gt;
           and Disabled = 0}{$value}{rt}}\&amp;quot; --action comment --url http://url.to/rt/&amp;quot;&lt;br /&gt;
   pipe_transport = address_pipe&lt;br /&gt;
&lt;br /&gt;
Also add a&lt;br /&gt;
&lt;br /&gt;
 mysql_servers = localhost/rtdb/exim/&amp;amp;lt;password&amp;amp;gt;&lt;br /&gt;
&lt;br /&gt;
line near the top of exim.conf to specify the mysql server host/db/user details.&lt;br /&gt;
&lt;br /&gt;
Of course, if you aren&amp;#039;t using mysql, you have to change the lookup stuff.&lt;br /&gt;
&lt;br /&gt;
You may need to grant the user exim is using to log into mysql rights to your Queues table, e.g.:&lt;br /&gt;
&lt;br /&gt;
 GRANT SELECT (`id` , `Name` , `CorrespondAddress` , `CommentAddress` , `Disabled`) ON `rtdb`.`Queues` TO &amp;#039;exim&amp;#039;@&amp;#039;localhost&amp;#039;;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>