Unexpected EOF when sending attachments larger than 8 Kb

Moderator: crythias

Post Reply
vanburen
Znuny newbie
Posts: 2
Joined: 28 Feb 2017, 10:30
Znuny Version: 5.0.16

Unexpected EOF when sending attachments larger than 8 Kb

Post by vanburen »

Hello,

I'm setting up OTRS 5.0.16 on Ubuntu 16.04 and all was proceeding well until I hit a snag. Whenever I try to send email tickets with attachments larger than 8Kb, I get a generic error message: "Impossible to send". After turning on more detailed logs I can see in the Apache error log that there is an Unexpected EOF right after the last line of the attachment is encoded:

Code: Select all

Net::SMTP::_SSL=GLOB(0x7f7a38512318)>>> dr/ZoNVb8kraUP8VnZ6K9w7HgLifMSmuvycWobG+7EaZyqfAt8tmc8KpbxkR
Net::SMTP::_SSL=GLOB(0x7f7a38512318)>>> Fh7CulE/DmbdbzawmZQpY2LSkwSeJfW8VTs6Abf/J9FBG0tJ5PsYdeB6tJB9
Net::SMTP::_SSL=GLOB(0x7f7a38512318)>>> x4SYG8h1zLrfzJAqDPklYpXWjCBEIByNQrpzcjyZPEBFek/nNImkeuhhoJlR
Net::SMTP::_SSL=GLOB(0x7f7a38512318)>>> EMLwlJDEmBu/BhFm3W9ahPAZt42LiYngOOxOmx0tYTlgXAcMTw4mEfFWqz2I
Net::SMTP::_SSL=GLOB(0x7f7a38512318)>>> S50yLmYwcB2z7n8J1DWpmtu0k26JGuDVcvJLxcCukSmhJNJgsar/L8AAfPvt
Net::SMTP::_SSL=GLOB(0x7f7a38512318)>>> u4Xr39EAAAAASUVORK5CYII=
Net::SMTP::_SSL=GLOB(0x7f7a38512318)>>>
Net::SMTP::_SSL=GLOB(0x7f7a38512318)>>> ------------=_1488271084-15590-1--
[Tue Feb 28 08:38:04 2017] -e: Net::SMTP::_SSL: Net::Cmd::datasend(): unexpected EOF on command channel:  at /opt/otrs/Kernel/System/Email/SMTP.pm line 170.
ERROR: OTRS-CGI-89 Perl: 5.22.1 OS: linux Time: Tue Feb 28 08:38:04 2017

 Message: Can't send message: 421[Net::SMTP::_SSL] Connection closed! Enable Net::SMTP debug for more info!

 RemoteAddress: {{ IP redacted }}
 RequestURI: /otrs/index.pl

 Traceback (15590):
   Module: Kernel::System::Email::SMTP::Send Line: 172
   Module: Kernel::System::Email::Send Line: 769
   Module: Kernel::System::Ticket::Article::ArticleSend Line: 2263
   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
I've used different type of files, binary or clear text, there seems to be no difference but the length of the file. Emails without any attachments are also not a problem.

I've also copied the entire base64 string and converted it back to binary, I get the original file, so it's not truncated anywhere, it fails right at the end.

Interesting to note perhaps is that whenever I attach 2 files that combined exceed 8Kb but each are smaller individually, there is no problem. I've tried several different SMTP configurations and hosts, but the problem remains. I'm all out of ideas. Can aynone help?

Thanks,

Roy
vanburen
Znuny newbie
Posts: 2
Joined: 28 Feb 2017, 10:30
Znuny Version: 5.0.16

Re: Unexpected EOF when sending attachments larger than 8 Kb

Post by vanburen »

Problem solved after upgrading Perl module Net::SMTP, probably a beginner's error but the OTRS module checker never mentioned it. I hope this is of use to somebody.

Cheers,

Roy
TDV
Znuny newbie
Posts: 8
Joined: 27 Apr 2017, 17:51
Znuny Version: 6.0.6

Re: Unexpected EOF when sending attachments larger than 8 Kb

Post by TDV »

vanburen wrote:Problem solved after upgrading Perl module Net::SMTP, probably a beginner's error but the OTRS module checker never mentioned it. I hope this is of use to somebody.

Cheers,

Roy
Hi Roy

It seems I faced the same problem
What did Perl module Net::SMTP version fix your problem?

I dont see such module through OTRS Support Data Collector but it is present if look through cpan:

Package namespace installed latest in CPAN file
Net::SMTP::SSL 1.03 1.04 RJBS/Net-SMTP-SSL-1.04.tar.gz
OTRS 5.0.16
giovannib
Znuny newbie
Posts: 5
Joined: 23 May 2017, 16:29
Znuny Version: OTRS5

Re: Unexpected EOF when sending attachments larger than 8 Kb

Post by giovannib »

We are facing exactly the same problem with an OTRS 5.07 on Ubuntu Server 16.04.2 when replying to tickets and inline images or attachments. It works only when attachment is just few Kb size.
Upgrading the Perl module Net::SMTP does not bring a different result, still same unexpected EOF when sending.
Can anyone help or give us an hint about?
Thanks.
ioforce
Znuny newbie
Posts: 4
Joined: 06 Oct 2017, 09:09
Znuny Version: 5.0.20
Real Name: Per Bly
Company: ioforce

Re: Unexpected EOF when sending attachments larger than 8 Kb

Post by ioforce »

We are also getting this error. Migrated from OTRS appliance to Ubuntu 16.04.
How can i upgrade Net::SMTP perl module? not very familiar with perl.

regards
Per | ioforce
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: Unexpected EOF when sending attachments larger than 8 Kb

Post by reneeb »

try

Code: Select all

apt-get install libnet-smtp-perl
or

Code: Select all

cpan Net::SMTP
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
ioforce
Znuny newbie
Posts: 4
Joined: 06 Oct 2017, 09:09
Znuny Version: 5.0.20
Real Name: Per Bly
Company: ioforce

Re: Unexpected EOF when sending attachments larger than 8 Kb

Post by ioforce »

Thanks, i will get back after we tried with new version.
ioforce
Znuny newbie
Posts: 4
Joined: 06 Oct 2017, 09:09
Znuny Version: 5.0.20
Real Name: Per Bly
Company: ioforce

Re: Unexpected EOF when sending attachments larger than 8 Kb

Post by ioforce »

A new Net::SMTP module didn´t solve the problem.
We migrated from OTRS4 appliance to Ubuntu 16.04 OTRS 5.x.

Should we add the old Net::SMTP perl from the old OTRS appliance? I don´t think it´s a solution really but maybe it helps us to go forward.

Regards
Per
ioforce
Znuny newbie
Posts: 4
Joined: 06 Oct 2017, 09:09
Znuny Version: 5.0.20
Real Name: Per Bly
Company: ioforce

Re: Unexpected EOF when sending attachments larger than 8 Kb

Post by ioforce »

Hi

Update:
For anyone that founds this thread. It seems to be working now then we upgraded the perl-module

Code: Select all

Net::Cmd
/P
Eraserhead
Znuny newbie
Posts: 33
Joined: 05 Apr 2011, 05:28
Znuny Version: 3.0.5

Re: Unexpected EOF when sending attachments larger than 8 Kb

Post by Eraserhead »

I also had this problem.

First i had to install cpanm because cpan was giving me 'killed' messages when trying to upgrade the perl module.

curl -L http://cpanmin.us | perl - --self-upgrade

After that i could upgrade the module and my problem was solved:

cpanm Net::SMTP
Post Reply