delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2016/06/09/22:58:28

X-Recipient: archive-cygwin AT delorie DOT com
DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:reply-to:message-id:to:subject
:mime-version:content-type:content-transfer-encoding; q=dns; s=
default; b=otN/6jn98o2mYoLnsfLwYY7EHun0FCbTP/YOpJbtOJR2jtX10/kPD
r2qP9JVouR2BcOfkfmRIc+tqo4OtDp5mR6wt36rKzzRTMwmpSGTLA1rR/pnyhJEh
2+DQJXa1EtDV6EFue+eWr3nxJquW8uLcfznTp1lUYgzx5xQERriAGI=
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id
:list-unsubscribe:list-subscribe:list-archive:list-post
:list-help:sender:date:from:reply-to:message-id:to:subject
:mime-version:content-type:content-transfer-encoding; s=default;
bh=/qd+2L6dD/192mANPRzQ0svZmT4=; b=lQV0cMESWHyb4IBNGkxwqlMX9mdr
Ay5WBLx6+GqzOXLuGddi4M2bG310CyoD3OrLwfXXTpWphvdab2bVlkTJ/9Y5EOtz
MCxPl8fp2lTTukcCWDW+bh/RqnTVw19JGVIPDTEPvcvY1e9rSUwfa7omz3YR8aod
MmXn4hODmam98DA=
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com
Authentication-Results: sourceware.org; auth=none
X-Virus-Found: No
X-Spam-SWARE-Status: No, score=2.0 required=5.0 tests=BAYES_50,FREEMAIL_FROM,KAM_THEBAT,RCVD_IN_DNSWL_LOW,SPF_HELO_PASS,SPF_PASS autolearn=no version=3.3.2 spammy=H*UA:Bat!, H*x:Bat!, Want, H*R:D*mail.ru
X-HELO: smtp33.i.mail.ru
Date: Fri, 10 Jun 2016 05:57:44 +0300
From: Oleg Bondar <hobo-mts AT mail DOT ru>
Reply-To: Oleg Bondar <hobo-mts AT mail DOT ru>
Message-ID: <1249654733.20160610055744@mail.ru>
To: cygwin AT cygwin DOT com
Subject: Perl module Net::SMTP->auth() error with Authen::SASL::XS
MIME-Version: 1.0
X-IsSubscribed: yes

Hi there,

Versions:

    Windows XP SP3 32-bit
    CYGWIN_NT-5.1 2.5.1(0.297/5/3) 2016-04-21 22:12 i686 Cygwin
    This is perl 5, version 22, subversion 2 (v5.22.2) built for cygwin-thread-multi-64int
    perl-Authen-SASL-2.16-2
    perl-Authen-SASL-XS-1.00-1

When I've installed perl-Authen-SASL-XS package required by perl-Authen-SASL
my script can't auth() on SMTP server. Debug log:

Net::SMTP::_SSL>>> Net::SMTP::_SSL
Net::SMTP::_SSL>>>   IO::Socket::SSL(2.027)
Net::SMTP::_SSL>>>     IO::Socket::IP(0.37)
Net::SMTP::_SSL>>>       IO::Socket(1.38)
Net::SMTP::_SSL>>>         IO::Handle(1.35)
Net::SMTP::_SSL>>>           Exporter(5.72)
Net::SMTP::_SSL>>>   Net::SMTP(3.05)
Net::SMTP::_SSL>>>     Net::Cmd(3.05)
Net::SMTP::_SSL=GLOB(0x206713a8)<<< 220 smtp3h.mail.yandex.net ESMTP (Want to use Yandex.Mail for your domain? Visit http://pdd.yandex.ru)
Net::SMTP::_SSL=GLOB(0x206713a8)>>> EHLO localhost.localdomain
Net::SMTP::_SSL=GLOB(0x206713a8)<<< 250-smtp3h.mail.yandex.net
Net::SMTP::_SSL=GLOB(0x206713a8)<<< 250-8BITMIME
Net::SMTP::_SSL=GLOB(0x206713a8)<<< 250-PIPELINING
Net::SMTP::_SSL=GLOB(0x206713a8)<<< 250-SIZE 42991616
Net::SMTP::_SSL=GLOB(0x206713a8)<<< 250-AUTH LOGIN PLAIN XOAUTH2
Net::SMTP::_SSL=GLOB(0x206713a8)<<< 250-DSN
Net::SMTP::_SSL=GLOB(0x206713a8)<<< 250 ENHANCEDSTATUSCODES
Connected to smtp.yandex.ru at /cygdrive/c/do/scripts/Yotools.pm line 559.
Auth'n as user-name... at /cygdrive/c/do/scripts/Yotools.pm line 562.
auth() error at /cygdrive/c/do/scripts/Yotools.pm line 564.
Net::SMTP::_SSL=GLOB(0x206713a8)>>> QUIT
Net::SMTP::_SSL=GLOB(0x206713a8)<<< 221 2.0.0 Closing connection.

No any diagnostics from Authen::SASL.

If I've uninstalled perl-Authen-SASL-XS all work. Debug log (base64'd user name
and password at login are changed):

Net::SMTP::_SSL>>> Net::SMTP::_SSL
Net::SMTP::_SSL>>>   IO::Socket::SSL(2.027)
Net::SMTP::_SSL>>>     IO::Socket::IP(0.37)
Net::SMTP::_SSL>>>       IO::Socket(1.38)
Net::SMTP::_SSL>>>         IO::Handle(1.35)
Net::SMTP::_SSL>>>           Exporter(5.72)
Net::SMTP::_SSL>>>   Net::SMTP(3.05)
Net::SMTP::_SSL>>>     Net::Cmd(3.05)
Net::SMTP::_SSL=GLOB(0x206715f0)<<< 220 smtp1h.mail.yandex.net ESMTP (Want to use Yandex.Mail for your domain? Visit http://pdd.yandex.ru)
Net::SMTP::_SSL=GLOB(0x206715f0)>>> EHLO localhost.localdomain
Net::SMTP::_SSL=GLOB(0x206715f0)<<< 250-smtp1h.mail.yandex.net
Net::SMTP::_SSL=GLOB(0x206715f0)<<< 250-8BITMIME
Net::SMTP::_SSL=GLOB(0x206715f0)<<< 250-PIPELINING
Net::SMTP::_SSL=GLOB(0x206715f0)<<< 250-SIZE 42991616
Net::SMTP::_SSL=GLOB(0x206715f0)<<< 250-AUTH LOGIN PLAIN XOAUTH2
Net::SMTP::_SSL=GLOB(0x206715f0)<<< 250-DSN
Net::SMTP::_SSL=GLOB(0x206715f0)<<< 250 ENHANCEDSTATUSCODES
Connected to smtp.yandex.ru at /cygdrive/c/do/scripts/Yotools.pm line 559.
Auth'n as user-name... at /cygdrive/c/do/scripts/Yotools.pm line 562.
Net::SMTP::_SSL=GLOB(0x206715f0)>>> AUTH LOGIN
Net::SMTP::_SSL=GLOB(0x206715f0)<<< 334 VXNlcm5hbWU6
Net::SMTP::_SSL=GLOB(0x206715f0)>>> USER_NAME
Net::SMTP::_SSL=GLOB(0x206715f0)<<< 334 UGFzc3dvcmQ6
Net::SMTP::_SSL=GLOB(0x206715f0)>>> PASSWORD
Net::SMTP::_SSL=GLOB(0x206715f0)<<< 235 2.7.0 Authentication successful.
auth()'d at 'smtp.yandex.ru' as 'user-name'
2016-06-01 05:13:46: Mail'n from 'Account <user-name AT yandex DOT ru>'... Net::SMTP::_SSL=GLOB(0x206715f0)>>> MAIL FROM:<user-name AT yandex DOT ru>
Net::SMTP::_SSL=GLOB(0x206715f0)<<< 250 2.1.0 <user-name AT yandex DOT ru> ok
To: recipient AT yandex DOT ru
Net::SMTP::_SSL=GLOB(0x206715f0)>>> RCPT TO:<olnd AT yandex DOT ru>
Net::SMTP::_SSL=GLOB(0x206715f0)<<< 250 2.1.5 <recipient AT yandex DOT ru> recipient ok
Net::SMTP::_SSL=GLOB(0x206715f0)>>> DATA
Net::SMTP::_SSL=GLOB(0x206715f0)<<< 354 Enter mail, end with "." on a line by itself
Net::SMTP::_SSL=GLOB(0x206715f0)>>> Date: Wed, 01 Jun 2016 05:13:45 +0300
Net::SMTP::_SSL=GLOB(0x206715f0)>>> From: <user-name AT yandex DOT ru>
Net::SMTP::_SSL=GLOB(0x206715f0)>>> MIME-Version: 1.0
Net::SMTP::_SSL=GLOB(0x206715f0)>>> Reply-To: <user-name AT yandex DOT ru>
Net::SMTP::_SSL=GLOB(0x206715f0)>>> Subject: Test
Net::SMTP::_SSL=GLOB(0x206715f0)>>> To: <recipient AT yandex DOT ru>
Net::SMTP::_SSL=GLOB(0x206715f0)>>> Content-Type: text/plain; charset=UTF-8
Net::SMTP::_SSL=GLOB(0x206715f0)>>> Content-Transfer-Encoding: quoted-printable
Net::SMTP::_SSL=GLOB(0x206715f0)>>> Content-Disposition: inline
Net::SMTP::_SSL=GLOB(0x206715f0)>>> Howdy! This is test message.
Net::SMTP::_SSL=GLOB(0x206715f0)>>> --
Net::SMTP::_SSL=GLOB(0x206715f0)>>>
Net::SMTP::_SSL=GLOB(0x206715f0)>>> Best regards.
Net::SMTP::_SSL=GLOB(0x206715f0)>>> .
Net::SMTP::_SSL=GLOB(0x206715f0)<<< 250 2.0.0 Ok: queued on smtp1h.mail.yandex.net as 1464747226-BQFvPGbm8R-DjMKLPln
Net::SMTP::_SSL=GLOB(0x206715f0)>>> QUIT
Net::SMTP::_SSL=GLOB(0x206715f0)<<< 221 2.0.0 Closing connection.

Authen::SASL POD says:

    The framework allows different implementations of the connection class to be
    plugged in...

    By default the order in which these plugins are selected is
    Authen::SASL::XS, Authen::SASL::Cyrus and then Authen::SASL::Perl.

    If you want to change it or want to specifically use one implementation only
    simply do

        use Authen::SASL qw(Perl);

but I don't want to change Net::SMTP module that uses that code (uses default
Authen::SASL plugin):

/usr/lib/perl5/5.22/Net/SMTP.pm (160):

    eval {
      require MIME::Base64;
      require Authen::SASL;
    } or $self->set_status(500, ["Need MIME::Base64 and Authen::SASL todo auth"]), return 0;

Problem? Is Authen::SASL::XS so required to install with Authen::SASL if
Authen::SASL works fine without it? I'm not expert in Perl, but I think that
module's code says "use what you found":

/usr/lib/perl5/vendor_perl/5.22/Authen/SASL.pm (13):

    @Plugins = qw(
        Authen::SASL::XS
        Authen::SASL::Cyrus
        Authen::SASL::Perl
    );

    sub import {
      shift;
      return unless @_;

      local $SIG{__DIE__};
      @Plugins = grep { /^[:\w]+$/ and eval "require $_" } map { /::/ ? $_ : "Authen::SASL::$_" } @_
          or croak "no valid Authen::SASL plugins found";
    }

Google found couple pages for me where advised to remove Authen::SASL::XS.

https://foswiki.org/Support/Faq69

    Authen::SASL comes with a pure perl version of the mechanism, and can also
    use some optional implementations: Authen::SASL::XS or Authen::SASL:Cyrus.
    If either the XS or Cyrus modules are installed, try removing them.

https://rtcpan.develooper.com/Public/Bug/Display.html?id=100235

    $client is now set but $client->mechanism returns undef. Therefore
    $mechanisms =~ s/\b\Q$failed_mechanism\E\b//; does not change $mechanisms at
    all and the loop tries the same $mechanisms over and over again.

    Uninstalling Authen::SASL::XS is as a workaround for us since with
    Authen::SASL::Perl everything seems to work just fine.

They says about "Error: Use of uninitialized value $_..." and unknown
authentication mechanism but about removing Authen::SMTP::XS too.

Thanks.

Sorry for the verbosity. 

-- 
  Oleg


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019