Can't send email to Exchange Server

Moderator: crythias

Post Reply
Rbx774
Znuny newbie
Posts: 25
Joined: 28 Sep 2017, 11:18
Znuny Version: CentOS 7, OTRS 5
Real Name: Slava

Can't send email to Exchange Server

Post by Rbx774 »

Hi,
I have fresh install OTRS 5.0.23-01 over CentOS 7.
Have a trouble to configuring send email to my Exchange Server.
In SysConfig Core::Sendmail i setup:
SendmailModule SMTP
SendmailModule::Host smtp.mycompany.ru
SendmailModule::Port 25
SendmailModule::AuthUser otrs-admin
SendmailModule::AuthPassword 123456

MS Exchange Server 2016. Receive Connector configured to receive email from OTRS by IP address. Also permit anonymous send and it's work correct.

Please help.

Error when SMTP send:

Receive error "SMTP authentication failed: 5355.7.3 Authentication unsuccessful ! Enable Net::SMTP debug for more info!"




Error Details

Backend ERROR: OTRS-CGI-77 Perl: 5.16.3 OS: linux Time: Mon Oct 2 18:24:43 2017

Message: SMTP authentication failed: 5355.7.3 Authentication unsuccessful
! Enable Net::SMTP debug for more info!

RemoteAddress: 10.110.6.42
RequestURI: /otrs/index.pl

Traceback (13713):
Module: Kernel::System::Email::SMTP::Send Line: 122
Module: Kernel::System::Email::Send Line: 765
Module: Kernel::Modules::AdminEmail::Run Line: 173
Module: Kernel::System::Web::InterfaceAgent::Run Line: 1055
Module: ModPerl::ROOT::ModPerl::Registry::opt_otrs_bin_cgi_2dbin_index_2epl::handler Line: 40
Module: (eval) (v1.99) Line: 207
Module: ModPerl::RegistryCooker::run (v1.99) Line: 207
Module: ModPerl::RegistryCooker::default_handler (v1.99) Line: 173
Module: ModPerl::Registry::handler (v1.99) Line: 32
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Can't send email to Exchange Server

Post by reneeb »

Double check that the user has access to the SMTP server...

You need the Base64 encoded username and password:

Code: Select all

perl -MMIME::Base64 -E 'say encode_base64(q~otrs_admin~)'
perl -MMIME::Base64 -E 'say encode_base64(q~123456~)'
With your settings this would be 'b3Ryc19hZG1pbg==' and 'MTIzNDU2'.

Then connect to the smtp with telnet:

Code: Select all

telnet  smtp.mycompany.ru 25
When the connection is established, greet your SMTP:

Code: Select all

EHLO stmp.mycompany.ru
. After that, you should say that you want to login:

Code: Select all

AUTH LOGIN
. Then paste

Code: Select all

b3Ryc19hZG1pbg==
and finally paste

Code: Select all

MTIzNDU2
. This should look similar to this

Code: Select all

$ telnet smtp.mycompany.ru 25
Trying 127.0.0.1...
Connected to smtp.mycompany.ru.
Escape character is '^]'.
220 smtp.mycompany.ru ESMTP Postfix
EHLO smtp.mycompany.ru
250-smtp.mycompany.ru
250-PIPELINING
250-SIZE 20480000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
AUTH LOGIN
334 VXNlcm5hbWU6
b3Ryc19hZG1pbg==
334 UGFzc3dvcmQ6
MTIzNDU2
235 2.7.0 Authentication successful
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Rbx774
Znuny newbie
Posts: 25
Joined: 28 Sep 2017, 11:18
Znuny Version: CentOS 7, OTRS 5
Real Name: Slava

Re: Can't send email to Exchange Server

Post by Rbx774 »

reneeb wrote:Double check that the user has access to the SMTP server...

You need the Base64 encoded username and password:

Code: Select all

perl -MMIME::Base64 -E 'say encode_base64(q~otrs_admin~)'
perl -MMIME::Base64 -E 'say encode_base64(q~123456~)'
With your settings this would be 'b3Ryc19hZG1pbg==' and 'MTIzNDU2'.

Then connect to the smtp with telnet:

Code: Select all

telnet  smtp.mycompany.ru 25
When the connection is established, greet your SMTP:

Code: Select all

EHLO stmp.mycompany.ru
. After that, you should say that you want to login:

Code: Select all

AUTH LOGIN
. Then paste

Code: Select all

b3Ryc19hZG1pbg==
and finally paste

Code: Select all

MTIzNDU2
. This should look similar to this

Code: Select all

$ telnet smtp.mycompany.ru 25
Trying 127.0.0.1...
Connected to smtp.mycompany.ru.
Escape character is '^]'.
220 smtp.mycompany.ru ESMTP Postfix
EHLO smtp.mycompany.ru
250-smtp.mycompany.ru
250-PIPELINING
250-SIZE 20480000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
AUTH LOGIN
334 VXNlcm5hbWU6
b3Ryc19hZG1pbg==
334 UGFzc3dvcmQ6
MTIzNDU2
235 2.7.0 Authentication successful

Hi,
Have next trouble:
[root@OTRS /]# telnet ex16-mx1.company.ru 25
Trying 10.110.2.91...
Connected to ex16-mx1.company.ru.
Escape character is '^]'.
220 Ex16-MX1.company.ru Microsoft ESMTP MAIL Service ready at Wed, 4 Oct 2017 10:28:24 +0300
EHLO mail.company.ru
250-Ex16-MX1.company.ru Hello [10.110.2.20]
250-SIZE 52428800
250-PIPELINING
250-DSN
250-ENHANCEDSTATUSCODES
250-STARTTLS
250-X-ANONYMOUSTLS
250-AUTH NTLM
250-X-EXPS GSSAPI NTLM
250-8BITMIME
250-BINARYMIME
250-CHUNKING
250 XRDST
AUTH NTLM dGVzdGlrb3Yy
535 5.7.3 Authentication unsuccessful
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: Can't send email to Exchange Server

Post by reneeb »

Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Post Reply