Quote[Net::SMTP::_SSL] Connection closed
QuoteNet::SMTP::_SSL: Net::Cmd::datasend(): unexpected EOF on command channel: Bad file descriptor ...
Quote[Net::SMTP::_SSL] Connection closed
QuoteConnection closed
If the underlying IO::Handle is closed, or if there are any read or write failures, the file handle will be forced closed, and code() will return "421" (temporary connection failure) and message() will return "[$pkg] Connection closed" (where $pkg is the name of the class that subclassed Net::Cmd). The _set_status_closed() method can be overridden to set a different message (by calling set_status()) or otherwise trap this error.
1
2
3
4
5
6
Net::SMTP::_SSL=GLOB(0x26fd468)>>> sGkk+yfnEULIQ4AHut39WB6n5tTArwrbtfdnua0PPQaNYFGC5/YJd/9vyZ0aqSoDZaT77Kn/GTh3
Net::SMTP::_SSL=GLOB(0x26fd468)>>> jpIrTtkF1Duhr5zEXdN3t8AHV8i/uWRbuLo4VVGfS9ML0Wf99kL0CbUXok+ovRB9Qu2F6BNqL0Sf
Net::SMTP::_SSL=GLOB(0x26fd468)>>> UHsh/h8agwrogcFgWQAAAABJRU5ErkJggg==
Net::SMTP::_SSL=GLOB(0x26fd468)>>>
Net::SMTP::_SSL=GLOB(0x26fd468)>>> ------=_NextPart_14410782440530444180--
Net::SMTP::_SSL: Net::Cmd::datasend(): unexpected EOF on command channel: Bad file descriptor at /meinscript.pl line 661.
1 2 3 4 5 6 7 8 9 10 11 12 13
# Verbindungsherstellung require Net::SMTP; require IO::Socket::SSL; IO::Socket::SSL->import(qw(SSL_VERIFY_CLIENT_ONCE)); my $handler = Net::SMTP->new( 'URL', Timeout => 10, SSL_verify_mode => SSL_VERIFY_CLIENT_ONCE(), # mit hostname verifycation wirft es Fehler "SSL connect attempt failed error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed" ) or do { print "Keine Kommunikation mit dem SMTP-Server 'URL' möglich"; return 0; };
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
#!/usr/bin/perl use warnings; use strict; require Net::SMTP; require IO::Socket::SSL; IO::Socket::SSL->import(qw(SSL_VERIFY_CLIENT_ONCE)); my $user = 'me@mail.de'; my $pass = '123456'; my $server = 'smtp.strato.de'; my $to = 'test@mail.de'; my $from_name = 'Testaccount'; my $from_email = 'imaptest@mail.de'; my $subject = 'test'; # Verbindungsherstellung my $smtps = Net::SMTP->new( $server, SSL_verify_mode => SSL_VERIFY_CLIENT_ONCE(), ) or do { print "Keine Kommunikation mit dem SMTP-Server 'URL' möglich"; return 0; }; defined ($smtps->auth($user, $pass)) or die "Can't authenticate: $!\n"; $smtps->mail($from_email); $smtps->to($to); $smtps->data(); $smtps->datasend("To: $to\n"); $smtps->datasend(qq^From: "$from_name" <$from_email>\n^); $smtps->datasend("Subject: $subject\n\n"); $smtps->datasend("This will be the body of the message.\n"); $smtps->datasend("\n--\nVery Official Looking .sig here\n"); $smtps->dataend(); $smtps->quit(); print "done\n";
Mit Debug => 1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
Net::SMTP>>> Net::SMTP(3.05)
Net::SMTP>>> Net::Cmd(3.05)
Net::SMTP>>> Exporter(5.63)
Net::SMTP>>> IO::Socket::INET(1.31)
Net::SMTP>>> IO::Socket(1.31)
Net::SMTP>>> IO::Handle(1.28)
Net::SMTP=GLOB(0x254bf3c)<<< 220 smtp.strato.de ESMTP RZmta 37.13 ready (mo32)
Net::SMTP=GLOB(0x254bf3c)>>> EHLO localhost.localdomain
Net::SMTP=GLOB(0x254bf3c)<<< 250-smtp.strato.de greets 62.153.239.66
Net::SMTP=GLOB(0x254bf3c)<<< 250-ENHANCEDSTATUSCODES
Net::SMTP=GLOB(0x254bf3c)<<< 250-8BITMIME
Net::SMTP=GLOB(0x254bf3c)<<< 250-PIPELINING
Net::SMTP=GLOB(0x254bf3c)<<< 250-DELIVERBY
Net::SMTP=GLOB(0x254bf3c)<<< 250-SIZE 104857600
Net::SMTP=GLOB(0x254bf3c)<<< 250-AUTH SCRAM-SHA-1 DIGEST-MD5 CRAM-MD5 LOGIN PLAIN
Net::SMTP=GLOB(0x254bf3c)<<< 250-STARTTLS
Net::SMTP=GLOB(0x254bf3c)<<< 250 HELP
Net::SMTP=GLOB(0x254bf3c)>>> STARTTLS
Net::SMTP=GLOB(0x254bf3c)<<< 220 Ready to start TLS
Net::SMTP=GLOB(0x254bf3c)>>> AUTH LOGIN
Net::SMTP=GLOB(0x254bf3c)>>> me@mail.de
Net::SMTP=GLOB(0x254bf3c)>>> 1234567
Net::SMTP=GLOB(0x254bf3c)>>> MAIL FROM:<me@mail.de>
Net::SMTP: Net::Cmd::getline(): unexpected EOF on command channel: Bad file descriptor at Z:\Development Sync\PrinterInfo\PrinterInfo2.pl line 38
Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file descriptor at Z:\Development Sync\PrinterInfo\PrinterInfo2.pl line 39
Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file descriptor at Z:\Development Sync\PrinterInfo\PrinterInfo2.pl line 39
Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file descriptor at Z:\Development Sync\PrinterInfo\PrinterInfo2.pl line 40
Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file descriptor at Z:\Development Sync\PrinterInfo\PrinterInfo2.pl line 40
Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: Bad file descriptor at Z:\Development Sync\PrinterInfo\PrinterInfo2.pl line 41
Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: at Z:\Development Sync\PrinterInfo\PrinterInfo2.pl line 42
Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: at Z:\Development Sync\PrinterInfo\PrinterInfo2.pl line 43
Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: at Z:\Development Sync\PrinterInfo\PrinterInfo2.pl line 44
Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: at Z:\Development Sync\PrinterInfo\PrinterInfo2.pl line 46
Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: at Z:\Development Sync\PrinterInfo\PrinterInfo2.pl line 47
Net::SMTP: Net::Cmd::_is_closed(): unexpected EOF on command channel: at Z:\Development Sync\PrinterInfo\PrinterInfo2.pl line 47
2015-10-08T21:26:04 noxxiUnd statt die Überprüfung einfach auszuschalten sollte man sich lieber fragen warum die Überprüfung schief läuft, d.h. ob das Zertifikat tatsächlich falsch ist (kann man mit SSL_fingerprint als trusted benutzen) oder ob man z.B. den falschen Hostnamen benutzt.