[Rt-commit] r5519 - in rt/branches/3.6-RELEASE: . lib/RT/Action lib/t/regression

robert at bestpractical.com robert at bestpractical.com
Mon Jul 3 21:31:03 EDT 2006


Author: robert
Date: Mon Jul  3 21:31:03 2006
New Revision: 5519

Added:
   rt/branches/3.6-RELEASE/lib/t/regression/27verp.t
Modified:
   rt/branches/3.6-RELEASE/   (props changed)
   rt/branches/3.6-RELEASE/etc/RT_Config.pm.in
   rt/branches/3.6-RELEASE/lib/RT/Action/SendEmail.pm

Log:
 r5600 at bear:  rspier | 2006-07-03 18:27:29 -0700
 Initial support for configurable VERP


Modified: rt/branches/3.6-RELEASE/etc/RT_Config.pm.in
==============================================================================
--- rt/branches/3.6-RELEASE/etc/RT_Config.pm.in	(original)
+++ rt/branches/3.6-RELEASE/etc/RT_Config.pm.in	Mon Jul  3 21:31:03 2006
@@ -255,6 +255,14 @@
 
 Set($RecordOutgoingEmail, 1);
 
+# VERP support (http://cr.yp.to/proto/verp.txt)
+# uncomment the following two directives to generate envelope senders
+# of the form ${VERPPrefix}${originaladdress}@${VERPDomain}
+# (i.e. rt-jesse=fsck.com at rt.example.com ) This currently only works
+# with sendmail and sendmailppie.
+# Set($VERPPrefix, 'rt-');
+# Set($VERPDomain, $RT::Organization);
+
 # }}}
 
 # {{{ Logging

Modified: rt/branches/3.6-RELEASE/lib/RT/Action/SendEmail.pm
==============================================================================
--- rt/branches/3.6-RELEASE/lib/RT/Action/SendEmail.pm	(original)
+++ rt/branches/3.6-RELEASE/lib/RT/Action/SendEmail.pm	Mon Jul  3 21:31:03 2006
@@ -256,13 +256,21 @@
                        strftime('%a, %d %b %Y %H:%M:%S %z', localtime()));
     }
 
+    my $SendmailArguments = $RT::SendmailArguments;
+    if (defined $RT::VERPPrefix && defined $RT::VERPDomain) {
+      my $EnvelopeFrom = $self->TransactionObj->CreatorObj->EmailAddress;
+      $EnvelopeFrom =~ s/@/=/g;
+      $EnvelopeFrom =~ s/\s//g;
+      $SendmailArguments .= " -f ${RT::VERPPrefix}${EnvelopeFrom}\@${RT::VERPDomain}";
+    }
+
     if ( $RT::MailCommand eq 'sendmailpipe' ) {
         eval {
             # don't ignore CHLD signal to get proper exit code
             local $SIG{'CHLD'} = 'DEFAULT';
 
             my $mail;
-            unless( open $mail, "|$RT::SendmailPath $RT::SendmailArguments" ) {
+            unless( open $mail, "|$RT::SendmailPath $SendmailArguments" ) {
                 die "Couldn't run $RT::SendmailPath: $!";
             }
 
@@ -288,7 +296,7 @@
         local $ENV{MAILADDRESS};
 
         if ( $RT::MailCommand eq 'sendmail' ) {
-            push @mailer_args, split(/\s+/, $RT::SendmailArguments);
+            push @mailer_args, split(/\s+/, $SendmailArguments);
         }
         elsif ( $RT::MailCommand eq 'smtp' ) {
             $ENV{MAILADDRESS} = $RT::SMTPFrom || $MIMEObj->head->get('From');

Added: rt/branches/3.6-RELEASE/lib/t/regression/27verp.t
==============================================================================
--- (empty file)
+++ rt/branches/3.6-RELEASE/lib/t/regression/27verp.t	Mon Jul  3 21:31:03 2006
@@ -0,0 +1,9 @@
+#!/usr/bin/perl -w
+
+use strict;
+use Test::More tests => 1;
+
+TODO: { 
+    todo_skip "No tests written for VERP yet", 1;
+    ok(1,"a test to skip");
+}


More information about the Rt-commit mailing list