go-imap icon indicating copy to clipboard operation
go-imap copied to clipboard

close connection on failed write

Open danielkucera opened this issue 4 years ago • 7 comments

trying to fix following error:

Oct 22 15:19:31 speedy imap-tags[27635]: imap/server: 2019/10/22 15:19:31 cannot send response:  write tcp A:143->B:1797: write: broken pipe
Oct 22 15:19:31 speedy imap-tags[27635]: imap/server: 2019/10/22 15:19:31 cannot send response:  write tcp A:143->B:1796: write: broken pipe
Oct 22 15:19:31 speedy imap-tags[27635]: imap/server: 2019/10/22 15:19:31 cannot send response:  write tcp A:143->B:1797: write: broken pipe
Oct 22 15:19:31 speedy imap-tags[27635]: imap/server: 2019/10/22 15:19:31 cannot send response:  write tcp A:143->B:1796: write: broken pipe
Oct 22 15:19:31 speedy imap-tags[27635]: imap/server: 2019/10/22 15:19:31 cannot send response:  write tcp A:143->B:1797: write: broken pipe
Oct 22 15:19:31 speedy imap-tags[27635]: imap/server: 2019/10/22 15:19:31 cannot send response:  write tcp A:143->B:1796: write: broken pipe
Oct 22 15:19:31 speedy imap-tags[27635]: imap/server: 2019/10/22 15:19:31 cannot send response:  write tcp A:143->B:1797: write: broken pipe
Oct 22 15:19:31 speedy imap-tags[27635]: imap/server: 2019/10/22 15:19:31 cannot send response:  write tcp A:143->B:1796: write: broken pipe
Oct 22 15:19:31 speedy imap-tags[27635]: imap/server: 2019/10/22 15:19:31 cannot send response:  write tcp A:143->B:1797: write: broken pipe
Oct 22 15:19:31 speedy imap-tags[27635]: imap/server: 2019/10/22 15:19:31 cannot send response:  write tcp A:143->B:1796: write: broken pipe

danielkucera avatar Oct 22 '19 14:10 danielkucera

Codecov Report

Merging #304 into master will decrease coverage by 0.04%. The diff coverage is 0%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #304      +/-   ##
==========================================
- Coverage   73.16%   73.12%   -0.05%     
==========================================
  Files          32       32              
  Lines        3462     3464       +2     
==========================================
  Hits         2533     2533              
- Misses        639      641       +2     
  Partials      290      290
Impacted Files Coverage Δ
server/conn.go 71.85% <0%> (-0.73%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update cfc6c58...5b55d05. Read the comment docs.

codecov[bot] avatar Oct 22 '19 14:10 codecov[bot]

Does it infinitely attempt to send the same response? It might be worth looking into reason why it is happening. Also, there was https://github.com/foxcpp/maddy/issues/143. If you are not using the latest master, that might be your actual problem.

foxcpp avatar Oct 22 '19 16:10 foxcpp

Just released 1.0.1 with the fix included.

emersion avatar Oct 22 '19 17:10 emersion

I've updated to latest master, I'll report back. Thank you guys.

danielkucera avatar Oct 22 '19 20:10 danielkucera

It doesn't seem to help. Happens to me after authentication also:

Oct 23 09:27:34 speedy systemd-journald[471]: Suppressed 37658 messages from imap-tags.service
Oct 23 09:27:34 speedy imap-tags[2284]: imap/server: 2019/10/23 09:27:34 cannot read command: read tcp A:143->B:58755: read: connection reset by peer

danielkucera avatar Oct 23 '19 09:10 danielkucera

I have the same problem. When used latest master with Outlook, it works, but using imap server with TB is doing this. When I set no server.Debug, then it fails right away, e.g. fails before anything can happen. When I pass some writer to server.Debug, it can do authentication, capability, id and select but fails on fetch. For now I don't know more.

horejsek avatar Apr 03 '20 08:04 horejsek

I recommend to turn on logs from the tool connecting to go-imap. My issue with broken pipe from Thundebird was because of not using raw QUOTA and QUOTAROOT responses from go-imap-quota extension. I submitted fix here: https://github.com/emersion/go-imap-quota/pull/7

horejsek avatar Apr 23 '20 10:04 horejsek