| Author |  | 
      
        | i3000 Newbie
 
  
 
 Joined: 21 October 2010
 Location: Australia
 Online Status: Offline
 Posts: 9
 | 
          Hi,
           | Posted: 21 May 2012 at 7:41pm | IP Logged |   |  
           | 
 |  
 I have been trying to search GMail by MessageId with IMAP to no success.  I am obviously doing something wrong.  I have tried
 
 imap.Search(true, "UID SEARCH X-GM-MSGID 13584bbb8fc79c9c", System.Text.Encoding.UTF8.WebName)
 
 imap.Search(true, "UID SEARCH X-GM-MSGID 13584bbb8fc79c9c", null)
 
 These fail with "could not parse command"
 
 imap.Search(true, MailBee.ImapMail.ImapUtils.GmailSearch("UID SEARCH X-GM-MSGID 13584bbb8fc79c9c"), System.Text.Encoding.UTF8.WebName)
 
 This just does nothing...
 
 I couldn't find an example anywhere - any advice appreciated,
 
 Paul C
 
 
 
 
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          GMail Message-ID is a 64-bit unsigned integer. 13584bbb8fc79c9c is not.
           | Posted: 22 May 2012 at 1:49am | IP Logged |   |  
           | 
 |  
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          Well, 13584bbb8fc79c9c can be considered hexadecimal integer but GMail (and IMAP at all) does not support hexadecimal numbers.
           | Posted: 22 May 2012 at 1:50am | IP Logged |   |  
           | 
 |  
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | i3000 Newbie
 
  
 
 Joined: 21 October 2010
 Location: Australia
 Online Status: Offline
 Posts: 9
 | 
          Thank Alex - I got the same behaviour using the decimal equivalent 1393947353372434321
           | Posted: 22 May 2012 at 1:55am | IP Logged |   |  
           | 
 |  
 i.e.
 
 imap.Search(true, "UID SEARCH X-GM-MSGID 1393947353372434321", System.Text.Encoding.UTF8.WebName)
 
 Is the syntax correct?
 
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          Remove UID SEARCH from the search string. Search command itself inserts this into the IMAP request.
           | Posted: 22 May 2012 at 2:14am | IP Logged |   |  
           | 
 |  
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | i3000 Newbie
 
  
 
 Joined: 21 October 2010
 Location: Australia
 Online Status: Offline
 Posts: 9
 | 
          Great thanks Alex, the following worked
           | Posted: 22 May 2012 at 2:48am | IP Logged |   |  
           | 
 |  
 imap.Search(true, "X-GM-MSGID 1393947353372434321", null)
 | 
       
        | Back to Top |     | 
       
       
        |  |