Skip to content
Browse files

Log error if SASL auth fails.

  • Loading branch information...
1 parent de0b7c0 commit ce80b6b60a922b7f954b019d45884796be4e9ee4 @pajamian committed
Showing with 12 additions and 2 deletions.
  1. +6 −1 lib/Vend/Email.pm
  2. +6 −1 lib/Vend/Util.pm
View
7 lib/Vend/Email.pm
@@ -683,7 +683,12 @@ sub send_mail_legacy {
undef $none;
my $smtp = Net::SMTP->new($mhost, Debug => $Global::Variable->{DEBUG}, Hello => $helo);
- $smtp->auth($user, $pass) if $user && $pass;
+ $user && $pass and $smtp->auth($user, $pass) or do {
+ my $code = $smtp->code();
+ my $message = $smtp->message();
+ ::logError("Error $code: $message when attempting SASL authentication");
+ last SMTP;
+ };
#::logDebug("smtp object $smtp");
my $from = $::Variable->{MV_MAILFROM}
View
7 lib/Vend/Util.pm
@@ -2141,7 +2141,12 @@ sub send_mail {
undef $none;
my $smtp = Net::SMTP->new($mhost, Debug => $Global::Variable->{DEBUG}, Hello => $helo) or last SMTP;
- $smtp->auth($user, $pass) if $user && $pass;
+ $user && $pass and $smtp->auth($user, $pass) or do {
+ my $code = $smtp->code();
+ my $message = $smtp->message();
+ ::logError("Error $code: $message when attempting SASL authentication");
+ last SMTP;
+ };
#::logDebug("smtp object $smtp");
my $from = $::Variable->{MV_MAILFROM}

0 comments on commit ce80b6b

Please sign in to comment.
Something went wrong with that request. Please try again.