Hello together,

i have ported my installation from a Debian installation to a docker container.
Here I use a simple Perl module to send emails.
Under docker this no longer works.

I have already tested a lot with the following modules:
use Net::SSL;
use Net::TLS;
use Net::SMTPS;

But with all modules the authentication fails.

The credentials are definitely correct, because on the Debian installation everything works without problems.

Here is my code:
#!/usr/bin/perl use strict; use warnings; use Net::SMTPS; use Authen::SASL; my $user = 'postausgangFHEM@domain.de'; my $pass = 'KnAM'; my $sender = 'fhem@domain.de'; my $rcpt = 'marc@domain.de'; my $server = 'smtp.strato.de'; my $domain = 'www.strato.de'; my $mail_sasl_type = 'starttls'; my $server_port = 587; my $smtp = Net::SMTPS->new( $server, Port => $server_port, Debug => 1, + doSSL => $mail_sasl_type) || die "cannot connect to server ${server} +"; my $sasl = Authen::SASL->new( mechanism => 'PLAIN', debug => 1, callba +ck => {pass => $pass, user => $user}); $smtp->auth( $sasl ) || die "cannot do mail auth"; $smtp->mail($sender) or die "Error:".$smtp->message(); $smtp->to($rcpt) or die "Error:".$smtp->message(); $smtp->data() or die "Error:".$smtp->message(); $smtp->datasend("Subject: Mein Subject\n"); $smtp->datasend("\n"); $smtp->datasend("Mein Body"); $smtp->dataend() or die "Error:".$smtp->message(); $smtp->quit() or die "Error:".$smtp->message();

And here is the result:
root@schneckenFhem:/opt/fhem# perl ./FHEM/sendEmail.pm Net::SMTPS>>> Net::SMTPS(0.09) Net::SMTPS>>> IO::Socket::IP(0.39) Net::SMTPS>>> IO::Socket(1.39) Net::SMTPS>>> IO::Handle(1.39) Net::SMTPS>>> Exporter(5.73) Net::SMTPS>>> Net::SMTP(3.11) Net::SMTPS>>> Net::Cmd(3.11) Net::SMTPS=GLOB(0x562fb253e128)<<< 220 smtp.strato.de ESMTP RZmta (P12 + -) Net::SMTPS=GLOB(0x562fb253e128)>>> EHLO localhost.localdomain Net::SMTPS=GLOB(0x562fb253e128)<<< 250-smtp.strato.de greets 89.244.23 +0.217 Net::SMTPS=GLOB(0x562fb253e128)<<< 250-ENHANCEDSTATUSCODES Net::SMTPS=GLOB(0x562fb253e128)<<< 250-PIPELINING Net::SMTPS=GLOB(0x562fb253e128)<<< 250-8BITMIME Net::SMTPS=GLOB(0x562fb253e128)<<< 250-DELIVERBY Net::SMTPS=GLOB(0x562fb253e128)<<< 250-SIZE 104857600 Net::SMTPS=GLOB(0x562fb253e128)<<< 250-AUTH PLAIN LOGIN CRAM-MD5 DIGES +T-MD5 Net::SMTPS=GLOB(0x562fb253e128)<<< 250-STARTTLS Net::SMTPS=GLOB(0x562fb253e128)<<< 250-BURL imap Net::SMTPS=GLOB(0x562fb253e128)<<< 250-CHUNKING Net::SMTPS=GLOB(0x562fb253e128)<<< 250 HELP Net::SMTPS=GLOB(0x562fb253e128)>>> STARTTLS Net::SMTPS=GLOB(0x562fb253e128)<<< 220 Ready to start TLS Net::SMTPS=GLOB(0x562fb253e128)>>> EHLO localhost.localdomain Net::SMTPS=GLOB(0x562fb253e128)<<< 250-smtp.strato.de greets 89.244.23 +0.217 Net::SMTPS=GLOB(0x562fb253e128)<<< 250-ENHANCEDSTATUSCODES Net::SMTPS=GLOB(0x562fb253e128)<<< 250-PIPELINING Net::SMTPS=GLOB(0x562fb253e128)<<< 250-8BITMIME Net::SMTPS=GLOB(0x562fb253e128)<<< 250-DELIVERBY Net::SMTPS=GLOB(0x562fb253e128)<<< 250-SIZE 104857600 Net::SMTPS=GLOB(0x562fb253e128)<<< 250-AUTH PLAIN LOGIN CRAM-MD5 DIGES +T-MD5 Net::SMTPS=GLOB(0x562fb253e128)<<< 250-REQUIRETLS Net::SMTPS=GLOB(0x562fb253e128)<<< 250-BURL imap Net::SMTPS=GLOB(0x562fb253e128)<<< 250-CHUNKING Net::SMTPS=GLOB(0x562fb253e128)<<< 250 HELP cannot do mail auth at ./FHEM/sendEmail.pm line 20.
Does anyone have any idea what I can check?

Regards
Marc

In reply to Net::SMTPS => auth no longer works - Migration from Debian to Docker container by initB10r

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.