Hi All,

In short, the bad news is that M$ once again produced the error seen in
https://sourceforge.net/p/isync/bugs/22/#b4c3/8c94
even though I have
PipelineDepth 1 
in mbsynrc.

The good news is that pushing via Davmail, rather than IMAP directly, cured it! 
So now direct IMAP works again.


Ok, so here are some details. After years since I last saw this error, today I 
got

===8<===
Opening near side box XXX...
Loading far side box...
far side: 4094 messages, 0 recent
Loading near side box...
near side: 4104 messages, 0 recent
Synchronizing...
IMAP error: unexpected tag <td><span
===8<===

when pushing my emails up to M$ from a maildir that here I'll just call XXX. 
Many folders before this one synced up fine. The log with -Dn is

===8<===
isync 1.5.1 called with: '-Dn' 'uob-up'
Reading configuration file /home/balazs/.mbsyncrc
Channel uob-up
Opening far side store uob-remote...
Resolving outlook.office365.com...
Opening near side store uob-local...
Connecting to outlook.office365.com (52.97.219.210:993)... 
Connection is now encrypted
* OK The Microsoft Exchange IMAP4 service is ready. (BACKENDAUTHENTICATE) [...]
>>> 1 CAPABILITY

* CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS ID 
UNSELECT CHILDREN IDLE NAMESPACE LITERAL+
1 OK CAPABILITY completed.
Logging in...
Authenticating with SASL mechanism XOAUTH2...
>>> 2 AUTHENTICATE XOAUTH2 [token here]

2 OK AUTHENTICATE completed.
>>> 3 CAPABILITY

* CAPABILITY IMAP4 IMAP4rev1 AUTH=PLAIN AUTH=XOAUTH2 SASL-IR UIDPLUS MOVE ID 
UNSELECT CLIENTACCESSRULES CLIENTNETWORKPRESENCELOCATION BACKENDAUTHENTICATE 
CHILDREN IDLE NAMESPACE LITERAL+
3 OK CAPABILITY completed.
>>> 4 NAMESPACE

* NAMESPACE (("" "/")) NIL NIL
4 OK NAMESPACE completed.
>>> 5 LIST "" "*"
[...]
* LIST (\HasNoChildren) "/" XXX
[...]
5 OK LIST completed.
[...]
Opening far side box XXX...
>>> 160 SELECT "XXX"

Opening near side box XXX...
* 4097 EXISTS
* 0 RECENT
* FLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)
* OK [PERMANENTFLAGS (\Seen \Answered \Flagged \Deleted \Draft $MDNSent)] 
Permanent flags
* OK [UNSEEN 142] Is the first unseen message
* OK [UIDVALIDITY 1396] UIDVALIDITY value
* OK [UIDNEXT 10854] The next unique identifier value
160 OK [READ-WRITE] SELECT completed.
Loading far side box...
>>> 161 UID FETCH 3856:10850 (UID)

Loading near side box...
near side: 4104 messages, 0 recent
* 1 FETCH (UID 4503)
* 2 FETCH (UID 5342)
* 3 FETCH (UID 5343)
[...]
* 4092 FETCH (UID 10848)
* 4093 FETCH (UID 10849)
* 4094 FETCH (UID 10850)
161 OK FETCH completed.
>>> 162 UID FETCH 10851:10853 (UID BODY.PEEK[HEADER.FIELDS (X-TUID)])

* 4095 FETCH (UID 10851 BODY[HEADER.FIELDS (X-TUID)] {24}
X-TUID: hhoQfQ41RDWr\r\n\r\n
)
* 4096 FETCH (UID 10852 BODY[HEADER.FIELDS (X-TUID)] {24}
X-TUID: mfYCj7LGyf1B\r\n\r\n
)
* 4097 FETCH (UID 10853 BODY[HEADER.FIELDS (X-TUID)] {24}
X-TUID: FondxNXtWTqK\r\n\r\n
)
162 OK FETCH completed.
far side: 4097 messages, 0 recent
Synchronizing...
>>> 163 UID STORE 10845 +FLAGS.SILENT (\Deleted)

163 OK STORE completed.
>>> 164 UID STORE 10846 +FLAGS.SILENT (\Deleted)

164 OK STORE completed.
>>> 165 APPEND "XXX" (\Seen) "16-Dec-2025 10:03:43 +0000" {36634+}

>>>>> (36634 bytes omitted)
<td><span BAD Command Error. 10
===8<===


The relevant bits of .mbsyncrc:

===8<===
SyncState *
CopyArrivalDate yes

IMAPAccount uob
PipelineDepth 1
# Address to connect to
Host outlook.office365.com
User ZZZ
PassCmd "oama access ZZZ"
AuthMechs XOAUTH2
SSLType IMAPS
CertificateFile /etc/ssl/certs/ca-certificates.crt
Timeout 180
IMAPStore uob-remote
Account uob
MaildirStore uob-local
Path ~/maildir/titkos/uob/
Inbox ~/maildir/titkos/uob/Inbox
Flatten .
Channel uob-up
Far :uob-remote:
Near :uob-local:
Patterns * !"Junk Email" !INBOX !Drafts !"Sent Items/*" !"Sent Items" !Archive 
!"Calendar*" !Contacts !"Conversation History" !Journal !Notes !Outbox !"RSS 
Feeds" !Tasks !Trash !"Other Google Mail" "!Deleted Items/*"
Create Far
Sync Push
Expunge Far
===8<===

I tried to find the troubling email using its UID, I moved it out from the 
folder XXX both locally and in M365 web, nothing helped.

I then fired up Davmail and pushed this same folder XXX up the same way through 
there:

===8<===
IMAPAccount uobdavmail
PipelineDepth 1
User ZZZ
Host 127.0.0.1
Port 1143
SSLType None
AuthMechs LOGIN
PassCmd "[some gpg magic here]"
IMAPStore uobdavmail-remote
Account uobdavmail
Channel uobdavmail-up
Far :uobdavmail-remote:
Near :uobdavmail-local:
Patterns "XXX"
Create Far
Sync Push
===8<===

and that cured it. Afterwards, 'Channel uob-up' as above worked fine again.


Any comments are welcome and/or I hope this may help someone.

Best wishes,
Marton


_______________________________________________
isync-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/isync-devel

Reply via email to