Skip to content
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

3.4.6 POP3 RETR failure for some messages #4717

Closed
yaonos opened this issue Nov 3, 2023 · 3 comments · Fixed by #4743
Closed

3.4.6 POP3 RETR failure for some messages #4717

yaonos opened this issue Nov 3, 2023 · 3 comments · Fixed by #4743
Assignees

Comments

@yaonos
Copy link

yaonos commented Nov 3, 2023

Hi,

Since our upgrade from v2.4.22 to v3.4.x there are some POP3 sessions that fail during the processing of a RETR command.

This issue has been observed with Thunderbird as a POP3 client.

While triyng to analyse this issue, it seems that Cyrus IMAP ends the mail with a line containing only ".\r" instead of ".\r\n" : the "\n" seems to be missing so the client does not send the remaining commands and the connection is closed by the server after a timeout.

This issue seems to only occur for some particular messages and is reproducible although the client may sometimes go on to and retrieve the next mail.

I was able to collect some session logs both on my lab servers and thunderbird with a mail sample that triggers the issue. We have a MURDER setup so I collected the logs on both the frontend and the backend, but it seems that the issue is located on the backend.

Seeing that the blat() function in imap/pop3c calls prot_printf() in order to send ".\r\n" at the end of the message, I tried to add a call to "prot_flush(popd_out);" after this prot_printf in case the "\n" was kept in a buffer and not send, but this does not change anything.

The blat() function does not appear to have been modified between 2.4.22 and 3.4.6 so the issue may come from a change in the lib/prot.c library.

Regards

lab-backend-pop3-4036621.txt
lab-frontend-pop3-3342595.txt
lab-thunderbird.txt
4.txt

@yaonos
Copy link
Author

yaonos commented Nov 3, 2023

Hello again,

Since my last message, I foud out that I misinterpreted Cyrus IMAP debug log and that the "\n" is not missing but is not sent on the wire in the same packet as the ".\r". This may not be correctly handled by thunderbird.

I tried another patch where I added a call to prot_flush() before sending the final ".\n\r" and this seems to resolve my issue. I will deploy this patched version on our production servers next week in order to confirm the resolution.

I have attached my patch to this message. Given that is is a workaround for a thunderbird's bug, this patch may not have its place Cyrus IMAP's official sources.

I'll leave a follow up later to let you know if the fix is confirmed.

Regards

cyrus-imapd_pop3_flush.patch

@yaonos
Copy link
Author

yaonos commented Nov 23, 2023

Hello,

It's been more than 2weeks since I have applied this patch to our production servers and the issue with Thunderbird has not been observed since then.

I'll let the Cyrus IMAP maintainters decide wether or not this patch should be integrated in the official releases.

Regards

@elliefm elliefm self-assigned this Nov 23, 2023
@elliefm
Copy link
Contributor

elliefm commented Nov 23, 2023

Thanks for the followup! I'll review the patch

elliefm added a commit to elliefm/cyrus-imapd that referenced this issue Nov 23, 2023
Works around some Thunderbird bug.  Based on patch provided and
tested in cyrusimap#4717 by @yaonos (Stéphane GAUBERT)

Fixes: cyrusimap#4717
elliefm added a commit to elliefm/cyrus-imapd that referenced this issue Nov 26, 2023
Works around some Thunderbird bug.  Based on patch provided and
tested in cyrusimap#4717 by @yaonos (Stéphane GAUBERT)

Fixes: cyrusimap#4717
elliefm added a commit that referenced this issue Jan 17, 2024
Works around some Thunderbird bug.  Based on patch provided and
tested in #4717 by @yaonos (Stéphane GAUBERT)

Fixes: #4717
elliefm added a commit that referenced this issue Jan 19, 2024
Works around some Thunderbird bug.  Based on patch provided and
tested in #4717 by @yaonos (Stéphane GAUBERT)

Fixes: #4717
elliefm added a commit to elliefm/cyrus-imapd that referenced this issue Mar 6, 2024
Works around some Thunderbird bug.  Based on patch provided and
tested in cyrusimap#4717 by @yaonos (Stéphane GAUBERT)

Fixes: cyrusimap#4717
elliefm added a commit to elliefm/cyrus-imapd that referenced this issue Mar 12, 2024
Works around some Thunderbird bug.  Based on patch provided and
tested in cyrusimap#4717 by @yaonos (Stéphane GAUBERT)

Fixes: cyrusimap#4717
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants