How to Get Zimbra Message ID (Not Postfix Message ID)

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
DaveSmash
Posts: 6
Joined: Tue Mar 06, 2018 1:44 am

How to Get Zimbra Message ID (Not Postfix Message ID)

Postby DaveSmash » Tue Mar 06, 2018 2:10 am

Hello. I am trying to integrate with a third-party app. I would like to notify the app of new incoming and outgoing messages, and include the Zimbra Message ID for direct linking purposes, e.g., https://mydomain.com:7070/home/john.doe/?id=123. I am trying to use zmmsgtrace to log recent messages, but it only gives me the Postfix message ID (like 23742137490234.123498723094721904.21342134.JavaMail.Zimbra@mydomain.com), not the Zimbra message ID (like 123). I have also tried "tail -f ~/log/mailbox.log" to monitor for sent/received notifications, but that log also gives the Postfix ID instead of the Zimbra ID. The only way that I know how to find the Zimbra ID is manually, by opening the webmail client, right clicking the message, and clicking "show original" to see what ID is used in the URL.

Is there a way to look up the Zimbra message ID if you know the Postfix Message ID, or can somebody recommend a better approach to solving this problem? Thanks in advance!


DaveSmash
Posts: 6
Joined: Tue Mar 06, 2018 1:44 am

Re: How to Get Zimbra Message ID (Not Postfix Message ID)

Postby DaveSmash » Wed Mar 07, 2018 3:08 pm

I still welcome any advice or feedback, but I am working through a solution. For anyone else looking for a solution to this problem, it looks like Zimbra IDs are included with the response from the REST API when you get a folder's contents (e.g., http://mydomain.com/home/john.doe/Inbox/?fmt=json). As far as knowing when to grab the data, you can poll at a regular interval, or presumably you could monitor the logs as I was attempting to do in order to see when there is new content in the inbox or the sent messages folder.
User avatar
msquadrat
Advanced member
Advanced member
Posts: 165
Joined: Mon Oct 14, 2013 10:09 am

Re: How to Get Zimbra Message ID (Not Postfix Message ID)

Postby msquadrat » Wed Mar 07, 2018 4:42 pm

You could also create a WaitSet via the SOAP API which is essentially a long poll and is used eg. by the ZCO as well: https://files.zimbra.com/docs/soap_api/ ... itSet.html

There are a few other ways as well.
DaveSmash
Posts: 6
Joined: Tue Mar 06, 2018 1:44 am

Re: How to Get Zimbra Message ID (Not Postfix Message ID)

Postby DaveSmash » Tue Apr 10, 2018 5:53 pm

The waitset looks like a better approach. Thanks for the idea! I will work it into code ASAP.

Return to “Developers”

Who is online

Users browsing this forum: No registered users and 4 guests