Unable to complete GetMsgRequest 8.8.15

Have a great idea for extending Zimbra? Share ideas, ask questions, contribute, and get feedback.
DocRockulus
Posts: 3
Joined: Thu Sep 17, 2020 3:15 pm

Unable to complete GetMsgRequest 8.8.15

Postby DocRockulus » Thu Sep 17, 2020 3:33 pm

I'm using python-zimbra, and I'm reviewing the documentation listed here:
https://files.zimbra.com/docs/soap_api/8.8.15/api-reference/zimbraMail/GetMsg.html#tbl-GetMsgRequest-m-id
In order to attempt to pull the contents of an individual message, given it's ID.

I'm able to authenticate correctly:

Code: Select all

usr_token = auth.authenticate(
    url,
    'fakeemail@fake.email',
    '**********************************************************'
)


and make other requests:

Code: Select all

search_request = comm.gen_request(token=usr_token)
    search_request.add_request(
        'SearchRequest',
        {
            'query': 'in:inbox',
            'limit': 1000,
            'resultMode' : 'IDS'
        },
        'urn:zimbraMail'
    )
    search_response = comm.send_request(search_request)


However when I make a "GetMsgRequest":

Code: Select all

msg_request.add_request(
    'GetMsgRequest',
       {
          'm': {
             'id': "-3981"
          }
       },
'urn:zimbraMail'

even given a msg ID that I'm certain exists (based on the output of the above search request) I still get a "no such message" fault.

Code: Select all

{'Fault': {'Code': {'Value': 'soap:Sender'}, 'Reason': {'Text': 'no such message: -3981'}, 'Detail': {'Error': {'Code': 'mail.NO_SUCH_MSG', 'Trace': 'qtp366590980-679210:1600355135420:05591e196a69dc85', 'a': {'n': 'itemId', 't': 'IID', '_content': '-3981'}}}}}

Am I formatting my request incorrectly? I think that's likely the case but I'm not sure how to ammend it to be correct.


User avatar
jeastman
Zimbra Employee
Zimbra Employee
Posts: 33
Joined: Tue Mar 29, 2016 1:36 pm

Re: Unable to complete GetMsgRequest 8.8.15

Postby jeastman » Thu Sep 17, 2020 5:01 pm

I am in no way familiar with the python-zimbra you are using, but it looks like the ID you are specifying may be a Conversation ID and not a Message ID (note the negative value).

Maybe that helps?

Regards,
John Eastman
DocRockulus
Posts: 3
Joined: Thu Sep 17, 2020 3:15 pm

Re: Unable to complete GetMsgRequest 8.8.15

Postby DocRockulus » Thu Sep 17, 2020 5:44 pm

Yeah, that seems like it was the cause of the issue.

Oddly, when I do a search and include types:message it still produces results that seem to be both messages and conversations:

Code: Select all

{'id': '-4195', 'sf': '1578312230000'}
{'id': '4199', 'sf': '1578305474000'}
{'id': '-4203', 'sf': '1578297298000'}

and to further confuse things, when I do a GetMsgRequest on an item with a negative value, it fails, but if I take the same value and strip the "-" I am able to resolve the appropriate message.
User avatar
jeastman
Zimbra Employee
Zimbra Employee
Posts: 33
Joined: Tue Mar 29, 2016 1:36 pm

Re: Unable to complete GetMsgRequest 8.8.15

Postby jeastman » Thu Sep 17, 2020 8:12 pm

I believe a negative value is indicating that the message is not part of a conversation. So, it is simply a negative version of the message ID.

Regards,
John Eastman

Return to “Developers”

Who is online

Users browsing this forum: No registered users and 2 guests