davmail icon indicating copy to clipboard operation
davmail copied to clipboard

Expected Token """ , but found ""

Open leArthurDent opened this issue 3 years ago • 2 comments

Sending an email results in an error I am deeply puzzled about. Setup is a Raspberry Pi running Raspbian Buster, nextcloud, and nextcloud mail app in combination with Davmail (Version 5.1.0).

After sending I get an 503 Error, that the message was not send successful. However, it is send and received. The log gives the following output:

ERROR [ImapConnection-39212] davmail - Fehler bei der Schemaüberprüfung der Anforderung: Es wurde das Token """ erwartet, doch gefunden wurde "". Zeile 1, Position 324. 00Es wurde das Token """ erwartet, doch gefunden wurde "". Zeile 1, Position 324. request: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">soap:Header<t:RequestServerVersion Version="Exchange2013_SP1"/></soap:Header>soap:Body<m:FindFolder Traversal="Shallow"><m:FolderShape><t:BaseShape>IdOnly</t:BaseShape><t:AdditionalProperties><t:ExtendedFieldURI PropertyTag="0x3008" PropertyType="SystemTime"/><t:ExtendedFieldURI PropertyTag="0x3603" PropertyType="Integer"/><t:ExtendedFieldURI PropertyTag="0x6752" PropertyType="Integer"/><t:ExtendedFieldURI PropertyTag="0x3602" PropertyType="Integer"/><t:ExtendedFieldURI PropertyTag="0x10f3" PropertyType="String"/><t:ExtendedFieldURI PropertyTag="0x670a" PropertyType="SystemTime"/><t:ExtendedFieldURI PropertyTag="0x3613" PropertyType="String"/><t:ExtendedFieldURI PropertyTag="0x6751" PropertyType="Integer"/><t:FieldURI FieldURI="folder:DisplayName"/><t:ExtendedFieldURI PropertyTag="0x360a" PropertyType="Boolean"/></t:AdditionalProperties></m:FolderShape><m:IndexedPageFolderView MaxEntriesReturned="1" Offset="0" BasePoint="Beginning"/><m:Restriction><t:IsEqualTo><t:FieldURI FieldURI="folder:DisplayName"/><t:FieldURIOrConstant><t:Constant Value="nonexist"/></t:FieldURIOrConstant></t:IsEqualTo></m:Restriction><m:ParentFolderIds><t:DistinguishedFolderId Id="msgfolderroot"/></m:ParentFolderIds></m:FindFolder></soap:Body></soap:Envelope> davmail.exchange.ews.EWSException: Fehler bei der Schemaüberprüfung der Anforderung: Es wurde das Token """ erwartet, doch gefunden wurde "". Zeile 1, Position 324. 00Es wurde das Token """ erwartet, doch gefunden wurde "". Zeile 1, Position 324. request: <soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:t="http://schemas.microsoft.com/exchange/services/2006/types" xmlns:m="http://schemas.microsoft.com/exchange/services/2006/messages">soap:Header<t:RequestServerVersion Version="Exchange2013_SP1"/></soap:Header>soap:Body<m:FindFolder Traversal="Shallow"><m:FolderShape><t:BaseShape>IdOnly</t:BaseShape><t:AdditionalProperties><t:ExtendedFieldURI PropertyTag="0x3008" PropertyType="SystemTime"/><t:ExtendedFieldURI PropertyTag="0x3603" PropertyType="Integer"/><t:ExtendedFieldURI PropertyTag="0x6752" PropertyType="Integer"/><t:ExtendedFieldURI PropertyTag="0x3602" PropertyType="Integer"/><t:ExtendedFieldURI PropertyTag="0x10f3" PropertyType="String"/><t:ExtendedFieldURI PropertyTag="0x670a" PropertyType="SystemTime"/><t:ExtendedFieldURI PropertyTag="0x3613" PropertyType="String"/><t:ExtendedFieldURI PropertyTag="0x6751" PropertyType="Integer"/><t:FieldURI FieldURI="folder:DisplayName"/><t:ExtendedFieldURI PropertyTag="0x360a" PropertyType="Boolean"/></t:AdditionalProperties></m:FolderShape><m:IndexedPageFolderView MaxEntriesReturned="1" Offset="0" BasePoint="Beginning"/><m:Restriction><t:IsEqualTo><t:FieldURI FieldURI="folder:DisplayName"/><t:FieldURIOrConstant><t:Constant Value="nonexist"/></t:FieldURIOrConstant></t:IsEqualTo></m:Restriction><m:ParentFolderIds><t:DistinguishedFolderId Id="msgfolderroot"/></m:ParentFolderIds></m:FindFolder></soap:Body></soap:Envelope> at davmail.exchange.ews.EWSMethod.checkSuccess(EWSMethod.java:779) at davmail.exchange.ews.EwsExchangeSession.internalExecuteMethod(EwsExchangeSession.java:2991) at davmail.exchange.ews.EwsExchangeSession.executeMethod(EwsExchangeSession.java:2955) at davmail.exchange.ews.EwsExchangeSession.getSubFolderByName(EwsExchangeSession.java:2918) at davmail.exchange.ews.EwsExchangeSession.getSubFolderIdIfExists(EwsExchangeSession.java:2898) at davmail.exchange.ews.EwsExchangeSession.getFolderIdIfExists(EwsExchangeSession.java:2851) at davmail.exchange.ews.EwsExchangeSession.getFolderId(EwsExchangeSession.java:2823) at davmail.exchange.ews.EwsExchangeSession.internalGetFolder(EwsExchangeSession.java:1227) at davmail.exchange.ews.EwsExchangeSession.internalGetFolder(EwsExchangeSession.java:56) at davmail.exchange.ExchangeSession.getFolder(ExchangeSession.java:1419) at davmail.imap.ImapConnection.run(ImapConnection.java:223)

Funnily, I setup the same combination of software on openSUSE 15.3 (x86-64), Debian Buster (x86-64), and Raspbian Buster on a different Raspberry Pi and it all worked finde.

I attached the full logs, one for a successful sending and one for a sending that resulted in an error: davmail.error.txt davmail.successful.txt

I initially posted a bug report about this with nextcloud: https://github.com/nextcloud/mail/issues/4572

leArthurDent avatar Mar 04 '21 10:03 leArthurDent

My guess would be a client configuration issue with sent folder management. It's not message send that fails but a folder search: <t:Constant Value="nonexist"/>

With DavMail the client does not need to copy sent message in a sent folder, Exchange/O365 can handle this part:

  • make sure save in sent is disabled in Email client
  • make sure it's enabled in DavMail

mguessan avatar Mar 04 '21 13:03 mguessan

Thanks for the quick reply. That was my initial thought as well. "Save in sent" cannot be disabled in nextcloud mail. However, it is enabled in Davmail. Since it was enabled in all mail clients, working or not, I thought this might be ruled out. Is there any reason why this folder search is performed in the unsuccessful process, but not in the successful process? At least I cannot find it in the logs there.

leArthurDent avatar Mar 04 '21 15:03 leArthurDent