Thunderbird and Dovecot 2.4.0 Incompatibility
I'm trying to setup a dovecot 2.4.0 imap server and have it work with Thunderbird. I'm able to connect/auth fine, however trying to save a message to a mailbox causes the connection to close.
Info: Disconnected: Too many invalid IMAP commands. in=744 out=2559 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
It appears thunderbird's imap APPEND command is using syntax which dovecot doesn't like? I enabled raw logs and pasted them below:
Downgrading to 2.3 resolves the issue, so it’s either a regression, or some config issue I’m not able to pinpoint.
1738942430.025029 5 ID ("name" "Thunderbird" "version" "128.7.0")
1738942430.029320 6 ENABLE UTF8=ACCEPT
1738942430.033907 7 select "Drafts"
1738942430.039796 8 append "Drafts" (\Draft) UTF8 (~{726+}
1738942430.039796 Message-ID: <ea714f62-7186-4bcb-b709-007e39c6a9d6@example.com <mailto:ea714f62-7186-4bcb-b709-007e39c6a9d6@example.com>>
1738942430.039796 Date: Fri, 7 Feb 2025 10:33:49 -0500
1738942430.039796 MIME-Version: 1.0
1738942430.039796 User-Agent: Mozilla Thunderbird
1738942430.039796 Content-Language: en-US
1738942430.039796 To: sender@example.com <mailto:sender@example.com>
1738942430.039796 From: User Name <user@example.com <mailto:user@example.com>>
1738942430.039796 Subject: test
1738942430.039796 X-Mozilla-Draft-Info: internal/draft; vcard=0; receipt=0; DSN=0; uuencode=0;
1738942430.039796 attachmentreminder=0; deliveryformat=0
1738942430.039796 X-Identity-Key: id2
1738942430.039796 Fcc: imap://user%40example.com@192.168.115.203/Sent
1738942430.039796 Content-Type: text/html; charset=UTF-8
1738942430.039796 Content-Transfer-Encoding: 7bit
1738942430.039796
1738942430.039796 <!DOCTYPE html>
1738942430.039796 <html>
1738942430.039796 <head>
1738942430.039796
1738942430.039796 <meta http-equiv="content-type" content="text/html; charset=UTF-8">
1738942430.039796 </head>
1738942430.039796 <body>
1738942430.039796 <p><br>
1738942430.039796 </p>
1738942430.039796 </body>
1738942430.039796 </html>
1738942430.039796 )
1738942430.025188 * ID ("name" "Dovecot")
1738942430.025234 5 OK ID completed (0.001 + 0.000 secs).
1738942430.029390 * ENABLED UTF8=ACCEPT
1738942430.029418 6 OK Enabled (0.001 + 0.000 secs).
1738942430.035478 * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
1738942430.035531 * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted.
1738942430.035559 * 0 EXISTS
1738942430.035585 * 0 RECENT
1738942430.035611 * OK [UIDVALIDITY 1738898190] UIDs valid
1738942430.035638 * OK [UIDNEXT 1] Predicted next UID
1738942430.035693 7 OK [READ-WRITE] Select completed (0.002 + 0.000 + 0.001 secs).
1738942430.040007 8 BAD Error in IMAP command APPEND: Missing ')' (0.001 + 0.000 secs).
1738942430.040140 * BAD Error in IMAP tag: Invalid tag (0.001 + 0.000 secs).
1738942430.040172 Date: BAD Error in IMAP command FRI,: Unknown command (0.001 + 0.000 secs).
1738942430.040233 MIME-Version: BAD Error in IMAP command 1.0: Unknown command (0.001 + 0.000 secs).
1738942430.040291 User-Agent: BAD Error in IMAP command MOZILLA: Unknown command (0.001 + 0.000 secs).
1738942430.040356 Content-Language: BAD Error in IMAP command EN-US: Unknown command (0.001 + 0.000 secs).
1738942430.040409 To: BAD Error in IMAP command sender@example.com <mailto:sender@example.com>: Unknown command (0.001 + 0.000 secs).
1738942430.040467 From: BAD Error in IMAP command USER: Unknown command (0.001 + 0.000 secs).
1738942430.040521 Subject: BAD Error in IMAP command TEST: Unknown command (0.001 + 0.000 secs).
1738942430.040574 X-Mozilla-Draft-Info: BAD Error in IMAP command INTERNAL/DRAFT;: Unknown command (0.001 + 0.000 secs).
1738942430.040638 * BAD Error in IMAP tag: Invalid tag (0.001 + 0.000 secs).
1738942430.040666 X-Identity-Key: BAD Error in IMAP command ID2: Unknown command (0.001 + 0.000 secs).
1738942430.040720 Fcc: BAD Error in IMAP command: Invalid command name (0.001 + 0.000 secs).
1738942430.040746 Content-Type: BAD Error in IMAP command TEXT/HTML;: Unknown command (0.001 + 0.000 secs).
1738942430.040802 Content-Transfer-Encoding: BAD Error in IMAP command 7BIT: Unknown command (0.001 + 0.000 secs).
1738942430.040862 * BAD Error in IMAP tag: Invalid tag (0.001 + 0.000 secs).
1738942430.040889 <!DOCTYPE BAD Error in IMAP command HTML>: Unknown command (0.001 + 0.000 secs).
1738942430.040966 <html> BAD Error in IMAP command: Invalid command name (0.001 + 0.000 secs).
1738942430.040991 * BAD Error in IMAP tag: Invalid tag (0.001 + 0.000 secs).
1738942430.041015 * BAD Error in IMAP tag: Invalid tag (0.001 + 0.000 secs).
1738942430.041032 * BYE Too many invalid IMAP commands.
Hi!
Do you have
mail_utf8_extensions=yes
in your config file?
Aki
On 10/02/2025 01:06 EET Amit Chaudhari via dovecot <dovecot@dovecot.org> wrote:
I'm trying to setup a dovecot 2.4.0 imap server and have it work with Thunderbird. I'm able to connect/auth fine, however trying to save a message to a mailbox causes the connection to close.
Info: Disconnected: Too many invalid IMAP commands. in=744 out=2559 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
It appears thunderbird's imap APPEND command is using syntax which dovecot doesn't like? I enabled raw logs and pasted them below:
Downgrading to 2.3 resolves the issue, so it’s either a regression, or some config issue I’m not able to pinpoint.
1738942430.025029 5 ID ("name" "Thunderbird" "version" "128.7.0") 1738942430.029320 6 ENABLE UTF8=ACCEPT 1738942430.033907 7 select "Drafts" 1738942430.039796 8 append "Drafts" (\Draft) UTF8 (~{726+} 1738942430.039796 Message-ID: <ea714f62-7186-4bcb-b709-007e39c6a9d6@example.com <mailto:ea714f62-7186-4bcb-b709-007e39c6a9d6@example.com>> 1738942430.039796 Date: Fri, 7 Feb 2025 10:33:49 -0500 1738942430.039796 MIME-Version: 1.0 1738942430.039796 User-Agent: Mozilla Thunderbird 1738942430.039796 Content-Language: en-US 1738942430.039796 To: sender@example.com <mailto:sender@example.com> 1738942430.039796 From: User Name <user@example.com <mailto:user@example.com>> 1738942430.039796 Subject: test 1738942430.039796 X-Mozilla-Draft-Info: internal/draft; vcard=0; receipt=0; DSN=0; uuencode=0; 1738942430.039796 attachmentreminder=0; deliveryformat=0 1738942430.039796 X-Identity-Key: id2 1738942430.039796 Fcc: imap://user%40example.com@192.168.115.203/Sent 1738942430.039796 Content-Type: text/html; charset=UTF-8 1738942430.039796 Content-Transfer-Encoding: 7bit 1738942430.039796 1738942430.039796 <!DOCTYPE html> 1738942430.039796 <html> 1738942430.039796 <head> 1738942430.039796 1738942430.039796 <meta http-equiv="content-type" content="text/html; charset=UTF-8"> 1738942430.039796 </head> 1738942430.039796 <body> 1738942430.039796 <p><br> 1738942430.039796 </p> 1738942430.039796 </body> 1738942430.039796 </html> 1738942430.039796 )
1738942430.025188 * ID ("name" "Dovecot") 1738942430.025234 5 OK ID completed (0.001 + 0.000 secs). 1738942430.029390 * ENABLED UTF8=ACCEPT 1738942430.029418 6 OK Enabled (0.001 + 0.000 secs). 1738942430.035478 * FLAGS (\Answered \Flagged \Deleted \Seen \Draft) 1738942430.035531 * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted. 1738942430.035559 * 0 EXISTS 1738942430.035585 * 0 RECENT 1738942430.035611 * OK [UIDVALIDITY 1738898190] UIDs valid 1738942430.035638 * OK [UIDNEXT 1] Predicted next UID 1738942430.035693 7 OK [READ-WRITE] Select completed (0.002 + 0.000 + 0.001 secs). 1738942430.040007 8 BAD Error in IMAP command APPEND: Missing ')' (0.001 + 0.000 secs). 1738942430.040140 * BAD Error in IMAP tag: Invalid tag (0.001 + 0.000 secs). 1738942430.040172 Date: BAD Error in IMAP command FRI,: Unknown command (0.001 + 0.000 secs). 1738942430.040233 MIME-Version: BAD Error in IMAP command 1.0: Unknown command (0.001 + 0.000 secs). 1738942430.040291 User-Agent: BAD Error in IMAP command MOZILLA: Unknown command (0.001 + 0.000 secs). 1738942430.040356 Content-Language: BAD Error in IMAP command EN-US: Unknown command (0.001 + 0.000 secs). 1738942430.040409 To: BAD Error in IMAP command sender@example.com <mailto:sender@example.com>: Unknown command (0.001 + 0.000 secs). 1738942430.040467 From: BAD Error in IMAP command USER: Unknown command (0.001 + 0.000 secs). 1738942430.040521 Subject: BAD Error in IMAP command TEST: Unknown command (0.001 + 0.000 secs). 1738942430.040574 X-Mozilla-Draft-Info: BAD Error in IMAP command INTERNAL/DRAFT;: Unknown command (0.001 + 0.000 secs). 1738942430.040638 * BAD Error in IMAP tag: Invalid tag (0.001 + 0.000 secs). 1738942430.040666 X-Identity-Key: BAD Error in IMAP command ID2: Unknown command (0.001 + 0.000 secs). 1738942430.040720 Fcc: BAD Error in IMAP command: Invalid command name (0.001 + 0.000 secs). 1738942430.040746 Content-Type: BAD Error in IMAP command TEXT/HTML;: Unknown command (0.001 + 0.000 secs). 1738942430.040802 Content-Transfer-Encoding: BAD Error in IMAP command 7BIT: Unknown command (0.001 + 0.000 secs). 1738942430.040862 * BAD Error in IMAP tag: Invalid tag (0.001 + 0.000 secs). 1738942430.040889 <!DOCTYPE BAD Error in IMAP command HTML>: Unknown command (0.001 + 0.000 secs). 1738942430.040966 <html> BAD Error in IMAP command: Invalid command name (0.001 + 0.000 secs). 1738942430.040991 * BAD Error in IMAP tag: Invalid tag (0.001 + 0.000 secs). 1738942430.041015 * BAD Error in IMAP tag: Invalid tag (0.001 + 0.000 secs). 1738942430.041032 * BYE Too many invalid IMAP commands.
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
I have the same problem and 2.3 is working. I was trying to save an email as a draft in thunderbird. I'm using dovecot docker image from dockerhub.
May 23 22:26:06 imap-login: Info: Logged in: user=<xxx>, method=PLAIN, rip=xxx, lip=xxx, mpid=4682, TLS, session=<6vxtaNM1BcgqAoEJsoATAGQCoHpGx679> May 23 22:26:06 imap(xxx)<4682><6vxtaNM1BcgqAoEJsoATAGQCoHpGx679>: Info: Disconnected: Too many invalid IMAP commands. in=1137 out=2560 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
"mail_utf8_extensions=yes" is not active
In addition to default config files from https://github.com/dovecot/docker/tree/main/2.4.1:
auth_mechanisms = plain login
mail_home = /srv/mail/%{user | domain}/%{user | username} mail_driver = sdbox mailbox_list_layout = fs mail_path = /srv/mail/%{user | domain}/%{user | username}/dbox
namespace inbox { mailbox Drafts { special_use = \Drafts auto = subscribe } mailbox Junk { special_use = \Junk auto = subscribe sieve_script report-spam { type = before cause = copy path = /usr/lib/dovecot/sieve/report-spam.sieve } fts_autoindex = no } mailbox Trash { special_use = \Trash auto = subscribe } mailbox Archive { special_use = \Archive auto = subscribe }
mailbox Sent { special_use = \Sent auto = subscribe } }
service imap-login { inet_listener imap { port = 0 } inet_listener imaps { port = 993 } }
On 24/05/2025 09:11 EEST christin.stornowski--- via dovecot <dovecot@dovecot.org> wrote:
I have the same problem and 2.3 is working. I was trying to save an email as a draft in thunderbird. I'm using dovecot docker image from dockerhub.
May 23 22:26:06 imap-login: Info: Logged in: user=<xxx>, method=PLAIN, rip=xxx, lip=xxx, mpid=4682, TLS, session=<6vxtaNM1BcgqAoEJsoATAGQCoHpGx679> May 23 22:26:06 imap(xxx)<4682><6vxtaNM1BcgqAoEJsoATAGQCoHpGx679>: Info: Disconnected: Too many invalid IMAP commands. in=1137 out=2560 deleted=0 expunged=0 trashed=0 hdr_count=0 hdr_bytes=0 body_count=0 body_bytes=0
"mail_utf8_extensions=yes" is not active
In addition to default config files from https://github.com/dovecot/docker/tree/main/2.4.1:
auth_mechanisms = plain login
mail_home = /srv/mail/%{user | domain}/%{user | username} mail_driver = sdbox mailbox_list_layout = fs mail_path = /srv/mail/%{user | domain}/%{user | username}/dbox
namespace inbox { mailbox Drafts { special_use = \Drafts auto = subscribe } mailbox Junk { special_use = \Junk auto = subscribe sieve_script report-spam { type = before cause = copy path = /usr/lib/dovecot/sieve/report-spam.sieve } fts_autoindex = no } mailbox Trash { special_use = \Trash auto = subscribe } mailbox Archive { special_use = \Archive auto = subscribe }
mailbox Sent { special_use = \Sent auto = subscribe } }
service imap-login { inet_listener imap { port = 0 } inet_listener imaps { port = 993 } }
Can you enable rawlogs with
rawlog_dir = %{home}/rawlogs/
and mkdir rawlogs, with 0777 under user's mail home. Would be interesting to see what these invalid imap commands are.
Aki
1748068899.516623 19 COMPRESS DEFLATE
1748068899.512341 18 OK [CAPABILITY IMAP4rev1 SASL-IR LOGIN-REFERRALS ID ENABLE IDLE SORT SORT=DISPLAY THREAD=REFERENCES THREAD=REFS THREAD=ORDEREDSUBJECT MULTIAPPEND URL-PARTIAL CATENATE UNSELECT CHILDREN NAMESPACE UIDPLUS LIST-EXTENDED I18NLEVEL=1 CONDSTORE QRESYNC ESEARCH ESORT SEARCHRES WITHIN CONTEXT=SEARCH LIST-STATUS BINARY MOVE REPLACE SNIPPET=FUZZY PREVIEW=FUZZY PREVIEW SPECIAL-USE STATUS=SIZE SAVEDATE COMPRESS=DEFLATE INPROGRESS NOTIFY LITERAL+ UTF8=ACCEPT FILTER=SIEVE] Logged in 1748068899.516726 19 OK Begin compression (0.001 + 0.000 secs).
1748068899.523433 20 ID ("name" "Thunderbird" "version" "128.10.2") 1748068899.526890 21 ENABLE UTF8=ACCEPT 1748068899.529568 22 select "Drafts" 1748068899.543016 23 append "Drafts" (\Draft) UTF8 (~{2876+} 1748068899.544886 Message-ID: <78634adb-a379-44a2-80f1-c1ac4ce5d6b1@xxx> 1748068899.544886 Date: Sat, 24 May 2025 08:41:39 +0200 1748068899.544886 MIME-Version: 1.0 1748068899.544886 User-Agent: Mozilla Thunderbird 1748068899.544886 Content-Language: de-DE, en-GB 1748068899.544886 To: xxx 1748068899.544886 From: xxx 1748068899.544886 Subject: xxx 1748068899.544886 Autocrypt: addr=xxx; keydata= 1748068899.544886 xxx 1748068899.544886 X-Enigmail-Draft-Status: N11222 1748068899.544886 X-Mozilla-Draft-Info: internal/draft; vcard=0; receipt=0; DSN=0; uuencode=0; 1748068899.544886 attachmentreminder=0; deliveryformat=0 1748068899.544886 X-Identity-Key: id1 1748068899.544886 Fcc: imap://xxx/Sent 1748068899.544886 Content-Type: multipart/encrypted; 1748068899.544886 protocol="application/pgp-encrypted"; 1748068899.544886 boundary="------------xxx" 1748068899.544886 1748068899.544886 This is an OpenPGP/MIME encrypted message (RFC 4880 and 3156) 1748068899.544886 --------------xxx 1748068899.544886 Content-Type: application/pgp-encrypted 1748068899.544886 Content-Description: PGP/MIME version identification 1748068899.544886 1748068899.544886 Version: 1 1748068899.544886 1748068899.544886 --------------xxx 1748068899.544886 Content-Type: application/octet-stream; name="encrypted.asc" 1748068899.544886 Content-Description: OpenPGP encrypted message 1748068899.544886 Content-Disposition: inline; filename="encrypted.asc" 1748068899.544886 1748068899.544886 -----BEGIN PGP MESSAGE----- 1748068899.544886 1748068899.544886 xxx 1748068899.544886 -----END PGP MESSAGE----- 1748068899.544886 1748068899.544886 --------------xxx-- 1748068899.544886 )
1748068899.523551 * ID ("name" "Dovecot") 1748068899.523598 20 OK ID completed (0.001 + 0.000 secs). 1748068899.526960 * ENABLED UTF8=ACCEPT 1748068899.526985 21 OK Enabled (0.001 + 0.000 secs). 1748068899.530197 * FLAGS (\Answered \Flagged \Deleted \Seen \Draft) 1748068899.530224 * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft \*)] Flags permitted. 1748068899.530243 * 0 EXISTS 1748068899.530260 * 0 RECENT 1748068899.530278 * OK [UIDVALIDITY 1716789499] UIDs valid 1748068899.530295 * OK [UIDNEXT 5] Predicted next UID 1748068899.530327 * OK [HIGHESTMODSEQ 13] Highest 1748068899.530355 22 OK [READ-WRITE] Select completed (0.001 + 0.000 secs). 1748068899.544993 23 BAD Error in IMAP command APPEND: Missing ')' (0.001 + 0.002 + 0.001 secs). 1748068899.545152 * BAD Error in IMAP tag: Invalid tag (0.001 + 0.000 secs). 1748068899.545174 Date: BAD Error in IMAP command SAT,: Unknown command (0.001 + 0.000 secs). 1748068899.545221 MIME-Version: BAD Error in IMAP command 1.0: Unknown command (0.001 + 0.000 secs). 1748068899.545269 User-Agent: BAD Error in IMAP command MOZILLA: Unknown command (0.001 + 0.000 secs). 1748068899.545308 Content-Language: BAD Error in IMAP command DE-DE,: Unknown command (0.001 + 0.000 secs). 1748068899.545347 To: BAD Error in IMAP command xxx: Unknown command (0.001 + 0.000 secs). 1748068899.545409 From: BAD Error in IMAP command xxx: Unknown command (0.001 + 0.000 secs). 1748068899.545470 Subject: BAD Error in IMAP command ASD: Unknown command (0.001 + 0.000 secs). 1748068899.545535 Autocrypt: BAD Error in IMAP command ADDR=xxx;: Unknown command (0.001 + 0.000 secs). 1748068899.545577 * BAD Error in IMAP tag: Invalid tag (0.001 + 0.000 secs). 1748068899.545594 * BAD Error in IMAP tag: Invalid tag (0.001 + 0.000 secs). 1748068899.545610 * BAD Error in IMAP tag: Invalid tag (0.000 + 0.000 secs). 1748068899.545627 * BAD Error in IMAP tag: Invalid tag (0.001 + 0.000 secs). 1748068899.545642 * BAD Error in IMAP tag: Invalid tag (0.001 + 0.000 secs). 1748068899.545663 * BAD Error in IMAP tag: Invalid tag (0.001 + 0.000 secs). 1748068899.545678 * BAD Error in IMAP tag: Invalid tag (0.001 + 0.000 secs). 1748068899.545694 * BAD Error in IMAP tag: Invalid tag (0.001 + 0.000 secs). 1748068899.545710 X-Enigmail-Draft-Status: BAD Error in IMAP command N11222: Unknown command (0.001 + 0.000 secs). 1748068899.545751 X-Mozilla-Draft-Info: BAD Error in IMAP command INTERNAL/DRAFT;: Unknown command (0.001 + 0.000 secs). 1748068899.545768 * BYE Too many invalid IMAP commands.
Hi Aki, I work on the thunderbird (TB) imap code and am not sure if this problem is maybe something I've done wrong. Please see the information here: https://bugzilla.mozilla.org/show_bug.cgi?id=1968384#c10 TB is known to work OK doing APPEND using gmail and courier which support UTF8=ACCEPT but don't support LITERAL+. So dovecot 2.4 is the first server that I've seen and used with TB that supports both UTF8=ACCEPT and LITERAL+. When user Chris disables either UTF8=ACCEPT or LITERAL+ in TB it works OK with dovecot 2.4. But when both are enabled, dovecot 2.4 rejects the APPEND data (as you can see in the above logs). LITERAL+ just adds a "+" to the length value in parenthesis. With LITERAL+ disabled the "+" is not included and the length is the same. Should maybe the length be increased by 1 when the "+" is added? Or maybe TB is doing something else wrong? Note: I don't currently have an installation of dovecot 2.4 to test with locally. I currently only have 2.3 from fedora 42. --gene smith
Here is an update from Bugzilla https://bugzilla.mozilla.org/show_bug.cgi?id=1968384#c10
On 27/05/2025 05:00 EEST via dovecot <dovecot@dovecot.org> wrote:
Here is an update from Bugzilla https://bugzilla.mozilla.org/show_bug.cgi?id=1968384#c10
dovecot mailing list -- dovecot@dovecot.org To unsubscribe send an email to dovecot-leave@dovecot.org
This has been fixed about 1 month ago in
https://github.com/dovecot/core/compare/6c706fe3b962dfece59edc7b1f439084484a...
and will be in next release.
AKi
participants (5)
-
Aki Tuomi
-
Amit Chaudhari
-
christin stornowski
-
christin.stornowski@thebluered.net
-
gds@chartertn.net