cyrusimap / cyrus-imapd

Cyrus IMAP is an email, contacts and calendar server
http://cyrusimap.org
Other
543 stars 149 forks source link

sendmail output shall be isolated from current protocol #1637

Open brong opened 11 years ago

brong commented 11 years ago

From: Julien Coloos Bugzilla-Id: 3774 Version: 2.5.x (next) Owner: Bron Gondwana

brong commented 11 years ago

From: Julien Coloos

This shall not happen often if at all, but sometimes, due to bad configuration or temporary local issues, the sendmail binary execution do fail. In such cases its output is still connected to the current procotol stream (usually LMTP) and the raw error message is sent on the wire (often breaking the protocol dialog with the client).

Here is a commit that tries to fix this. Repository: git://github.com/worldline-messaging/cyrus-imapd.git Branch: master-changes Commit: b88b4cd2a798f5342cd30c7b4d2559fc50e6ee25 (https://github.com/worldline-messaging/cyrus-imapd/commit/b88b4cd2a798f5342cd30c7b4d2559fc50e6ee25)

First, upon issue before trying to execute sendmail, log and let the caller handle the upstream procotol stream message. Then try to isolate sendmail output and log it upon issue. This is greatly inspired by the way postfix do handle 'pipe' forking. Here I do the bare minimum to isolate the output without blocking, since I believe that, unlike postfix, we shall not deal with too exotic cases.

elliefm commented 6 years ago

@rsto - I think this is fixed by the sendmail refactor? And #1984 too

rsto commented 6 years ago

I'm not so sure about that. There's still the option to fork and exec into a sendmail binary, which this issue seems to have trouble with. It would be good to be able to reconstruct the issue and see if we got rid of it.