https://rt-wiki.bestpractical.com/index.php?title=SendmailWithoutQueueAliases&feed=atom&action=historySendmailWithoutQueueAliases - Revision history2024-03-28T15:10:31ZRevision history for this page on the wikiMediaWiki 1.37.2https://rt-wiki.bestpractical.com/index.php?title=SendmailWithoutQueueAliases&diff=3493&oldid=prevAdmin: 2 revisions imported2016-04-06T20:37:40Z<p>2 revisions imported</p>
<p><b>New page</b></p><div>Lets say you want to be able to create new queues without having to touch your sendmail configuration. This how-to will allow you to send a mail to [=[mailto:queuename@rt.example.com queuename@rt.example.com]] to Correspond to tickets, and [=queuename+[mailto:action-action-action@rt.example.com action-action-action@rt.example.com]] to work those tickets via email You will need to set [=Set($[[UnsafeEmailCommands]],1);] in your [[RT SiteConfig|RT_SiteConfig]].pm if you wish to take full advantage of this. Read the perldoc documentation of rt-mailgate for full details on using EXTENSION with rt-mailgate.<br />
<br />
This howto assumes you have a dedicatd domain for RT configured in sendmail. We'll use rt.example.com.<br />
<br />
* First add a rt3 user to receive all mail directed to RT. This is so we can have a custom .procmailrc for RT.<br />
<br />
adduser rt3 -g rt3<br />
<br />
* In /etc/mail/virtusertable add the following lines:<br />
<br />
@rt.example.com rt3+%1<br />
+*@rt.example.com rt3+%1.%2<br />
<br />
* Rebuild your map files in /etc/mail<br />
<br />
make -C /etc/mail<br />
<br />
<br />
These virtusertable entries redirect all mail for the domain rt.example.com to the rt3 user. Using "plushack" (known here as EXTENSION) we can tell rt-mailgate what queue we're working with. As a bonus, we use a period as a delimiter on the back-end for separating the queue name from the list of actions. End users won't see the period in email addresses, nor should they use them.<br />
<br />
* Create a <code>.procmailrc</code> in the rt3 user's homedirectory containing the following:<br />
<br />
<nowiki># Uncomment VERBOSE and LOGFILE for debugging, they're helpful at times.<br />
#VERBOSE=1<br />
#LOGFILE=$HOME/.procmail.log<br />
LOCKFILE=$HOME/.procmail.LCK<br />
ARG1=$1<br />
EXTENSION=`echo $ARG1 | awk -F. '{ print $1 }'`<br />
SUFFIX=`echo $ARG1 | awk -F. '{ print $2 }'`<br />
<br />
<br />
# if no list of actions, default action is correspond<br />
:0<br />
* ? test -z "$SUFFIX"<br />
|/opt/rt3/bin/rt-mailgate --extension queue --action correspond --url http://rt.example.com/<br />
<br />
# Otherwise, if we DO have a list of actions, run with them.<br />
:0 E<br />
* ? test ! -z "$SUFFIX"<br />
{<br />
:0<br />
|/opt/rt3/bin/rt-mailgate --extension queue --action $SUFFIX --url http://rt.cexample.com/<br />
}<br />
</nowiki><br />
<br />
* Notes<br />
<br />
Configure your [[RT SiteConfig|RT_SiteConfig]].pm <code>Set($rtname,'rt.example.com');</code>, <code>Set($Organization,'rt.example.com');</code> and your [=Set($[[RTAddressRegexp]],'@rt\.example\.com$');] to the same catch-all domain in virtusertable. I also turn on [=Set($[[ParseNewMessageForTicketCcs]],1);] so that RT auto-assigns people in the To:/Cc: address fields when someone opens a ticket via e-mail.<br />
<br />
* BUGS<br />
<br />
Mail sent to aqueuethatdoesntexist@rt.example.com will vanish, without an answer.</div>Admin