[Rt-commit] r6669 - rt/branches/3.6-RELEASE/lib/RT/Action

ruz at bestpractical.com ruz at bestpractical.com
Wed Dec 20 13:59:40 EST 2006


Author: ruz
Date: Wed Dec 20 13:59:40 2006
New Revision: 6669

Modified:
   rt/branches/3.6-RELEASE/lib/RT/Action/SendEmail.pm

Log:
* don't write an email record txn if there were no recipients

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	Wed Dec 20 13:59:40 2006
@@ -100,12 +100,12 @@
 sub Commit {
     my $self = shift;
 
-    my $ret = $self->SendMessage( $self->TemplateObj->MIMEObj );
-    if ($ret) {
+    my ($ret) = $self->SendMessage( $self->TemplateObj->MIMEObj );
+    if ( $ret > 0 ) {
         $self->RecordOutgoingMailTransaction( $self->TemplateObj->MIMEObj )
             if ($RT::RecordOutgoingEmail);
     }
-    return ($ret);
+    return (abs $ret);
 }
 
 # }}}
@@ -253,7 +253,7 @@
         || $MIMEObj->head->get('Bcc') )
     {
         $RT::Logger->info( $msgid . " No recipients found. Not sending.\n" );
-        return (1);
+        return (-1);
     }
 
     unless ($MIMEObj->head->get('Date')) {


More information about the Rt-commit mailing list