-
-
Notifications
You must be signed in to change notification settings - Fork 828
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Get this error when I append the message to the sent folder using imap client #251
Comments
Can you get me a protocol log? I need to see what the command is so that I can verify that it is correct. On my IMAP servers, this works as expected so I cannot reproduce the error. I suspect your IMAP server is broken. |
where can I get the protocol log? BTW, I am trying to connect to yahoo imap server. Weird thing is it worked few minutes back. then it stopped working. |
Hi, just another piece of information. we are evaluating another product and with that, yahoo works. I just tested Hotmail and Hotmail works fine. so just yahoo with the mailkit. thanks Karthik |
change this line: using (var imapClient = new ImapClient(new NullProtocolLogger())) to this: using (var imapClient = new ImapClient(new ProtocolLogger ("imap.log")) That will log all of the communications to a file called imap.log |
I happen to have an IMAP account on yahoo.com, so I've tested it with the following MailKit commands and all of them work properly as expected: client.Inbox.Append (message);
client.Inbox.Append (message, MessageFlags.Seen);
client.Inbox.Append (message, MessageFlags.Seen, DateTimeOffset.Now);
client.Inbox.Append (message, MessageFlags.None, DateTimeOffset.Now); They result in the following IMAP commands being sent to the server:
|
let me try the same with the imap log. |
hi Jeff, Connected to imaps://imap.mail.yahoo.com:993/ <div style=3D"font-family:arial; font-size= C: : 12px;"> C: <p style=3D"text-align: left; "> C: C: C:
C: C: <span style=3D"font-family:courier new,courier,monospace;"><img src= C: C: <span style=3D"font-family:courier new,courier,monospace;"><img src= C: C: <span style=3D"font-family:courier new,courier,monospace;">Sometime= C: C: <span style=3D"font-family:courier new,courier,monospace;">But insp= C: C: <span style=3D"font-family:courier new,courier,monospace;">But insp= C: C:
C: C: S: B00000006 BAD [CLIENTBUG] Additional arguments found after last expected argument |
What versions of MimeKit and MailKit are you using? The problem appears to be a miscalculation of the size of the message. |
Actually, that's not the problem. The number of bytes is being calculated correctly after all. The problem seems to be that the message itself does not end with a CRLF. My guess is that the Yahoo! mail server appended the message just fine in the first session's APPEND command, but the second session failed because their mailbox file did not end with a newline from the previous APPEND or something like that. |
Jeff, I will try adding a new line and give it a try. thanks. |
Once I add a newline to the end of your message, it works reliably. |
I've landed a fix in MimeKit to make sure that writing a MimeMessage to a stream, the result will always end with a new-line. Out of curiosity, what other IMAP library were you looking at? |
I've released MimeKit 1.2.14 to NuGet with the fix for this bug. I've also released MailKit 1.2.13 to NuGet. |
you are awesome. Thanks for the quick turn around. Date: Mon, 19 Oct 2015 04:45:07 -0700 I've released MimeKit 1.2.14 to NuGet with the fix for this bug. I've also released MailKit 1.2.13 to NuGet. — |
I am still seeing a flood of these errors connecting to YAHOO's IMAP; we are on Mailkit 2.0.3 |
@edgiardina do you know if your messages end with a newline? That seems to have been what the original problem was. |
So we process thousands of messages a day via IMAP. The emails we process are varied and come from a large variety of customers and EMLs. I'm sure some end in newlines, but I doubt 80% of them do, which is what our error rate in IMAP to YAHOO is. My working theory is that Yahoo's IMAP servers are behind a round robin DNS issue and 4 of their 5 reject messages frequently for some common denominator which I haven't determined. If you want to see a failing EML I can email you or PM you here, but in my testing most of the EMLs we have fail. |
|
@jstedfast We are using |
If I manually add a newline to the stream it seems to fix yahoo's issues for our case
|
Okay, then the problem is that when MimeKit parses an existing message, it doesn't enforce the message stream to end with a newline sequence because it wasn't there when the message was parsed. It only enforces newlines when the message was constructed by code as in making use of |
Partial fix for jstedfast/MailKit#251
I probably won't get a chance to make another release for another 2 weeks or so, but the above commits should fix the issue. |
Thanks Jeffrey. adding it on the Imap append is perfect. I think the reason these emails don't have problems otherwise is that they're typically sent via SMTP not dropped in an IMAP folder. Appreciate the attention to this! |
No problem. |
Hi, Thanks in advance! |
I don't see any problems based on the log. Do you have problems with any other IMAP servers? |
I tested now with another imap server (outlook) without any problem. Then probably the problem is something aol specific. |
Hi, I get the below error when I append the message to the sent folder. the same code has worked before. But for some reason, it stopped working.
Error is below:
The IMAP server replied to the 'APPEND' command with a 'BAD' response: Additional arguments found after last expected argument
My code is below:
The text was updated successfully, but these errors were encountered: