| Author |  | 
      
        | loredano Newbie
 
  
  
 Joined: 11 April 2018
 Location: Italy
 Online Status: Offline
 Posts: 15
 | 
          Hi,
           | Posted: 11 June 2019 at 2:42am | IP Logged |   |  
           | 
 |  Is it possible search for a value of custom Header using the Imap.Search Method (Boolean, String, String)?
 
 In other words we send a pec mail and assign a MessageId to it; the provider use the value of MessageId and assign it to an header "XRiferimentoMessageId" in the replay mail to the sent mail.
 So I have to search on the server (without download....) the replay mail by XRiferimentoMessageId (in msg.Headers["XRiferimentoMessaggeId"] =  MessageId,that I know because I have generate it).
 
 Regards
 Loredano
 | 
       
        | Back to Top |     | 
       
       
        |  | 
        | Alex AfterLogic Support
 
  
  
 Joined: 19 November 2003
 Online Status: Offline
 Posts: 2207
 | 
          Hi,
           | Posted: 11 June 2019 at 3:24am | IP Logged |   |  
           | 
 |  
 Yes, you can use searchCondition (second parameter of Search method) to something like "HEADER MESSAGE-ID <1234567890@domain>".
 
 Will this work or not, depends on whether the server internally support this or not. For instance, Gmail does support this (I just checked). But there is no guarantee that any arbitrary server will support this.
 
 Also, be sure to specify the entire Message-ID value. Substring (e.g "HEADER MESSAGE-ID 1234567890") won't work.
 
 Regards,
 Alex
 | 
       
        | Back to Top |     | 
       
       
        |  |