Email issues after upgrade to 5

Moderator: crythias

Locked
KimmoJ
Znuny newbie
Posts: 47
Joined: 15 Sep 2011, 09:32
Znuny Version: 6.0.22
Real Name: Kimmo Jaskari
Company: Transmar Ab

Email issues after upgrade to 5

Post by KimmoJ »

My users are seeing multiple email related issues - but not all the time. Don't you just love intermittent faults?

Anyway, seeing a fair amount of "can't send message" and "impossible to send message to" in the system log, and users are complaining. There is a specific domain and user where the error appears to happen all the time.

Code: Select all

Can't send message: 552Start mail input; end with <CRLF>.<CRLF>

Code: Select all

Need Name!

Code: Select all

Impossible to send message to: "A User" <therealemail.username@therealorganization.fi> .
Nothing has changed with our queues or email settings except of course "everything" since I upgraded in place to version 5. But the settings are all there - queues have email addresses, the postmaster accounts work, and all the email addresses in use are added to the system email address management area also.

Any clues on where to start troubleshooting?

Many emails do go out without any complaints, but some get the error.
cyrilstoll
Znuny newbie
Posts: 14
Joined: 24 Sep 2014, 09:00
Znuny Version: 5.0.15
Real Name: Cyril Stoll
Company: wlan-partner.com AG
Location: Zurich
Contact:

Re: Email issues after upgrade to 5

Post by cyrilstoll »

Hi there

We are experiencing a similar issue. Upgraded OTRS to 5.0.15 and at the same time Ubuntu to 16.04. Since then when we try to send an email with an attachment of some size (i.e. more than a few KB) it fails. The error message also says impossible to send message:
Backend ERROR: OTRS-CGI-75 Perl: 5.22.1 OS: linux Time: Tue Jan 10 10:53:25 2017
Message: Impossible to send message to: xyz@domain.tld .
RemoteAddress: 10.x.x.x
RequestURI: /otrs/index.pl
Traceback (7481):
Module: Kernel::System::Ticket::Article::ArticleSend Line: 2270
Module: Kernel::Modules::AgentTicketEmail::Run Line: 1340
Module: Kernel::System::Web::InterfaceAgent::Run Line: 1054
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
But there is no issue whatsoever when sending mails without attachments (also really small text files as attachments work fine). The mails get sent without an error and are also transmitted to the receiver. But as soon as the attachment is larger than a few hundred KB the above error message is displayed and OTRS can not send the mail.

The error message in the smtp-servers syslog and mail.log is (/var/log/mail.err of the smtp-server doesn't contain anything):
Jan 10 09:06:00 hostname postfix/smtpd[18856]: lost connection after DATA (16363 bytes) from unknown[185.y.y.y]
Jan 10 09:06:00 hostname postfix/smtpd[18856]: disconnect from unknown[185.y.y.y]
Jan 10 09:06:00 hostname postfix/cleanup[18860]: 6E4FE846: message-id=<1484035559.656298.336289656@otrs.company.tld>

When I use mutt on our OTRS server to send an email with an attachment via the same smtp-server then I don't get an error and the mail gets sent and delivered without a problem. Even when sending much larger attachments than from within OTRS.

I'm not sure if the upgrade to Ubuntu 16.04 caused the issue with some Perl modifications or so. When executing the otrs.checkModules.pl script everything is ok (nothing missing besides Oracle and ODBC). Perl output from "perl -v" is as follows:
This is perl 5, version 22, subversion 1 (v5.22.1) built for x86_64-linux-gnu-thread-multi
(with 58 registered patches, see perl -V for more detail)

Before we used the same smtp-server with the same settings in OTRS and sending mails with or without attachments was working fine. Now I tried to change to SMTPS as well as SMTP. But the same error appears as when using SMTPTLS as we did before the upgrade.

By the way we also suffered from this (viewtopic.php?f=62&t=33532&p=138704#p138704) issue. I undid the changes that I mentioned in this topic just to be sure I didn't introduce the problem with those changes. But the attachment problem persists wether we use SSGlue or not.

Any hints what I could check/test or where the error might be found is highly appreciated.

Best regards,
Cyril
OTRS 5.0.15 (tarball install)
Linux <hostname> 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
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: Email issues after upgrade to 5

Post by reneeb »

Did you enable the debugging mode? (Add $Self->{Debug} = 3; after https://github.com/OTRS/otrs/blob/maste ... MTP.pm#L31)
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
cyrilstoll
Znuny newbie
Posts: 14
Joined: 24 Sep 2014, 09:00
Znuny Version: 5.0.15
Real Name: Cyril Stoll
Company: wlan-partner.com AG
Location: Zurich
Contact:

Re: Email issues after upgrade to 5

Post by cyrilstoll »

reneeb wrote:Did you enable the debugging mode? (Add $Self->{Debug} = 3; after https://github.com/OTRS/otrs/blob/maste ... MTP.pm#L31)
Hi reneeb

Thanks for the fast reply. Unfortunately I'm not quite sure how to do this. First I tried inserting this line (see solution 1) after line 31 with no effect. Then I removed it again and instead changed a part of line 32 (see solution 2) but that also didn't give me a bigger error message nor additional output in the syslog. Also there is no additional file in /opt/otrs/var/log/. I did restart apache2 after each of those changes before testing to send an email with attachment.

solution 1

Code: Select all

 31     $Self->{Debug} = $Param{Debug} || 0;
 32     $Self->{Debug} = 3;
 33     if ( $Self->{Debug} > 2 ) {
solution 2

Code: Select all

 31     $Self->{Debug} = $Param{Debug} || 0;
 32     if ( $Self->{Debug} = 3 ) {
So either I didn't enable debugging correctly or I can't find the additional information this debug mode should provide me with. Could you help me with a slightly more precise instruction on how to change this file to successfully enable the debug mode?
Besides, does that really affect my OTRS as long as I'm using SMTPTLS instead of just SMTP? Then again I couldn't find any debugging options in the SMTPTLS.pm file so I guess I can only enable it in the file you mentioned.

Sorry but I forgot to post the following line from our OTRS servers syslog that also appeared before I tried this hole debugging thing:
Jan 10 14:48:15 hostname OTRS-CGI-75[16784]: [Error][Kernel::System::Email::SMTP::Send][Line:171]: Can't send message: 421[Net::SMTP::_SSL] Connection closed! Enable Net::SMTP debug for more info!
Unfortunately I don't know how anymore but at some point I did something that showed me the following message from postfix:
postfix: Postfix is running with backwards-compatible default settings
postfix: See http://www.postfix.org/COMPATIBILITY_README.html for details
postfix: To disable backwards compatibility use "postconf compatibility_level=2" and "postfix reload"
So I changed that and tested again but that did not solve my problem either.

Thank you very much for any help on how to correctly enable debugging for SMTP or any other tips!
Regards,
Cyril
OTRS 5.0.15 (tarball install)
Linux <hostname> 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
cyrilstoll
Znuny newbie
Posts: 14
Joined: 24 Sep 2014, 09:00
Znuny Version: 5.0.15
Real Name: Cyril Stoll
Company: wlan-partner.com AG
Location: Zurich
Contact:

Re: Email issues after upgrade to 5

Post by cyrilstoll »

Addendum

Just out of curiosity I tried to send mails using sendmail. That worked without problems in both cases (with and without attachment). Unfortunately sendmail is not really an option as this server does not have a public IP address for itself. I therefore have to use our SMTP server. But I thought that info might help someone to further isolate the cause of my issue.
OTRS 5.0.15 (tarball install)
Linux <hostname> 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
cyrilstoll
Znuny newbie
Posts: 14
Joined: 24 Sep 2014, 09:00
Znuny Version: 5.0.15
Real Name: Cyril Stoll
Company: wlan-partner.com AG
Location: Zurich
Contact:

Re: Email issues after upgrade to 5

Post by cyrilstoll »

Hi

Guess I figured out how to enable debugging. My Kernel/System/Email/SMTP.pm file now contains the following code

Code: Select all

 31     $Self->{Debug} = $Param{Debug} || 3;
 32     if ( $Self->{Debug} > 2 ) {
 33
 34         # shown on STDERR
 35         $Self->{SMTPDebug} = 3;
I'm not at all sure if this is correct. Furthermore when I try to send an email with attachment I still get the same error messages as before with no additional information. Nevertheless the debug option seams to do something. Because now when we receive an email in OTRS and an autoresponder mail gets triggered, then this autoresponder mail produces a lot more output in the syslog file than before I changed the SMTP.pm file.

So debugging finally enabled. Unfortunately that does not help me since the autoresponder mails don't contain images or other attachments and thus those mails always get sent without problems.

Anybody any idea, please?
OTRS 5.0.15 (tarball install)
Linux <hostname> 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
Locked