Archived Forum Post

Index of archived forum posts

Question:

Search by message-id in Yahoo imap.

Nov 25 '13 at 11:04

Guys, I have a strange problem. When I do a search for the message-id in Gmail works, not on Yahoo.

I've also tested using SendRawCommand.

An example (iOS): CkoMessageSet *messageSet = [imap Search: @"HEADER Message-ID ", message.UDDI] bUid: YES];

What do I do? Must also run on Yahoo.

Thanks!


Answer

Find out what happened by getting information from all the usual places:

1) imap.LastErrorText (turn on verbose logging prior to calling Search to get more information in LastErrorText).

2) imap.SessionLog (make sure to turn on session logging by setting imap.KeepSessionLog = true beforehand).


Answer

In fact, I've done it. See the header of the message and the log of search:

HEADER MESSAGE ON SERVER:

From Rodrigo Junqueira Mon Jun 10 09:05:29 2013
X-Apparently-To: rodrigo.junca@yahoo.com.br via 98.138.211.251; Mon, 10 Jun 2013 16:05:30 +0000
Return-Path: <rodrigo.junca@yahoo.com.br>
Received-SPF: none (domain of yahoo.com.br does not designate permitted sender hosts)
 anVuY2FAZ21haWwuY29tPiBUbzogcm9kcmlnby5qdW5jYUB5YWhvby5jb20u
 YnIgU2VudDogU2F0dXJkYXksIEp1bmUgOCwgMjAxMyAxOjE1IFBNIFN1Ympl
 Y3Q6IHRlc3RlIFJvZHJpZ28gSnVucXVlaXJhIAEwAQEBAQN0ZXh0L3BsYWlu
 AwMwAgN0ZXh0L2h0bWwDAzI-
X-YMailISG: pgRgoZ0WLDuoWhu3ku01KkspGzXHNR5o_1ZUHlp61YFejz8B
 IJAxZbZC0iYcaiuNA2gV9CreRIhQjrjJNfqNpTIVdsK_e.pj0HJMlXL0z5IR
 a1pBa55z3etKBRJgnG9ZW7L9QnokXqvmd4orKxMAKP30K9O_0g3BdCBvu_Bq
 IbxORz4_a9ikzTHb1m5FgeNSzmqWCXqgsDJkdZNTSl0T7Y2M1ypNS2tWyLve
 idHntR7PEA.Z9k_IJshG0ZTevx88JqD1G_H36VGJzOc02Kt6iqyqM2lnekVa
 SwJgDIKpkbFoTitKUUHL0nfG.7BRgiUilXMl7LWuawm1DuPsXkrgnC8Plp1U
 En6eTWX.RPypDcawFJWUY7XxBjlJKyCYc9W9HFcu9zXCUmk7WE2uMepJkrCs
 tnwd1_GJWMPpTyCVmg8cFrhf3gtAYFtEtuPZx.1EwzzMI95uuPCVfq.xJvYi
 bEQ5k8T6UccXrpTpce_VZiEAAfxBvy6zuForGBc1dheE0axLNtnd7o1yiR3s
 X9IwWUprkaMc9S4WbrQ2dUPDgoaiQgMja7.3_eolzpHKeQrsOMZxNOcmyO4s
 rTti7BdZMziakKiUEj5u3WqoW..8EYwcjqnoP3miTz.K3johdbNh0J4ZmrWQ
 aZDjVWBbD3u6X8eQuQDedcx68zaOm4fPSy3d1CotgMpKrjjmOX0fqC5tjg91
 SUisdMyxvyvsjYEy7hAHl.Jt.R1buoUMzQNjSGTsX18cQaEX9D5D72ozTJn.
 TScsrpynnc9eOgL7nOoc51VjxRJqxsg.onc6QTWIZXuAHrGOUvOguXkLMd91
 L1vXXgsfP44KDuNhPI.zmA5u0vqKcttAWyP2jSrAUZWEMiIBBeEXWYE9fRZL
 grjXPJNI5Q.VJQM0Q5u5YP6r4p_77dFN.7EkPcdZAplcEJlE1BgoX1inqN.l
 8jEPAKxaEVMCOIp8CLQ62lvivnSEmLvpHKI9aP9PkQ--
X-Originating-IP: [98.138.90.152]
Authentication-Results: mta1424.mail.gq1.yahoo.com  from=yahoo.com.br; domainkeys=pass (ok);  from=yahoo.com.br; dkim=pass (ok)
Received: from 127.0.0.1  (EHLO nm4-vm2.bullet.mail.ne1.yahoo.com) (98.138.90.152)
  by mta1424.mail.gq1.yahoo.com with SMTP; Mon, 10 Jun 2013 16:05:30 +0000
Received: from [98.138.226.180] by nm4.bullet.mail.ne1.yahoo.com with NNFMP; 10 Jun 2013 16:05:29 -0000
Received: from [98.138.89.161] by tm15.bullet.mail.ne1.yahoo.com with NNFMP; 10 Jun 2013 16:05:29 -0000
Received: from [127.0.0.1] by omp1017.mail.ne1.yahoo.com with NNFMP; 10 Jun 2013 16:05:29 -0000
X-Yahoo-Newman-Property: ymail-3
X-Yahoo-Newman-Id: 884624.20449.bm@omp1017.mail.ne1.yahoo.com
Received: (qmail 51522 invoked by uid 60001); 10 Jun 2013 16:05:29 -0000
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com.br; s=s1024; t=1370880329; bh=Ow+MIWIjxgoGXoEyOxdwKX+3Kz2pG6oXohZ6uvbXoVE=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type; b=57ZPjG/5ixzKlnHeE0yr8yv6Dv/vTglYZ1sa8xLbmQECnXOKF82MqXqBumfXuZQHvCEN++prouNlDuPJLFQFDR+e0Bvf876ZDh54wvaV8KSj3vdXwoJ6zMaVSqbQ48uzvbqizsn2gwdSJG9ouxRzHd1agBidNY4HBOLIlNbjeEM=
DomainKey-Signature:a=rsa-sha1; q=dns; c=nofws;
  s=s1024; d=yahoo.com.br;
  h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:Cc:In-Reply-To:MIME-Version:Content-Type;
  b=LrSdyEfOQolxAM6DiEhzWP/IttAK5lhyARTzjBpQRNRfN37Mti61D4eIEsVj9yOFGKLaFf4iX9r+si1mFuflxfLJMP6DdAK11A97/t5MVF4WJF3pqpip0gw8L5Aj+4ThCKUSOdjyD5dvoc4IY8p5K7VG9s7mJQIgGGsyfjweawg=;
X-YMail-OSG: yyyVPgEVM1kvxMh9OhD3umM9122wHxt1FvuriZbxKbVzIXq
 BfNQ4QwopuTxETeDxy3WFDKqiRq6xQA1pl0rVKlvNbeduAywk.CPG4JThHdf
 mmmsXYaYiOKwA6VqbyZ6sSZmKhfrrLDIkB.wvt4BRI36ogDOn98Z8X1CuC0p
 Ow4dIkR9kHq8Mox_T7h67WAS64TLkeV7v4lCZrUAaYNeQDD2PoFe_cuD9OET
 x3WBMzA78FPND7qnUt1i31SZw612jtKwnjdmYG97lG1cIkP4JDFnHvWNI_9m
 7VeXAycMTOncDQHEel3PW8.VJycK17G4mfWU6E53rFNPOmAEzku.Ky_atIP4
 Wzh.D7cdOB315pxzYTwAYr5vjwg2QMae8_ftq_BxEetXU0cX8hSpA3a.VqNL
 FqCrCguZYlLtJBfRXm7Bte_spNEz2yv8E_9idPitsQ8ItHZfqe400LBZEZgD
 In4N1YOEqbq8SF2yBuruc1MI7zCFfITW8fll6Q3IbRoZ6y8FtEw--
Received: from [189.60.98.20] by web122905.mail.ne1.yahoo.com via HTTP; Mon, 10 Jun 2013 09:05:29 PDT
X-Mailer: YahooMailWebService/0.8.146.552
References: <CAH=hLiBr=7xY+0KU1gG5tPd8tbXZmKeYPVfYZU=tQYRWS-NeNg@mail.gmail.com>
Message-ID: <1370880329.49663.YahooMailNeo@web122905.mail.ne1.yahoo.com>
Date: Mon, 10 Jun 2013 09:05:29 -0700 (PDT)
From: Rodrigo Junqueira <rodrigo.junca@yahoo.com.br>
Reply-To: Rodrigo Junqueira <rodrigo.junca@yahoo.com.br>
Subject: Re: teste
To: Rodrigo Junqueira <rodrigo.junca@gmail.com>
Cc: "rodrigo.junca@yahoo.com.br" <rodrigo.junca@yahoo.com.br>
In-Reply-To: <CAH=hLiBr=7xY+0KU1gG5tPd8tbXZmKeYPVfYZU=tQYRWS-NeNg@mail.gmail.com>
MIME-Version: 1.0
Content-Type: multipart/alternative; boundary="1716467154-697685297-1370880329=:49663"
Content-Length: 1810

ChilkatLog:   Search:
    DllDate: Dec 21 2012
    UnlockPrefix: xxxxxxxxxx
    Username: xxxxxxxxx
    Architecture: Little Endian; 32-bit
    Language: IOS Objective-C
    VerboseLogging: 1
    criteria: HEADER Message-ID <1370880329.49663.YahooMailNeo@web122905.mail.ne1.yahoo.com>
    criteriaUtf8QP: HEADER Message-ID <1370880329.49663.YahooMailNeo@web122905.mail.ne1.yahoo.c= om>
    connectedTo: imap.mail.yahoo.com
    selectedMailbox: INBOX
    bUid: 1
    UidSearch:
      command: aaae UID SEARCH HEADER Message-ID <1370880329.49663.YahooMailNeo@web122905.mail.ne1.yahoo.com>
      ImapCmdSent: aaae UID SEARCH HEADER Message-ID <1370880329.49663.YahooMailNeo@web122905.mail.ne1.yahoo.com>
      getCompleteResponse:
        ImapCmdResp: * SEARCH
        ImapCmdResp: aaae OK UID SEARCH completed
      --getCompleteResponse
    --UidSearch
    numMessages: 0
    Success.   --Search
--ChilkatLog

Answer

Hello people,

PLEASE HELP !!!!!!!!!!

I continue with this problem and do not know what else to do. Please help me. I need the SEARCH HEADER MESSAGE-ID work in Yahoo IMAP.

The Message-ID exists. Follows the log:

imap.LastErrorText

ChilkatLog:   Search:
    DllDate: Aug 15 2013
    ChilkatVersion: 9.4.1.42
    UnlockPrefix: xxxxxxxxx
    Architecture: Little Endian; 32-bit
    Language: IOS Objective-C
    VerboseLogging: 1
    criteria: HEADER Message-ID <3121DA0BC2256349AEEF8457E40CFF6ADE8C96@kalbar-mail01.pusat.corp.pln.co.id>
    criteriaUtf8QP: HEADER Message-ID <3121DA0BC2256349AEEF8457E40CFF6ADE8C96@kalbar-mail01.pus= at.corp.pln.co.id>
    connectedTo: imap.mail.yahoo.com
    selectedMailbox: INBOX
    bUid: 1
    Command: aaae UID SEARCH HEADER Message-ID <3121DA0BC2256349AEEF8457E40CFF6ADE8C96@kalbar-mail01.pusat.corp.pln.co.id>
    ImapCmdSent: aaae UID SEARCH HEADER Message-ID <3121DA0BC2256349AEEF8457E40CFF6ADE8C96@kalbar-mail01.pusat.corp.pln.co.id>
    getCompleteResponse:
      rcvUntilMatchStringQP:

      dbReceived0: 
      tlsRecvAppData:
        readIncomingTls_appData:
          readTlsRecord:
            TLS 1.0, Application, sz=61
            macLen: 20
            decryptedMsg: [* SEARCH=20 aaae OK UID SEARCH completed ]
          --readTlsRecord
        --readIncomingTls_appData
        rcvAppData: success, nReceived = 41
      --tlsRecvAppData
      startIdx: 0
      dbReceived: * SEARCH=20 aaae OK UID SEARCH completed

      Found match string.
      ImapCmdResp: * SEARCH
      rcvUntilMatchStringQP:

      dbReceived0: aaae OK UID SEARCH completed

      Found match string in already buffered data.
      ImapCmdResp: aaae OK UID SEARCH completed
    --getCompleteResponse
    numMessages: 0
    Success.   --Search

imap.SessionLog

----INFO---- Connecting to IMAP server at imap.mail.yahoo.com:993
----IMAP RESPONSE----
* OK [CAPABILITY IMAP4rev1 ID NAMESPACE X-ID-ACLID UIDPLUS LITERAL+ CHILDREN XAPPLEPUSHSERVICE XYMHIGHESTMODSEQ AUTH=PLAIN AUTH=LOGIN AUTH=XYMCOOKIE AUTH=XYMECOOKIE AUTH=XYMCOOKIEB64 AUTH=XYMPKI] IMAP4rev1 imapgate-0.7.68_14.446672 imap425.mail.bf1.yahoo.com
----IMAP REQUEST---- aaab ID ("GUID" "1")
----IMAP RESPONSE----
* ID ("name" "imapgate" "version" "0.7.68_14.446672" "support-url" "http://help.yahoo.com/") aaab OK completed
----IMAP REQUEST---- aaac LOGIN "xxxxxr" "xxxxxx"
----IMAP RESPONSE---- aaac OK AUTHENTICATE completed - Mailbox size in bytes is 75826
----IMAP REQUEST---- aaad SELECT "INBOX"
----IMAP RESPONSE----
* 6 EXISTS
* 0 RECENT
* OK [UIDVALIDITY 1370706436] UIDs valid
* OK [UIDNEXT 53] Predicted next UID
* FLAGS (\Answered \Deleted \Draft \Flagged \Seen $Forwarded $Junk $NotJunk)
* OK [PERMANENTFLAGS (\Answered \Deleted \Draft \Flagged \Seen $Forwarded $Junk $NotJunk)] Permanent flags
* OK [HIGHESTMODSEQ 5949471140316577792] aaad OK [READ-WRITE] SELECT completed; now in selected state
----IMAP REQUEST---- aaae UID SEARCH HEADER Message-ID <3121DA0BC2256349AEEF8457E40CFF6ADE8C96@kalbar-mail01.pusat.corp.pln.co.id>
----IMAP RESPONSE----
* SEARCH  aaae OK UID SEARCH completed

Answer

The 1st argument to the Search method is the exact criteria string passed to the IMAP server. See http://tools.ietf.org/html/rfc3501#section-6.4.4

To search on a header, the criteria should look like this:

      HEADER <field-name> <string>
         Messages that have a header with the specified field-name (as
         defined in [RFC-2822]) and that contains the specified string
         in the text of the header (what comes after the colon).  If the
         string to search is zero-length, this matches all messages that
         have a header line with the specified field-name regardless of
         the contents.

Technically, the format of "<string>" is that it should be double-quoted. Therefore, make sure to enclose the value of the message ID in double-quotes.


Answer

Hello, thanks for the quick response. I had read the RFC there and also put double quotes, but as you can see below does not work. For Gmail works for iCloud works. I really need support Yahoo accounts.

What can I do?

Thank you.

ChilkatLog:
  Search:
    DllDate: Aug 15 2013
    ChilkatVersion: 9.4.1.42
    UnlockPrefix: xxxxxxx
    Architecture: Little Endian; 32-bit
    Language: IOS Objective-C
    VerboseLogging: 1
    criteria: HEADER Message-ID "<3121DA0BC2256349AEEF8457E40CFF6ADE8C96@kalbar-mail01.pusat.corp.pln.co.id>"
    criteriaUtf8QP: HEADER Message-ID "<3121DA0BC2256349AEEF8457E40CFF6ADE8C96@kalbar-mail01.pu=
sat.corp.pln.co.id>"
    connectedTo: imap.mail.yahoo.com
    selectedMailbox: Sent
    bUid: 1
    Command: aaag UID SEARCH HEADER Message-ID "<3121DA0BC2256349AEEF8457E40CFF6ADE8C96@kalbar-mail01.pusat.corp.pln.co.id>"
    ImapCmdSent: aaag UID SEARCH HEADER Message-ID "<3121DA0BC2256349AEEF8457E40CFF6ADE8C96@kalbar-mail01.pusat.corp.pln.co.id>"
    getCompleteResponse:
      rcvUntilMatchStringQP:

      dbReceived0: 
      tlsRecvAppData:
        readIncomingTls_appData:
          readTlsRecord:
            TLS 1.0, Application, sz=61
            macLen: 20
            decryptedMsg: [* SEARCH=20
aaag OK UID SEARCH completed
]
          --readTlsRecord
        --readIncomingTls_appData
        rcvAppData: success, nReceived = 41
      --tlsRecvAppData
      startIdx: 0
      dbReceived: * SEARCH=20
aaag OK UID SEARCH completed

      Found match string.
      ImapCmdResp: * SEARCH
      rcvUntilMatchStringQP:

      dbReceived0: aaag OK UID SEARCH completed

      Found match string in already buffered data.
      ImapCmdResp: aaag OK UID SEARCH completed
    --getCompleteResponse
    numMessages: 0
    Success.
  --Search
--ChilkatLog

Answer

The Chilkat Imap.Search method passes the search criteria directly to the IMAP server as-is. The answer is that I don't know anymore than you or anyone else why the Yahoo mail server would behave differently.

Your question is really about the Yahoo mail server, and it's not something I know the answer to. It's not a Chilkat question because you already know that you have complete control over what is passed to the IMAP mail server, you can examine the exact command sent and the exact response received, and you can examine the IMAP protocol specifications (RFC) for the SEARCH command. There is nothing else I can really provide here. I'm not the Yahoo software engineer that implemented their IMAP mail server. The best you (or I) can do is to experiment to see if anything works. For example, if you pass "A" for the message ID substring, would the Yahoo mail server respond with all emails having the letter "A" in the Message-ID header? Maybe the < and > chars are causing problems? Maybe the "@" char causes a problem? Experiment to see what is possible..