Bugzilla – Attachment 1582 Details for
Bug 3810
Calls to Mail::Sendmail should not fail silently
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Reworked patch submitted
0001-Bug-3810-Mail-Sendmail-should-not-fail-silently.patch (text/plain), 2.86 KB, created by
Chris Cormack
on 2010-02-08 16:19:00 UTC
(
hide
)
Description:
Reworked patch submitted
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2010-02-08 16:19:00 UTC
Size:
2.86 KB
patch
obsolete
>From ff35b365be4ecf2abb5137e4e39a0114043336ba Mon Sep 17 00:00:00 2001 >From: Colin Campbell <colin.campbell@ptfs-europe.com> >Date: Mon, 8 Feb 2010 16:13:26 +0000 >Subject: [PATCH] Bug 3810 Mail::Sendmail should not fail silently >Content-Type: text/plain; charset="utf-8" > >The return from Mail::Sendmail should always be checked >Output the error message if it fails so we have some >indication of where to start looking if it fails >--- > C4/Letters.pm | 21 +++++++++------------ > 1 files changed, 9 insertions(+), 12 deletions(-) > >diff --git a/C4/Letters.pm b/C4/Letters.pm >index 72f4f54..002455f 100644 >--- a/C4/Letters.pm >+++ b/C4/Letters.pm >@@ -283,7 +283,7 @@ sub SendAlerts { > Message => "" . $innerletter->{content}, > 'Content-Type' => 'text/plain; charset="utf8"', > ); >- sendmail(%mail); >+ sendmail(%mail) or carp $Mail::Sendmail::error; > > # warn "sending to $mail{To} From $mail{From} subj $mail{Subject} Mess $mail{Message}"; > } >@@ -344,7 +344,7 @@ sub SendAlerts { > Message => "" . $innerletter->{content}, > 'Content-Type' => 'text/plain; charset="utf8"', > ); >- sendmail(%mail); >+ sendmail(%mail) or carp $Mail::Sendmail::error; > warn > "sending to $mail{To} From $mail{From} subj $mail{Subject} Mess $mail{Message}"; > } >@@ -422,7 +422,7 @@ sub SendAlerts { > Message => $mail_msg, > 'Content-Type' => 'text/plain; charset="utf8"', > ); >- sendmail(%mail); >+ sendmail(%mail) or carp $Mail::Sendmail::error; > logaction( > "ACQUISITION", > "CLAIM ISSUE", >@@ -453,7 +453,7 @@ sub SendAlerts { > Message => $letter->{'content'}, > 'Content-Type' => 'text/plain; charset="utf8"', > ); >- sendmail(%mail); >+ sendmail(%mail) or carp $Mail::Sendmail::error; > } > } > >@@ -804,18 +804,15 @@ sub _send_message_by_email ($) { > $sendmail_params{ Bcc } = $bcc; > } > >- my $success = sendmail( %sendmail_params ); > >- if ( $success ) { >- # warn "Sendmail OK. Log says: " . $Mail::Sendmail::log; >+ if ( sendmail( %sendmail_params ) ) { > _set_message_status( { message_id => $message->{'message_id'}, >- status => 'sent' } ); >- return $success; >+ status => 'sent' } ); >+ return 1; > } else { >- # warn "Mail::Sendmail::error - " . $Mail::Sendmail::error; >- # warn "Mail::Sendmail::log - " . $Mail::Sendmail::log; > _set_message_status( { message_id => $message->{'message_id'}, >- status => 'failed' } ); >+ status => 'failed' } ); >+ carp $Mail::Sendmail::error; > return; > } > } >-- >1.6.6 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 3810
: 1582 |
3300