<?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=RtBounceHandler</id>
	<title>RtBounceHandler - 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=RtBounceHandler"/>
	<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=RtBounceHandler&amp;action=history"/>
	<updated>2026-08-22T06:18:42Z</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=RtBounceHandler&amp;diff=3278&amp;oldid=prev</id>
		<title>Admin: 2 revisions imported</title>
		<link rel="alternate" type="text/html" href="https://rt-wiki.bestpractical.com/index.php?title=RtBounceHandler&amp;diff=3278&amp;oldid=prev"/>
		<updated>2016-04-06T20:36:21Z</updated>

		<summary type="html">&lt;p&gt;2 revisions imported&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;= NAME =&lt;br /&gt;
&lt;br /&gt;
rtbouncehandler&lt;br /&gt;
&lt;br /&gt;
= SYNOPSIS =&lt;br /&gt;
&lt;br /&gt;
 rtbouncehandler | rt-mailgate --queue myqueue --action comment --url http://rt.example.org/ --timeout 300&lt;br /&gt;
&lt;br /&gt;
= README =&lt;br /&gt;
&lt;br /&gt;
This program scans an incoming message for common bounce indications (these days this is most commonly a DSN notice). If it detects it is a bounce, it scans the message for what could be the reason and the ticket number associated with the original message. If the ticket number is found, it then emits a message suitable for feeding into &amp;quot;rt-mailgate&amp;quot; to log a comment.&lt;br /&gt;
&lt;br /&gt;
To route bounces here, set up an alias called &amp;quot;rtbounce&amp;quot; which pipes into this program as indicated in the SYNOPSIS above. Next, configure RT to use that address as the SMTP sender address for all correspondence in RT_SiteConfig.pm by setting this flag:&lt;br /&gt;
&lt;br /&gt;
 Set($SendmailArguments , &amp;#039;-frtbounce@rt.example.org -oi -t&amp;#039;);&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
This works when using the default mail command method in RT on unix.&lt;br /&gt;
&lt;br /&gt;
Now, all bounces to messages sent via RT &amp;#039;&amp;#039;&amp;#039;should&amp;#039;&amp;#039;&amp;#039; be sent to that bounce address, and ultimately forwarded into this program. You probably will also want to create an &amp;quot;owner-rtbounce&amp;quot; alias to catch any errors it might throw off. This should be aliased to a real person&amp;#039;s email address.&lt;br /&gt;
&lt;br /&gt;
For highest safety, the queue name specified should probably not have any autoresponder enabled.&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re really courageous, you could also auto-close the ticket as per the &amp;quot;rt-mailgate&amp;quot; man page on performing multiple actions. Note that not all bounces received here will be for &amp;#039;&amp;#039;&amp;#039;permanent&amp;#039;&amp;#039;&amp;#039; delivery errors.&lt;br /&gt;
&lt;br /&gt;
= PREREQUISITES =&lt;br /&gt;
&lt;br /&gt;
Requires &amp;quot;Mail::DeliveryStatus::BounceParser&amp;quot; and its prerequisites.&lt;br /&gt;
&lt;br /&gt;
= BUGS =&lt;br /&gt;
&lt;br /&gt;
Seems to handle the common bounce formats we get.&lt;br /&gt;
&lt;br /&gt;
Since the messages it creates is from the complaining mail daemon, installations with strict controls (such as the [[SpamAssassin]] filter) may fail to log bounces. However, apply the following patch and configure VERP in your [[RT SiteConfig|RT_SiteConfig]]&lt;br /&gt;
&lt;br /&gt;
 Set($VERPPrefix, &amp;#039;rtbounce+&amp;#039;);&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
and everything is swell&lt;br /&gt;
&lt;br /&gt;
 --- /opt/src/RT/rtbouncehandler 2009-09-14 16:01:14.000000000 -0400&lt;br /&gt;
 +++ local/bin/rtbouncehandler   2009-10-22 20:03:04.000000000 -0400&lt;br /&gt;
 @@ -31,7 +31,12 @@&lt;br /&gt;
  # pull out some bits and pieces&lt;br /&gt;
  my ($ticketnum,$dsn,$fromaddr);&lt;br /&gt;
 &lt;br /&gt;
 -chomp($fromaddr = $message-&amp;amp;gt;head-&amp;amp;gt;get(&amp;#039;from&amp;#039;));&lt;br /&gt;
 +if( $ENV{EXTENSION} ){&lt;br /&gt;
 +    ($fromaddr = $ENV{EXTENSION} ) =~ y/=/@/;&lt;br /&gt;
 +}&lt;br /&gt;
 +else{&lt;br /&gt;
 +    chomp($fromaddr = $message-&amp;amp;gt;head-&amp;amp;gt;get(&amp;#039;from&amp;#039;));&lt;br /&gt;
 +}&lt;br /&gt;
 &lt;br /&gt;
  # Ensure that the message is some sort of bounce, else bail.&lt;br /&gt;
  if ($bounce-&amp;amp;gt;is_bounce) {&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
Note: This also allows you to set the bounce notice sender to an explicit user without hard-coding it in the script e.g;&lt;br /&gt;
&lt;br /&gt;
 &amp;lt;nowiki&amp;gt;|EXTENSION=root@localhost rtbouncehandler | rt-mailgate ...&lt;br /&gt;
 &lt;br /&gt;
 &amp;lt;/nowiki&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Would ensure all watchers receive notification of the bounce.&lt;br /&gt;
&lt;br /&gt;
= AUTHOR =&lt;br /&gt;
&lt;br /&gt;
Vivek Khera. For help, post to the RT users mailing list. I&amp;#039;m hanging out there.&lt;br /&gt;
&lt;br /&gt;
Copyright 2007 Vivek Khera. This program is distributed under the same terms as Perl itself. Please refer to the Perl license for details.&lt;br /&gt;
&lt;br /&gt;
= SOURCE =&lt;br /&gt;
&lt;br /&gt;
Perl program is available from http://labs.mailermailer.com/files/rtbouncehandler.bz2&lt;/div&gt;</summary>
		<author><name>Admin</name></author>
	</entry>
</feed>