in reply to Net::SMTP_auth giving 421 errors with authentication
Hello philkime,
Recently I was struggling with similar problems and I found that quite a few things can go wrong around using the starttls command.
You can build in extra error checking like how I did it in my recent post in Cool Uses For Perl: here
The code that I took from there shows:
# Activate this line to debug SSL: # use IO::Socket::SSL qw(debug4);
# HELLO # Reminder: hello is also send again after starttls $smtp->hello( $cs->{ clientID } ) or die "Error: " . $smtp->message() ; # STARTTLS if ( !$smtp->starttls() ) { if ( ref $smtp eq 'Net::SMTP' ) { die "NET::SMPT failed to upgrade connection after connection m +essage: " . $smtp->message() . "Possible reasons for this may be firewalls or antivirus prote +ction software (such as mail shields). You can activate debugging for + IO::Socket::SSL and \$dbgSMTP to search for other possible reasons\n +" ; } else { die "starttls failed with Error: " . $smtp->message() . "You can activate debugging for IO::Socket::SSL and \$dbgSMTP +to search for possible reasons\n" ; } } ; # AUTHENTICATE ... # Finish with this line, it may contain extra error info if($@) { print STDERR "Error sending mail: $@"; }
Let us know what you find,
Veltro
edit: In case your $smtp object is a 'Net::SMTP_auth', then you need to change the line: if ( ref $smtp eq 'Net::SMTP' ) { to if ( ref $smtp eq 'Net::SMTP_auth' ) {. But now I am thinking again about this, here may actually be your problem. The auth method is not the one you think you are calling! Because after starttls the $smpt object is a Net::SMTP::_SSL (unless this was solved differently for Net::SMTP_auth)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Net::SMTP_auth giving 421 errors with authentication
by philkime (Beadle) on Jul 17, 2018 at 18:15 UTC |