[freeside-commits] freeside/rt/lib/RT/Action SendEmail.pm, 1.1.1.6, 1.1.1.6.2.1
Ivan,,,
ivan at wavetail.420.am
Mon Mar 3 15:07:49 PST 2008
- Previous message: [freeside-commits] freeside/rt/lib/RT Attachment_Overlay.pm, 1.1.1.5, 1.1.1.5.4.1 CustomField_Overlay.pm, 1.1.1.5, 1.1.1.5.2.1 Date.pm, 1.1.1.4, 1.1.1.4.4.1 Group_Overlay.pm, 1.1.1.4, 1.1.1.4.4.1 I18N.pm, 1.1.1.5, 1.1.1.5.2.1 Link_Overlay.pm, 1.1.1.5, 1.1.1.5.2.1 Links_Overlay.pm, 1.1.1.3, 1.1.1.3.4.1 Record.pm, 1.1.1.5, 1.1.1.5.2.1 Template_Overlay.pm, 1.1.1.5, 1.1.1.5.4.1 Ticket_Overlay.pm, 1.1.1.6, 1.1.1.6.2.1 Tickets_Overlay.pm, 1.1.1.6, 1.1.1.6.2.1 Transaction_Overlay.pm, 1.1.1.6, 1.1.1.6.2.1 URI.pm, 1.1.1.4, 1.1.1.4.4.1
- Next message: [freeside-commits] freeside/rt/lib/RT/Condition Generic.pm, 1.1.1.3, 1.1.1.3.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /home/cvs/cvsroot/freeside/rt/lib/RT/Action
In directory wavetail.420.am:/tmp/cvs-serv10370/lib/RT/Action
Modified Files:
Tag: FREESIDE_1_7_BRANCH
SendEmail.pm
Log Message:
merge in rt 3.4.6. *gulp*!
Index: SendEmail.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/rt/lib/RT/Action/SendEmail.pm,v
retrieving revision 1.1.1.6
retrieving revision 1.1.1.6.2.1
diff -u -d -r1.1.1.6 -r1.1.1.6.2.1
--- SendEmail.pm 17 Oct 2006 08:50:56 -0000 1.1.1.6
+++ SendEmail.pm 3 Mar 2008 23:07:46 -0000 1.1.1.6.2.1
@@ -253,12 +253,28 @@
if ( $RT::MailCommand eq 'sendmailpipe' ) {
eval {
- open( my $mail, "|$RT::SendmailPath $RT::SendmailArguments" ) || die $!;
+ # don't ignore CHLD signal to get proper exit code
+ local $SIG{'CHLD'} = 'DEFAULT';
+
+ my $mail;
+ unless( open $mail, "|$RT::SendmailPath $RT::SendmailArguments" ) {
+ die "Couldn't run $RT::SendmailPath: $!";
+ }
+
+ # if something wrong with $mail->print we will get PIPE signal, handle it
+ local $SIG{'PIPE'} = sub { die "$RT::SendmailPath closed pipe" };
$MIMEObj->print($mail);
- close($mail);
+
+ unless ( close $mail ) {
+ die "Close failed: $!" if $!; # system error
+ # sendmail exit statuses mostly errors with data not software
+ # TODO: status parsing: core dump, exit on signal or EX_*
+ $RT::Logger->warning( "$RT::SendmailPath exitted with status $?" );
+ }
};
if ($@) {
- $RT::Logger->crit( $msgid . "Could not send mail. -" . $@ );
+ $RT::Logger->crit( $msgid . "Could not send mail: " . $@ );
+ return 0;
}
}
else {
@@ -284,13 +300,12 @@
}
}
- my $success =
- ( $msgid
- . " sent To: "
- . $MIMEObj->head->get('To') . " Cc: "
- . $MIMEObj->head->get('Cc') . " Bcc: "
- . $MIMEObj->head->get('Bcc') );
- $success =~ s/\n//gi;
+ my $success = "$msgid sent";
+ foreach (qw(To Cc Bcc)) {
+ next unless my $addresses = $MIMEObj->head->get($_);
+ $success .= " $_: ". $addresses;
+ }
+ $success =~ s/\n//g;
$self->RecordOutgoingMailTransaction($MIMEObj) if ($RT::RecordOutgoingEmail);
- Previous message: [freeside-commits] freeside/rt/lib/RT Attachment_Overlay.pm, 1.1.1.5, 1.1.1.5.4.1 CustomField_Overlay.pm, 1.1.1.5, 1.1.1.5.2.1 Date.pm, 1.1.1.4, 1.1.1.4.4.1 Group_Overlay.pm, 1.1.1.4, 1.1.1.4.4.1 I18N.pm, 1.1.1.5, 1.1.1.5.2.1 Link_Overlay.pm, 1.1.1.5, 1.1.1.5.2.1 Links_Overlay.pm, 1.1.1.3, 1.1.1.3.4.1 Record.pm, 1.1.1.5, 1.1.1.5.2.1 Template_Overlay.pm, 1.1.1.5, 1.1.1.5.4.1 Ticket_Overlay.pm, 1.1.1.6, 1.1.1.6.2.1 Tickets_Overlay.pm, 1.1.1.6, 1.1.1.6.2.1 Transaction_Overlay.pm, 1.1.1.6, 1.1.1.6.2.1 URI.pm, 1.1.1.4, 1.1.1.4.4.1
- Next message: [freeside-commits] freeside/rt/lib/RT/Condition Generic.pm, 1.1.1.3, 1.1.1.3.4.1
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the freeside-commits
mailing list