Menu

#557 Bad request on reading IMAP folder

v4.4.0
closed-fixed
nobody
None
5
2018-06-16
2014-01-22
No

Hi all

At my company they upgraded/changed/whatever the exchange server, and now whenever I try to fetch my mails (using IMAP), I get a "bad request".

The MX record shows that we are now pointing the domain to mail.messaging.microsoft.com, so I suppose that we are using the very latest exchange webapp. I couldn't find version info.

What I do:

  1. Create new IMAP account in thunderbird
  2. go to account
  3. read mails

What happens

  1. no problem in connecting the account
  2. It shows all my imap folder
  3. "Bad request" when trying to read folder content.

The tcp stuff from the local imap connection:

  • OK [CAPABILITY IMAP4REV1 AUTH=LOGIN MOVE] IMAP4rev1 DavMail 4.4.0-2198 server ready
    1 authenticate login
    [user+pass exchange]
    1 OK Authenticated
    2 select "INBOX"
    2 BAD unable to handle request: Bad Request

I testet with exquilla, and it works.

It seems like a bug - can I supply more info?

regards
morten

Discussion

  • Mickael Guessant

    Would need more details on the failed request to answer, you should see the full request content in davmail.log

     
  • PingPong

    PingPong - 2014-03-20

    I have the same issue. POP works fine but the bad request error occurs with IMAP and CalDAV. Here are IMAP examples

    2014-03-19 01:02:21,276 DEBUG [ImapConnection-54340] davmail - > 1 OK Authenticated
    2014-03-19 01:02:21,289 DEBUG [ImapConnection-54340] davmail - < 2 lsub "" "*"
    2014-03-19 01:02:21,625 ERROR [ImapConnection-54340] davmail - Bad Request
    davmail.exchange.ews.EWSException: Bad Request
    at davmail.exchange.ews.EWSMethod.checkSuccess(EWSMethod.java:720)
    at davmail.exchange.ews.EwsExchangeSession.executeMethod(EwsExchangeSession.java:2307)
    at davmail.exchange.ews.EwsExchangeSession.appendSubFolders(EwsExchangeSession.java:1096)
    at davmail.exchange.ews.EwsExchangeSession.appendSubFolders(EwsExchangeSession.java:1112)
    at davmail.exchange.ews.EwsExchangeSession.getSubFolders(EwsExchangeSession.java:1087)
    at davmail.exchange.ExchangeSession.getSubFolders(ExchangeSession.java:1192)
    at davmail.imap.ImapConnection.sendSubFolders(ImapConnection.java:1289)
    at davmail.imap.ImapConnection.run(ImapConnection.java:186)
    2014-03-19 01:02:21,627 DEBUG [ImapConnection-54340] davmail - > 2 BAD unable to handle request: Bad Request

    2014-03-20 00:41:20,320 DEBUG [ImapConnection-61207] davmail - > 2 OK list completed
    2014-03-20 00:41:20,328 DEBUG [ImapConnection-61207] davmail - < 3 list "" "%/%"
    2014-03-20 00:41:20,564 DEBUG [ImapConnection-61207] davmail - > * list (\HasNoChildren) "/" "MyFolder"
    2014-03-20 00:41:20,739 ERROR [ImapConnection-61207] davmail - Bad Request
    davmail.exchange.ews.EWSException: Bad Request
    at davmail.exchange.ews.EWSMethod.checkSuccess(EWSMethod.java:720)
    at davmail.exchange.ews.EwsExchangeSession.executeMethod(EwsExchangeSession.java:2307)
    at davmail.exchange.ews.EwsExchangeSession.appendSubFolders(EwsExchangeSession.java:1096)
    at davmail.exchange.ews.EwsExchangeSession.getSubFolders(EwsExchangeSession.java:1087)
    at davmail.exchange.ExchangeSession.getSubFolders(ExchangeSession.java:1192)
    at davmail.imap.ImapConnection.sendSubFolders(ImapConnection.java:1289)
    at davmail.imap.ImapConnection.run(ImapConnection.java:171)
    2014-03-20 00:41:20,739 DEBUG [ImapConnection-61207] davmail - > 3 BAD unable to handle request: Bad Request

     
  • Mickael Guessant

    Could be an incompatibility with Exchange 2013, can you test again with latest svn revision ?

     
  • Morten Nielsen

    Morten Nielsen - 2014-04-08

    I downloaded from svn, but I don't know how to run it.

    I did
    svn checkout http://svn.code.sf.net/p/davmail/code/trunk davmail-code

    followed by

    $ sh davmail.sh
    Exception in thread "main" java.lang.NoClassDefFoundError: davmail/DavGateway
    Caused by: java.lang.ClassNotFoundException: davmail.DavGateway
    at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
    Could not find the main class: davmail.DavGateway. Program will exit.

    As I read it, I have a path issue.

    How should I run it?

     
  • Morten Nielsen

    Morten Nielsen - 2014-04-09

    Ok, that was easy.
    Automaticly building package for all the platform.. cool.

    The latest version didn't change much. It was more "talkative" as in more popups, but the end result is the same.

    When synchronising the clanedar, I get lots of
    2014-04-09 11:10:40,562 WARN [CaldavConnection-50684] davmail - Item AAMkADIxNjMzYjM5LWQ5ZDEtNDNiMC05MmY5LWE0ZDcwMmRmNTAzOQBGAAAAAACvOvNxNAOhTLIL42_gdMOgBwAmWoljHtBlQ4bSGHFxbouPAAAAUt_lAACufBrDZ2YNTqWjVSos_KfTAABGdJLYAAA=.EML not available: /users/xx@xx.xx/calendar/AAMkADIxNjMzYjM5LWQ5ZDEtNDNiMC05MmY5LWE0ZDcwMmRmNTAzOQBGAAAAAACvOvNxNAOhTLIL42_gdMOgBwAmWoljHtBlQ4bSGHFxbouPAAAAUt_lAACufBrDZ2YNTqWjVSos_KfTAABGdJLYAAA=.EML

    And when creating an event, It get an error (see below)
    Thunderbird tells me
    Error code: MODIFICATION_FAILED
    Status code: Status Code: 2147746065, The request cannot be processed.
    Server Replied with 503

    regrads
    morten

    2014-04-09 11:22:02,780 ERROR [CaldavConnection-50763] davmail - ErrorMimeContentConversionFailed MIME content conversion failed.
    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"><t:timezonecontext><t:timezonedefinition id="user-content-Romance Standard Time"></t:timezonedefinition></t:timezonecontext></t:requestserverversion></soap:header><soap:body><m:createitem sendmeetinginvitations="SendToNone" messagedisposition="SaveOnly"><m:saveditemfolderid><t:distinguishedfolderid id="user-content-calendar"><t:mailbox><t:emailaddress>xx@xx.xx</t:emailaddress></t:mailbox></t:distinguishedfolderid></m:saveditemfolderid><m:items><t:calenda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E8tQUxMREFZRVZFTlQ6RkFMU0UNCkJFR0lOOlZBTEFSTQ0KQUNUSU9OOkRJU1BMQVkNClRSSUdHRVI7VkFMVUU9RFVSQVRJT046LVAxRA0KREVTQ1JJUFRJT046RGVmYXVsdCBNb3ppbGxhIERlc2NyaXB0aW9uDQpFTkQ6VkFMQVJNDQpFTkQ6VkVWRU5UDQpFTkQ6VkNBTEVOREFSDQo=</t:mimecontent><t:extendedproperty><t:extendedfielduri propertytag="0x10f3" propertytype="String"><t:value>e32e041e-7b23-46db-9e20-6b20feaa3e5e.ics</t:value></t:extendedfielduri></t:extendedproperty><t:extendedproperty><t:extendedfielduri distinguishedpropertysetid="Appointment" propertyid="33303" propertytype="Integer"><t:value>0</t:value></t:extendedfielduri></t:extendedproperty><t:legacyfreebusystatus>Free</t:legacyfreebusystatus></t:calendaritem></m:items></m:createitem></soap:body></soap:envelope>
    davmail.exchange.ews.EWSException: ErrorMimeContentConversionFailed MIME content conversion failed.
    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"><t:timezonecontext><t:timezonedefinition id="user-content-Romance Standard Time"></t:timezonedefinition></t:timezonecontext></t:requestserverversion></soap:header><soap:body><m:createitem sendmeetinginvitations="SendToNone" messagedisposition="SaveOnly"><m:saveditemfolderid><t:distinguishedfolderid id="user-content-calendar"><t:mailbox><t:emailaddress>xx@xx.xx</t:emailaddress></t:mailbox></t:distinguishedfolderid></m:saveditemfolderid><m:items><t:calendaritem><t:mimecontent>QkVHSU46VkNBTEVOREFSDQpQUk9ESUQ6LS8vTW96aWxsYS5vcmcvTk9OU0dNTCBNb3ppbGxhIENhbGVuZGFyIFYxLjEvL0VODQpWRVJTSU9OOjIuMA0KTUVUSE9EOlBVQkxJU0gNCkJFR0lOOlZUSU1FWk9ORQ0KVFpJRDpFdXJvcG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VWRU5UDQpFTkQ6VkNBTEVOREFSDQo=</t:mimecontent><t:extendedproperty><t:extendedfielduri propertytag="0x10f3" propertytype="String"><t:value>e32e041e-7b23-46db-9e20-6b20feaa3e5e.ics</t:value></t:extendedfielduri></t:extendedproperty><t:extendedproperty><t:extendedfielduri distinguishedpropertysetid="Appointment" propertyid="33303" propertytype="Integer"><t:value>0</t:value></t:extendedfielduri></t:extendedproperty><t:legacyfreebusystatus>Free</t:legacyfreebusystatus></t:calendaritem></m:items></m:createitem></soap:body></soap:envelope>
    at davmail.exchange.ews.EWSMethod.checkSuccess(EWSMethod.java:715)
    at davmail.exchange.ews.EwsExchangeSession.executeMethod(EwsExchangeSession.java:2299)
    at davmail.exchange.ews.EwsExchangeSession$Event.createOrUpdate(EwsExchangeSession.java:1641)
    at davmail.exchange.ews.EwsExchangeSession.internalCreateOrUpdateEvent(EwsExchangeSession.java:2074)
    at davmail.exchange.ExchangeSession.createOrUpdateItem(ExchangeSession.java:3056)
    at davmail.caldav.CaldavConnection.handleFolderOrItem(CaldavConnection.java:287)
    at davmail.caldav.CaldavConnection.handleRequest(CaldavConnection.java:225)
    at davmail.caldav.CaldavConnection.run(CaldavConnection.java:169)

     
  • Morten Nielsen

    Morten Nielsen - 2014-04-09

    Some more debugging.

    The error refer to what evolution refers to as "meetings" as opposed to "events".
    Using davmail and thunderbird, the "meetings" are not in the calendar.

    Version 4.4.1-2225, silently ignore those calendar entries.
    (my svn version is davmail_4.4.1-2286)

     
  • Mickael Guessant

    • status: open --> pending-fixed
     
  • Mickael Guessant

    Should check this with latest version

     
  • Mickael Guessant

    • status: pending-fixed --> closed-fixed
     

Log in to post a comment.

MongoDB Logo MongoDB