~sircmpwn/aerc2#269:
EOF Error

Sometimes when I send emails, I get an error that just says EOF, and I'm not sure what seems to be causing it. I tried a number of things to reproduce it, including:

  • Adding a new line at the end of an email
  • Not adding a new line at the end of an email
  • Writing a long email
  • Starting an email and waiting a long time to send it

It seems to occur randomly, and I'm not able to discern any pattern. It's also not clear whether emails are still sent when I get this error. My friend reported receiving duplicate emails as I rewrote and re-sent an email, but I'm not sure if this has occurred every time. No email is saved to my Sent folder. I would estimate this occurs for 5 to 10 percent of my emails.

This is with Fastmail, but I believe I have also observed it on Gmail. I'm using the most recent commit on Master on Debian 10. I am sorry for not having more details.

Status
REPORTED
Submitter
~alexwennerberg
Assigned to
No-one
Submitted
3 months ago
Updated
a month ago
Labels
bug

~alexwennerberg 3 months ago

I'm working on trying to get more details on this issue -- it seems as though the email still sends but it isn't copied to my sent folder

~hdb2 3 months ago

I've been playing with aerc today and have experienced this same issue (running the latest aerc on MacOS with fastmail). I ran aerc like so:

aerc > aerc.log 2>&1

I was able to get the error to occur, here's the very end of the error log:

2019/08/21 13:34:06 Sending mail
smtp
2019/08/21 13:34:06 rcpt to: [REDACTED]
2019/08/21 13:34:06 (ui)=> *types.AppendMessage
2019/08/21 13:34:06 <-(ui) *types.AppendMessage(82)
DONE
FdId9w OK Completed
2019/08/21 13:34:06 ->(ui) *types.Error:*types.AppendMessage
eGiEog APPEND "Sent" (\Seen) "21-Aug-2019 13:34:06 -0500" {326+}
Content-Transfer-Encoding: quoted-printable
Content-Type: text/plain; charset=UTF-8
Date: Wed, 21 Aug 2019 13:34:06 -0500
Subject: test
From: "REDACTED" <REDACTED>
To: <REDACTED>
Message-Id: <BWFIVBX24BY8.YUAX4C7LU6I6@REDACTED>

yet another test from me!
mizm5A IDLE
2019/08/21 13:34:06 (ui)<= *types.Error(83):*types.AppendMessage(82)
2019/08/21 13:34:06 EOF
eGiEog BAD junk after literal
2019/08/21 13:34:12 Closing Unix server: accept unix /var/folders/6t/7xxzvyyx5dv2tyg8ncx9nqj40000gn/T/aerc.sock: use of closed network connection

hope this helps!

~devonrjohnson 2 months ago

I have also had this issue occur multiple times on a Linux system. I have not seemed to find any pattern to the issue in terms of content of the email. Only pattern I have had is that it has occurred multiple times sending to one email address. This is also sending from a gmail account.

~muellerj 2 months ago

I have experienced that problem twice as well. Re-writing the exact same email has worked in both cases. I don't have meaningful logs.

~alexwennerberg referenced this from #293 a month ago

~akarle a month ago

I am also sporadically getting this error (aerc latest from master using IMAP via fastmail). My error log is identical to ~hdb2 's log.

I've never really written Go before, so I was limited to some good old println debugging. I narrowed it down to the handleAppendMessage function in worker/imap/movecopy.go.

Specifically, the call to imapw.client.Append is returning an err with message EOF. In every case (of the dozens I reproduced), the mail was sent, but it was not appended to my Sent folder.

If I had to guess what the EOF is, it is likely an error due to the io.Pipe writer being closed before the reader reads. The go documentation backs this up.

If this really is the case, I think it must be that the reader is called multiple times, and there is a race condition for the reader to finish and the writer to close. I say this because I believe the Write call (somewhere in composer.WriteMessage) should block until the data is read at least once. Once this happens, the thread can go on to close the writer.

Not sure where to go from here (maybe digging into the imap library, but that would be outside my domain knowledge and language knowledge :) ), but wanted to post my findings in case someone else can use it to dig deeper!

Hope this helps! Really enjoying aerc so far :)

Register here or Log in to comment, or comment via email.