I suspect something is awry with the security required to set up a TLS session. On the two servers where the script fails, I get everything up to where TLS ought to start, but no TLSv1 packets.
On the workstation where all works, I get a large number of TLSv1 packets, followed by those SMTP packets that end it all.
But, I am having an aweful time trying to get Wireshark to display/export, only those packets relevant to the SMTP session (but that may be due to the fact I have never used Wireshark before). And, there are a lot of packets exchanged between the workstation and server and the router, many of which are related to the SMTP session, and seem to be duplicated between the router's public IP address and the gmail email server.
What sorts of things need I investigate to determine why neither server can establish the TLS connection that smtp.gmail.com apparently needs?
Re^8: MIME::Lite error => SMTP auth() command not supported on smtp.gmail.com
Replies are listed 'Best First'.
To reduce the packets captured to just those that are interesting you need a capture filter. http://wiki.wireshark.org/CaptureFilters has a good explanation; what you want is something like
host smtp.gmail.com and port 25 (or 587, 465, etc.)
Since MIME::Lite->send isn't cutting it, why not use Net::SMTP::TLS directly? Something like:
my ($from, $to,$subject,$message, $path) =@_;
my $pt=25; # or 587, 465, etc depending on what gmail uses
my $mailer = new Net::SMTP::TLS(
Port => $pt,
User => $un,
Password => $pw,
Timeout => 60,
) or die "Cannot create a TLS mailer instance!\n";
my $msg = MIME::Lite->new(
From => $from,
'Reply-to' => $from,
To => $to,
Subject => $subject,
Type => 'multipart/related'
) or die "Cannot create a new email instance!\n";
Type => 'TEXT',
Data => $message,
) or die "Error adding TXT: $!\n";
Type => 'aplication/pdf',
Path => $path,
Disposition => 'attachment'
) or die "Error adding PDF: $!\n";