[otrs-cvs] otrs/Kernel/System/Email SMTP.pm,1.19,1.20
CVS commits notifications of OTRS.org
cvs-log at otrs.org
Tue Apr 29 11:20:35 GMT 2008
Comments:
Update of /home/cvs/otrs/Kernel/System/Email
In directory lancelot:/tmp/cvs-serv29825/Kernel/System/Email
Modified Files:
SMTP.pm
Log Message:
Improved error handling, use Net::SMTP error messages.
Author: martin
Index: SMTP.pm
===================================================================
RCS file: /home/cvs/otrs/Kernel/System/Email/SMTP.pm,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** SMTP.pm 20 Feb 2008 22:12:22 -0000 1.19
--- SMTP.pm 29 Apr 2008 11:20:30 -0000 1.20
***************
*** 63,67 ****
}
if ( !$Param{From} ) {
! $Param{From} = "";
}
--- 63,67 ----
}
if ( !$Param{From} ) {
! $Param{From} = '';
}
***************
*** 76,80 ****
# return if no connect was possible
! if (!$SMTP) {
$Self->{LogObject}->Log(
Priority => 'error',
--- 76,80 ----
# return if no connect was possible
! if ( !$SMTP ) {
$Self->{LogObject}->Log(
Priority => 'error',
***************
*** 87,93 ****
if ( $Self->{User} && $Self->{Password} ) {
if ( !$SMTP->auth( $Self->{User}, $Self->{Password} ) ) {
$Self->{LogObject}->Log(
Priority => 'error',
! Message => "SMTP authentication failed! Enable debug for more info!",
);
$SMTP->quit();
--- 87,94 ----
if ( $Self->{User} && $Self->{Password} ) {
if ( !$SMTP->auth( $Self->{User}, $Self->{Password} ) ) {
+ my $Error = $SMTP->code() . $SMTP->message();
$Self->{LogObject}->Log(
Priority => 'error',
! Message => "SMTP authentication failed: $Error! Enable Net::SMTP debug for more info!",
);
$SMTP->quit();
***************
*** 98,104 ****
# set from, return it from was not accepted
if ( !$SMTP->mail( $Param{From} ) ) {
$Self->{LogObject}->Log(
Priority => 'error',
! Message => "Can't use from: $Param{From}! Enable debug for more info!",
);
$SMTP->quit;
--- 99,106 ----
# set from, return it from was not accepted
if ( !$SMTP->mail( $Param{From} ) ) {
+ my $Error = $SMTP->code() . $SMTP->message();
$Self->{LogObject}->Log(
Priority => 'error',
! Message => "Can't use from '$Param{From}': $Error! Enable Net::SMTP debug for more info!",
);
$SMTP->quit;
***************
*** 109,117 ****
my $ToString = '';
for my $To ( @{ $Param{ToArray} } ) {
! $ToString .= "$To,";
! if ( !$SMTP->to($_) ) {
$Self->{LogObject}->Log(
Priority => 'error',
! Message => "Can't send to: $_! Enable debug for more info!",
);
$SMTP->quit;
--- 111,120 ----
my $ToString = '';
for my $To ( @{ $Param{ToArray} } ) {
! $ToString .= $To . ',';
! if ( !$SMTP->to( $To ) ) {
! my $Error = $SMTP->code() . $SMTP->message();
$Self->{LogObject}->Log(
Priority => 'error',
! Message => "Can't send to '$To': $Error! Enable Net::SMTP debug for more info!",
);
$SMTP->quit;
***************
*** 128,136 ****
# send data
if ( !$SMTP->data( ${ $Param{Header} }, "\n", ${ $Param{Body} } ) ) {
$Self->{LogObject}->Log(
Priority => 'error',
! Message => "Can't send message. Server code "
! . $Self->{SMTPObject}->code() . ", '" . $Self->{SMTPObject}->message()
! . "' Enable debug for more info!"
);
$SMTP->quit;
--- 131,138 ----
# send data
if ( !$SMTP->data( ${ $Param{Header} }, "\n", ${ $Param{Body} } ) ) {
+ my $Error = $SMTP->code() . $SMTP->message();
$Self->{LogObject}->Log(
Priority => 'error',
! Message => "Can't send message: $Error! Enable Net::SMTP debug for more info!"
);
$SMTP->quit;
***************
*** 141,145 ****
# debug
if ( $Self->{Debug} > 2 ) {
! $Self->{LogObject}->Log( Message => "Sent email to '$ToString' from '$Param{From}'." );
}
return 1;
--- 143,150 ----
# debug
if ( $Self->{Debug} > 2 ) {
! $Self->{LogObject}->Log(
! Priority => 'notice',
! Message => "Sent email to '$ToString' from '$Param{From}'.",
! );
}
return 1;
More information about the cvs-log
mailing list