Navigation

    Kopano
    • Register
    • Login
    • Search
    • Categories
    • Get Official Kopano Support
    • Recent
    Statement regarding the closure of the Kopano community forum and the end of the community edition

    dump msg from MAPI item not working

    Kopano Groupware Core
    3
    4
    307
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • marlemion
      marlemion last edited by

      I am trying to save an msg file from a MAPI item:

      #!/usr/bin/env python
      
      import kopano
      server = kopano.Server(server_socket='http://XXXX:237/kopano', auth_user='XXX, auth_pass='XXXX')
      store = server.user('mail').store
      store = store.folder('Inbox')
      
      for mail in store:
              if mail.entryid == 'XXXXXXXX':
                              msgfile = '/tmp/test.MSG'
                              f = open(msgfile, 'wb')
                              mail.dump(f,attachments=True,archiver=True)
                              f.close()
      

      This gives a file called test.MSG which is also binary:

      file test.MSG
      test.MSG: 8086 relocatable (Microsoft)
      

      But when I try to open it with Outlook, it says that I do not have enough permissions to open it. This is independent of the permissions and the location of the file (I have tried al lot). Alos other tools like msgconvert seem not to be able to read the file.

      What might be wrong?

      Thanks!

      1 Reply Last reply Reply Quote 0
      • jelly
        jelly last edited by jelly

        python-kopano does not support saving items to Microsoft’s MSG format documented here. If there is a reasonable and up to date Python library for it, it would be interesting to implement.

        fbartels 1 Reply Last reply Reply Quote 0
        • fbartels
          fbartels Kopano @jelly last edited by

          @jelly said in dump msg from MAPI item not working:

          python-kopano does not support saving items to Microsoft’s MSG format

          But what does work is exporting to eml. A sample script for this is at https://stash.kopano.io/projects/KC/repos/kopanocore/browse/swig/python/kopano/scripts/rfcdump.py

          Regards Felix

          Resources:
          https://kopano.com/blog/how-to-get-kopano/
          https://documentation.kopano.io/
          https://kb.kopano.io/

          Support overview:
          https://kopano.com/support/

          1 Reply Last reply Reply Quote 0
          • marlemion
            marlemion last edited by

            Thanks for the feedback. I now dump to eml and reimport to MSG via MSGConverter and wine (subprocess). Not nice, but it works.

            1 Reply Last reply Reply Quote 0
            • First post
              Last post