SendMail SMTP error ( 501 5.5.4 Syntax: AUTH mechanism )

Moderator: crythias

Locked
newbie
Znuny newbie
Posts: 4
Joined: 22 Feb 2016, 12:28
Znuny Version: 5.0.5
Location: Poland

SendMail SMTP error ( 501 5.5.4 Syntax: AUTH mechanism )

Post by newbie »

Hi.
I have problem with smtptls sendmail option, otrs in ver 5.0.7.
User and password, servwer and port are typed 100% correct.
My questions are:
How to enable Net::SMTP debug ?
Why otrs try to sent email from otrs@local instead smtp mail account? (logs below)
I change some files to enable Net::SMTP debugging (only debug value, with no effort, in syslog i still get message to enable Net::SMTP debug for more info):
  • /opt/otrs/Kernel/System/Email/SMTP.pm:

    Code: Select all

    sub new {
        my ( $Type, %Param ) = @_;
    
        # allocate new hash for object
        my $Self = {%Param};
        bless( $Self, $Type );
    
        # debug
            # shown on STDERR
            $Self->{SMTPDebug} = 1;
  • /opt/otrs/Kernel/System/Email.pm:

    Code: Select all

    sub new {                                                                        
        my ( $Type, %Param ) = @_;                                                   
                                                                                     
        # allocate new hash for object                                               
        my $Self = {%Param};                                                         
        bless( $Self, $Type );                                                       
                                                                                     
        # debug level                                                                
        $Self->{Debug} = 2;
  • /opt/otrs/Kernel/System/EmailParser.pm:

    Code: Select all

    sub new {
        my ( $Type, %Param ) = @_;
    
        # allocate new hash for object
        my $Self = {};
        bless( $Self, $Type );
    
        # get debug level from parent
        $Self->{Debug} = 2;
  • /opt/otrs/Kernel/System/Email/SMTPTLS.pm:

    Code: Select all

        # set up connection connection
        my $SMTP = Net::SMTP->new(
            $Param{MailHost},
            Hello   => $Param{FQDN},
            Port    => $Param{SMTPPort} || 587,
            Timeout => 30,
            Debug   => 1,
        );
Also have 2 values in Config.pm to enable larger debugging:

Code: Select all

$Self->{MinimumLogLevel} = 'debug';
$Self->{Debug} = 1;
My log files looks like this:
  • apache2/error.log:

    Code: Select all

    Net::SMTP>>> Net::SMTP(2.31)
    Net::SMTP>>>   Net::Cmd(2.29)
    Net::SMTP>>>     Exporter(5.68)
    Net::SMTP>>>   IO::Socket::INET(1.33)
    Net::SMTP>>>     IO::Socket(1.36)
    Net::SMTP>>>       IO::Handle(1.34)
    Net::SMTP=GLOB(0x7f55fba87300)<<< 220 mail.pasdf.pl ESMTP
    Net::SMTP=GLOB(0x7f55fba87300)>>> EHLO d0.pasdf.local
    Net::SMTP=GLOB(0x7f55fba87300)<<< 250-mail.pasdf.pl
    Net::SMTP=GLOB(0x7f55fba87300)<<< 250-PIPELINING
    Net::SMTP=GLOB(0x7f55fba87300)<<< 250-SIZE 100000000
    Net::SMTP=GLOB(0x7f55fba87300)<<< 250-ETRN
    Net::SMTP=GLOB(0x7f55fba87300)<<< 250-STARTTLS
    Net::SMTP=GLOB(0x7f55fba87300)<<< 250-ENHANCEDSTATUSCODES
    Net::SMTP=GLOB(0x7f55fba87300)<<< 250-8BITMIME
    Net::SMTP=GLOB(0x7f55fba87300)<<< 250 DSN
    Net::SMTP=GLOB(0x7f55fba87300)>>> STARTTLS
    Net::SMTP=GLOB(0x7f55fba87300)<<< 220 2.0.0 Ready to start TLS
    Net::SSLGlue::SMTP::_SSLified=GLOB(0x7f55fba87300)>>> EHLO d0.pasdf.local
    Net::SSLGlue::SMTP::_SSLified=GLOB(0x7f55fba87300)<<< 250-mail.pasdf.pl
    Net::SSLGlue::SMTP::_SSLified=GLOB(0x7f55fba87300)<<< 250-PIPELINING
    Net::SSLGlue::SMTP::_SSLified=GLOB(0x7f55fba87300)<<< 250-SIZE 100000000
    Net::SSLGlue::SMTP::_SSLified=GLOB(0x7f55fba87300)<<< 250-ETRN
    Net::SSLGlue::SMTP::_SSLified=GLOB(0x7f55fba87300)<<< 250-AUTH PLAIN
    Net::SSLGlue::SMTP::_SSLified=GLOB(0x7f55fba87300)<<< 250-ENHANCEDSTATUSCODES
    Net::SSLGlue::SMTP::_SSLified=GLOB(0x7f55fba87300)<<< 250-8BITMIME
    Net::SSLGlue::SMTP::_SSLified=GLOB(0x7f55fba87300)<<< 250 DSN
    Net::SSLGlue::SMTP::_SSLified=GLOB(0x7f55fba87300)>>> AUTH 
    Net::SSLGlue::SMTP::_SSLified=GLOB(0x7f55fba87300)<<< 501 5.5.4 Syntax: AUTH mechanism
    Net::SSLGlue::SMTP::_SSLified=GLOB(0x7f55fba87300)>>> QUIT
    Net::SSLGlue::SMTP::_SSLified=GLOB(0x7f55fba87300)<<< 221 2.0.0 Bye
    ERROR: OTRS-CGI-10 Perl: 5.18.2 OS: linux Time: Wed Mar 23 10:05:47 2016
    
     Message: SMTP authentication failed: 5015.5.4 Syntax: AUTH mechanism
    ! Enable Net::SMTP debug for more info!
    
     RemoteAddress: 10.88.3.53
     RequestURI: /otrs/index.pl
    
     Traceback (3379): 
       Module: Kernel::System::Email::SMTP::Send Line: 118
       Module: Kernel::System::Email::Send Line: 750
       Module: Kernel::System::Ticket::Article::ArticleSend Line: 2248
       Module: Kernel::Modules::AgentTicketEmail::Run Line: 1321
       Module: Kernel::System::Web::InterfaceAgent::Run Line: 1042
       Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 40
       Module: (eval) (v1.99) Line: 206
       Module: ModPerl::RegistryCooker::run (v1.99) Line: 206
       Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 172
       Module: ModPerl::Registry::handler (v1.99) Line: 31
    
    ERROR: OTRS-CGI-10 Perl: 5.18.2 OS: linux Time: Wed Mar 23 10:05:47 2016
    
     Message: Impossible to send message to: "pasdf pasdf" <pasdf@pasdf.pl> .
    
     RemoteAddress: 10.88.3.53
     RequestURI: /otrs/index.pl
    
     Traceback (3379): 
       Module: Kernel::System::Ticket::Article::ArticleSend Line: 2255
       Module: Kernel::Modules::AgentTicketEmail::Run Line: 1321
       Module: Kernel::System::Web::InterfaceAgent::Run Line: 1042
       Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 40
       Module: (eval) (v1.99) Line: 206
       Module: ModPerl::RegistryCooker::run (v1.99) Line: 206
       Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 172
       Module: ModPerl::Registry::handler (v1.99) Line: 31
  • syslog:

    Code: Select all

    Mar 23 10:05:46 u0 OTRS-CGI-10[3379]: [Info][Kernel::System::Ticket::TicketCreate] New Ticket [2016032310000108/test] created (TicketID=12,Queue=Junk,Priority=3 normal,State=open)
    Mar 23 10:05:46 u0 OTRS-CGI-10[3379]: [Info][Kernel::System::Ticket::TicketCreate] New Ticket [2016032310000108/test] created (TicketID=12,Queue=Junk,Priority=3 normal,State=open)
    Mar 23 10:05:47 u0 OTRS-CGI-10[3379]: [Notice][Kernel::System::Email::Send] Sent email to 'pasdf@pasdf.pl' from 'otrs@localhost'. Subject => '[Ticket#2016032310000108] test';
    Mar 23 10:05:47 u0 OTRS-CGI-10[3379]: [Notice][Kernel::System::Email::Send] Sent email to 'pasdf@pasdf.pl' from 'otrs@localhost'. Subject => '[Ticket#2016032310000108] test';
    Mar 23 10:05:47 u0 OTRS-CGI-10[3379]: [Error][Kernel::System::Email::SMTP::Send][Line:118]: SMTP authentication failed: 5015.5.4 Syntax: AUTH mechanism#012! Enable Net::SMTP debug for more info!
    Mar 23 10:05:47 u0 OTRS-CGI-10[3379]: [Error][Kernel::System::Email::SMTP::Send][Line:118]: SMTP authentication failed: 5015.5.4 Syntax: AUTH mechanism#012! Enable Net::SMTP debug for more info!
    Mar 23 10:05:47 u0 OTRS-CGI-10[3379]: [Info][Kernel::System::Email::Send] Error sending message
    Mar 23 10:05:47 u0 OTRS-CGI-10[3379]: [Info][Kernel::System::Email::Send] Error sending message
    Mar 23 10:05:47 u0 OTRS-CGI-10[3379]: [Error][Kernel::System::Ticket::Article::ArticleSend][Line:2255]: Impossible to send message to: "pasdf pasdf" <pasdf@pasdf.pl> .
    Mar 23 10:05:47 u0 OTRS-CGI-10[3379]: [Error][Kernel::System::Ticket::Article::ArticleSend][Line:2255]: Impossible to send message to: "pasdf pasdf" <pasdf@pasdf.pl> .
Last edited by newbie on 06 Apr 2016, 11:46, edited 1 time in total.
wurzel
Znuny guru
Posts: 3273
Joined: 08 Jul 2010, 22:25
Znuny Version: x.x.x
Real Name: Florian

Re: SendMail SMTP error

Post by wurzel »

Hi,

your username/pw is wrong
SMTP authentication failed indicates it


Or you have missing perl modules or wrong ports. Try SMTPS or a local MX.

Flo
OTRS 2025 SILVER (Prod)
OTRS 2025 auf Debian 12 (Test)
Znuny 7.x latest version testing auf Debian 12

-- Ich beantworte keine Forums-Fragen PN - No PN please

I won't answer to unfriendly users any more. A greeting and regards are just polite.
newbie
Znuny newbie
Posts: 4
Joined: 22 Feb 2016, 12:28
Znuny Version: 5.0.5
Location: Poland

Re: SendMail SMTP error

Post by newbie »

Like I sad before my Login, Password, Port, Serwer are OK.

I create simple Perl script to debag this and I got conclusions.
In OTRS default is to use SMTP AUTH as AUTH LOGIN syntax looks like this:

$SMTP->auth( 'login,pass' )

But server that I'm connects uses SMTP AUTH as AUTH PLAIN syntax looks like this:

$SMTP->auth( "\0login\0pass" )

Is there an way to change authorization method in OTRS (or MultiSMTP) admin panel ?
Locked