davmail.exe works but davmailservice.exe not

Help
2013-12-26
2014-02-03
  • fschwengsbier
    fschwengsbier
    2013-12-26

    Hi,
    first of all to say is that you have build a great tool! thx.

    My plan is that davmail runs on the same server where Exchange do. So it's a little bit easier for me to deploy and support davmail.

    With davmail.exe this configuration works as expected. But if the user who started davmail logs off from the server davmail.exe will end to. So I have to use davmailservice.exe. Installation and config is done and compared to the single user config. It seems to be the same. But if Lightning should read the calendar items delivered by the service .exe nothing happens in Lightning. I have tried to run davmailservice as the same user who runs davmail but with no luck. What can I (must I) do to have davmailservice deliver the same data as davmail do?

    I will post short parts from the davmailservice.exe log and from the davmail.exe log. It seems that the service .exe behaves different than the single user .exe. Why? Afaik everything is done via the same jar?

    davmailservice.log !OK

    2013-12-26 13:52:25,578 DEBUG [CaldavConnection-18026] davmail  - Report item 1/9
    2013-12-26 13:52:25,578 DEBUG [CaldavConnection-18022] davmail  - < REPORT /public/NDS%20Ferien%202014/ HTTP/1.1
    2013-12-26 13:52:25,578 DEBUG [CaldavConnection-18022] davmail  - < Host: server.fds.local:1080
    2013-12-26 13:52:25,578 DEBUG [CaldavConnection-18022] davmail  - < User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 Lightning/2.6.4
    2013-12-26 13:52:25,578 DEBUG [CaldavConnection-18022] davmail  - < Accept: text/xml
    2013-12-26 13:52:25,578 DEBUG [CaldavConnection-18022] davmail  - < Accept-Language: de-de,de;q=0.8,en-us;q=0.5,en;q=0.3
    2013-12-26 13:52:25,578 DEBUG [CaldavConnection-18022] davmail  - < Accept-Encoding: gzip, deflate
    2013-12-26 13:52:25,578 DEBUG [CaldavConnection-18022] davmail  - < Accept-Charset: utf-8,*;q=0.1
    2013-12-26 13:52:25,578 DEBUG [CaldavConnection-18022] davmail  - < Content-Length: 891
    2013-12-26 13:52:25,578 DEBUG [CaldavConnection-18022] davmail  - < Content-Type: text/xml; charset=utf-8
    2013-12-26 13:52:25,578 DEBUG [CaldavConnection-18022] davmail  - < Depth: 1
    2013-12-26 13:52:25,578 DEBUG [CaldavConnection-18022] davmail  - < Authorization: ********
    2013-12-26 13:52:25,578 DEBUG [CaldavConnection-18022] davmail  - < Connection: keep-alive
    2013-12-26 13:52:25,578 DEBUG [CaldavConnection-18022] davmail  - < Pragma: no-cache
    2013-12-26 13:52:25,578 DEBUG [CaldavConnection-18022] davmail  - < Cache-Control: no-cache
    2013-12-26 13:52:25,578 DEBUG [CaldavConnection-18022] davmail.caldav.CaldavConnection  - < <?xml version="1.0" encoding="UTF-8"?>
    <C:calendar-multiget xmlns:D="DAV:" xmlns:C="urn:ietf:params:xml:ns:caldav"><D:prop><D:getetag/><C:calendar-data/></D:prop><D:href>/public/NDS%20Ferien%202014/Weihnachtsferien%20Niedersachsen-2.EML</D:href><D:href>/public/NDS%20Ferien%202014/Weihnachtsferien%20Niedersachsen.EML</D:href><D:href>/public/NDS%20Ferien%202014/Herbstferien%20Niedersachsen.EML</D:href><D:href>/public/NDS%20Ferien%202014/Sommerferien%20Niedersachsen.EML</D:href><D:href>/public/NDS%20Ferien%202014/Pfingstferien%20Niedersachsen-2.EML</D:href><D:href>/public/NDS%20Ferien%202014/Pfingstferien%20Niedersachsen.EML</D:href><D:href>/public/NDS%20Ferien%202014/Osterferien%20Niedersachsen-2.EML</D:href><D:href>/public/NDS%20Ferien%202014/Osterferien%20Niedersachsen.EML</D:href><D:href>/public/NDS%20Ferien%202014/Winterferien%20Niedersachsen.EML</D:href></C:calendar-multiget>
    2013-12-26 13:52:25,578 DEBUG [CaldavConnection-18022] davmail.exchange.ExchangeSession  - Got session davmail.exchange.dav.DavExchangeSession@1f4a968 from cache
    2013-12-26 13:52:25,594 DEBUG [CaldavConnection-18026] davmail.exchange.ExchangeSession  - Get event subject: Neujahr contentclass: urn:content-classes:appointment href: http://localhost/public/NDS Feiertage 2014/Neujahr-7379765.EML permanentUrl: http://localhost/public/-FlatUrlSpace-/290ce292c73cf44ebe4898e39557f881-5df3/290ce292c73cf44ebe4898e39557f881-6b0e
    2013-12-26 13:52:25,594 DEBUG [CaldavConnection-18022] davmail  - > HTTP/1.1 207 Multi-Status
    2013-12-26 13:52:25,594 DEBUG [CaldavConnection-18022] davmail  - > Server: DavMail Gateway 4.4.0-2198
    2013-12-26 13:52:25,594 DEBUG [CaldavConnection-18022] davmail  - > DAV: 1, calendar-access, calendar-schedule, calendarserver-private-events, addressbook
    2013-12-26 13:52:25,594 DEBUG [CaldavConnection-18022] davmail  - > Date: Thu, 26 Dec 2013 12:52:25 +0000
    2013-12-26 13:52:25,594 DEBUG [CaldavConnection-18022] davmail  - > Expires: Thu, 26 Dec 2013 12:52:25 +0000
    2013-12-26 13:52:25,594 DEBUG [CaldavConnection-18022] davmail  - > Cache-Control: private, max-age=0
    2013-12-26 13:52:25,594 DEBUG [CaldavConnection-18022] davmail  - > Transfer-Encoding: chunked
    2013-12-26 13:52:25,594 DEBUG [CaldavConnection-18022] davmail  - > Content-Type: text/xml;charset=UTF-8
    2013-12-26 13:52:25,594 DEBUG [CaldavConnection-18022] davmail  - > Connection: keep-alive
    2013-12-26 13:52:25,594 DEBUG [CaldavConnection-18022] davmail  - > 
    2013-12-26 13:52:25,594 DEBUG [CaldavConnection-18022] davmail  - Report item 1/9
    2013-12-26 13:52:25,625 DEBUG [CaldavConnection-18022] davmail.exchange.ExchangeSession  - Get event subject: Weihnachtsferien Niedersachsen contentclass: urn:content-classes:appointment href: http://localhost/public/NDS Ferien 2014/Weihnachtsferien Niedersachsen-2.EML permanentUrl: http://localhost/public/-FlatUrlSpace-/290ce292c73cf44ebe4898e39557f881-5dcf/290ce292c73cf44ebe4898e39557f881-5ece
    2013-12-26 13:52:25,688 WARN  [CaldavConnection-18026] davmail.exchange.ExchangeSession  - Invalid message content: Received: by server.fds.local
    

    davmail.log OK

    2013-12-26 14:01:41,287 DEBUG [CaldavConnection-18197] davmail  - Report item 1/9
    2013-12-26 14:01:41,287 DEBUG [CaldavConnection-18198] davmail.exchange.ExchangeSession  - Got session davmail.exchange.dav.DavExchangeSession@d9cb27 from cache
    2013-12-26 14:01:41,303 DEBUG [CaldavConnection-18198] davmail  - > HTTP/1.1 207 Multi-Status
    2013-12-26 14:01:41,303 DEBUG [CaldavConnection-18198] davmail  - > Server: DavMail Gateway 4.4.0-2198
    2013-12-26 14:01:41,303 DEBUG [CaldavConnection-18198] davmail  - > DAV: 1, calendar-access, calendar-schedule, calendarserver-private-events, addressbook
    2013-12-26 14:01:41,303 DEBUG [CaldavConnection-18198] davmail  - > Date: Thu, 26 Dec 2013 13:01:41 +0000
    2013-12-26 14:01:41,303 DEBUG [CaldavConnection-18198] davmail  - > Expires: Thu, 26 Dec 2013 13:01:41 +0000
    2013-12-26 14:01:41,303 DEBUG [CaldavConnection-18198] davmail  - > Cache-Control: private, max-age=0
    2013-12-26 14:01:41,303 DEBUG [CaldavConnection-18198] davmail  - > Transfer-Encoding: chunked
    2013-12-26 14:01:41,303 DEBUG [CaldavConnection-18198] davmail  - > Content-Type: text/xml;charset=UTF-8
    2013-12-26 14:01:41,303 DEBUG [CaldavConnection-18198] davmail  - > Connection: keep-alive
    2013-12-26 14:01:41,303 DEBUG [CaldavConnection-18198] davmail  - > 
    2013-12-26 14:01:41,303 DEBUG [CaldavConnection-18198] davmail  - Report item 1/9
    2013-12-26 14:01:41,319 DEBUG [CaldavConnection-18199] davmail  - Search: SELECT "http://schemas.microsoft.com/exchange/permanenturl","DAV:getetag","urn:schemas:httpmail:subject","http://schemas.microsoft.com/mapi/proptag/x10f3001f","DAV:contentclass","urn:schemas:calendar:instancetype","DAV:displayname" FROM SCOPE('Shallow TRAVERSAL OF "/exchange/fschwengsbier@web.de/Kalender"') WHERE ("DAV:isfolder" = false And "DAV:ishidden" = false And (("http://schemas.microsoft.com/exchange/outlookmessageclass" = 'IPM.Appointment' And ("urn:schemas:calendar:instancetype" = 1 Or ("urn:schemas:calendar:instancetype" = 0 And "urn:schemas:calendar:dtstart" > '2013/09/27 12:01:41'))))) ORDER BY "http://schemas.microsoft.com/mapi/proptag/x0e230003" DESC
    2013-12-26 14:01:41,319 DEBUG [CaldavConnection-18197] davmail.exchange.ExchangeSession  - Get event subject: Weihnachtsferien Niedersachsen contentclass: urn:content-classes:appointment href: http://localhost/public/NDS Ferien 2014/Weihnachtsferien Niedersachsen-2.EML permanentUrl: http://localhost/public/-FlatUrlSpace-/290ce292c73cf44ebe4898e39557f881-5dcf/290ce292c73cf44ebe4898e39557f881-5ece
    2013-12-26 14:01:41,319 DEBUG [CaldavConnection-18198] davmail.exchange.ExchangeSession  - Get event subject: Neujahr contentclass: urn:content-classes:appointment href: http://localhost/public/NDS Feiertage 2014/Neujahr-7379765.EML permanentUrl: http://localhost/public/-FlatUrlSpace-/290ce292c73cf44ebe4898e39557f881-5df3/290ce292c73cf44ebe4898e39557f881-6b0e
    2013-12-26 14:01:41,350 DEBUG [CaldavConnection-18199] davmail  - Found 4 item(s)
    2013-12-26 14:01:41,350 DEBUG [CaldavConnection-18199] davmail  - Search: SELECT "http://schemas.microsoft.com/exchange/permanenturl","DAV:getetag","urn:schemas:httpmail:subject","http://schemas.microsoft.com/mapi/proptag/x10f3001f","DAV:contentclass","urn:schemas:calendar:instancetype","DAV:displayname" FROM SCOPE('Shallow TRAVERSAL OF "/exchange/fschwengsbier@web.de/Aufgaben"') WHERE ("DAV:isfolder" = false And "DAV:ishidden" = false And (("http://schemas.microsoft.com/exchange/outlookmessageclass" = 'IPM.Task' And ("http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-c000-000000000046}/0x810f" is null Or "http://schemas.microsoft.com/mapi/id/{00062003-0000-0000-c000-000000000046}/0x810f" > '2013/09/27 12:01:41')))) ORDER BY "http://schemas.microsoft.com/mapi/proptag/x0e230003" DESC
    2013-12-26 14:01:41,365 DEBUG [CaldavConnection-18199] davmail  - Found 0 item(s)
    2013-12-26 14:01:41,381 DEBUG [CaldavConnection-18199] davmail  - Search: SELECT "http://schemas.microsoft.com/exchange/permanenturl","urn:schemas:httpmail:unreadcount","DAV:objectcount","DAV:nosubs","http://schemas.microsoft.com/mapi/proptag/x67510003","DAV:getlastmodified","DAV:hassubs","http://schemas.microsoft.com/exchange/outlookfolderclass","http://schemas.microsoft.com/repl/contenttag","DAV:displayname" FROM SCOPE('Shallow TRAVERSAL OF "/exchange/fschwengsbier@web.de/Kalender"') WHERE ("DAV:isfolder" = true And "DAV:ishidden" = false And "http://schemas.microsoft.com/exchange/outlookfolderclass" = 'IPF.Appointment') ORDER BY "http://schemas.microsoft.com/mapi/proptag/x0e230003" DESC
    2013-12-26 14:01:41,443 DEBUG [CaldavConnection-18198] davmail.exchange.ExchangeSession  - Vcalendar body received from server:
    

    Regards, happy Holidays and a very good new year
    Frank

     
    Last edit: fschwengsbier 2013-12-27
    • fschwengsbier
      fschwengsbier
      2013-12-31

      I think I found the resolution by myself:
      According to http://sourceforge.net/p/davmail/patches/22/ i've double-clicked "davmail.jar" and it works like davmail but runs as a service. the command-line in windows would be "java -jar davmail.jar". this cmd could be used as a parameter to sc. so i'm able to run davmail as a windows service. It seems that winrun4j has some problems...

      happy new year :thumbup:

       
  • fschwengsbier
    fschwengsbier
    2014-01-02

    hmm, it's not easy to run java as a windows service. the above idea doesn't work. :(
    so i startet to play with "tanuki java service wrapper" but it's very difficult to configure.
    maybe the best is that Mickael throws an eye on the DavMailService.exe

    Regards
    Frank

     
  • Well, davmailservice.exe and davmail.exe should definitely have the same behaviour.

    Note that davmail.exe uses .davmail.properties in user home directory, davmailservice.exe uses davmail.properties in current folder

    There is usually at lease one difference between config files: davmail.server=true

    You could try to change WIRE logging level to DEBUG to get more details, however it looks like one instance is in EWS mode while the other is in WebDav, could you please check this (in properties files and at the beginning of the log file) ?

     
  • fschwengsbier
    fschwengsbier
    2014-01-04

    Mickael, thank you for your response. I've checked both config's and enabled WIRE logging=DEBUG. But that doesn't bring success. Can you please check the config's and log's under https://www.dropbox.com/sh/emve1wtnqco6eq5/KvpygyLypa/DavMail ?

     
  • fschwengsbier
    fschwengsbier
    2014-01-09

    Hi Mickael,

    what can I do to move you to an answer? paypal? It's a little bit urgend since I've planned to use your tool as a layer between our upcoming Exchange server and the users who don't won't to use Outlook.

    Regards
    Frank

     
  • Well, I indeed accept Paypal donations :-)

    Anyway, this does not look like a DavMail settings issue: initial session creation is working as expected.

    However, there is something wrong with MIME message parsing:
    davmail.exchange.ExchangeSession - Invalid message content

    I checked message content in a unit test and it's perfectly right
    => we now need to find a difference between normal and service mode

    I found a classpath difference in exe ini files, we should probably investigate this first

     
  • Updated davmailservice.exe with full CLASSPATH definition

     
    Attachments
  • fschwengsbier
    fschwengsbier
    2014-01-09

    "project is on the right path" :)

    Thank you Mickael,
    let me know if I can help you

    Regards
    Frank

     
  • fschwengsbier
    fschwengsbier
    2014-01-09

    I'm sorry but I must tell you that davmailservice.exe dies with error 7000. Even if I restartet the server.

     
  • fschwengsbier
    fschwengsbier
    2014-01-15

    refresh

     
  • Please don't forget this is an opensource project :-)

    Anyway, can you put the attached file in davmailservice.exe directory and check again ?

     
    Attachments
  • Did it work ?

     
  • fschwengsbier
    fschwengsbier
    2014-02-03

    hi mickael,

    yes and no. yes - the service starts and keep running. no - the service does not deliver the calendars.

    same with your new version.

    but i'm able to run davmail.exe as a service with the help from http://sourceforge.net/projects/runasservice/. now davmail runs like a windows service and does deliver the calendars.