Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 197895

Summary: mail-mta/ssmtp - mail sent from cron may fail with "Connection lost in middle of processing"
Product: Gentoo Linux Reporter: Maurice Volaski <mvolaski>
Component: Current packagesAssignee: Net-Mail Packages <net-mail+disabled>
Status: RESOLVED TEST-REQUEST    
Severity: major CC: federico.granata, miguel.tormo
Priority: High    
Version: unspecified   
Hardware: All   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---

Description Maurice Volaski 2007-11-02 18:06:46 UTC
Recently, I stopped get mail from cron and I'm seeing 
"Connection lost in middle of processing" messages in /var/log/mail.

Mail sent from the command line works just fine. 

So there is some environmental difference in cron that can trip up ssmtp. 

Oddly, there are multiple threads on the forums discussing this and some possibilities are the messages may bigger than ssmtp's buffer or multiple messages may be getting sent at once and that confuses ssmtp.

The threads are
http://forums.gentoo.org/viewtopic-t-66882-highlight-ssmtp+connection+lost+processing.html
http://forums.gentoo.org/viewtopic-t-68293-highlight-ssmtp+connection+lost+processing.html
http://forums.gentoo.org/viewtopic-t-302341-highlight-ssmtp+connection+lost+processing.html
http://forums.gentoo.org/viewtopic-t-412425-highlight-ssmtp+connection+lost+processing.html
http://forums.gentoo.org/viewtopic-t-551034-highlight-ssmtp+connection+lost+processing.html
http://forums.gentoo.org/viewtopic-t-510335-highlight-ssmtp+connection+lost+processing.html

It's amazing this problem has gone on this long and I don't see any bug referenced. And the problem has just surfaced on my system with 2.61-r2.

Anyway, if the bug can't be definitively fixed, Gentoo should consider masking or even removing ssmtp from portage.
Comment 1 Tobias Scherbaum (RETIRED) gentoo-dev 2008-06-15 08:33:14 UTC
please test with ssmtp-2.62 and report back if the problem still exists.
Comment 2 Federico Guglielmo Edoardo Granata 2008-07-06 23:19:08 UTC
I'm using ssmtp 2.62 on amd64 but sending big mail (I'm sending attach of ~1 MB) sometimes crash with "Connection lost in middle of processing" so I think 2.62 don't solve this bug.
Comment 3 Tobias Scherbaum (RETIRED) gentoo-dev 2008-07-11 18:40:25 UTC
re-open then
Comment 4 David 2010-08-20 08:06:54 UTC
Does anyone know how to resolve this? 
The same problem is on my recently installed AMD64 with all the latest packages.
Cron jobs more often than not fail to send e-mail with the following message:

sSMTP[445]: Connection lost in middle of processing
Comment 5 Miguel Angel Tormo 2010-11-23 09:33:54 UTC
I made a quick-and-dirty patch for ssmtp 2.64 to make it use (it's configurable) a temporary file as buffer, so the connection doesn't get lost because it isn't initiated until the message is complete. If someone is interested I will upload it.

Anyway, you can always use nullmailer, which uses a queue (it requires a service running).

Comment 6 Diego Elio Pettenò (RETIRED) gentoo-dev 2011-01-19 13:51:17 UTC
Please try with version 2.64 and re-open if it's still a problem.