Gmail imap search does not get all messages.



I am trying to use imaplib with gmail. I am finding however that with
the gmail server imaplib.search does not give the correct answer. See
the below traces (k is a server a my department, i is gmail).
k has 6 messages in the INBOX
i has 3 messages in the INBOX

However i.search(None, "ALL")
only gives as answer "1 2", missing the third message.

Any suggestions about what I might be doing wrong? Or is this a known
issue? I couldn't find anything by googling, but maybe I am using the
wrong search terms.

Best,
Bart



k.select()
05:41.11 > FEIC2 SELECT INBOX
05:41.16 < * FLAGS (\Answered \Flagged \Deleted \Seen \Draft MATH
$Forwarded $label5 $label1 $label4 $label2 $label3 NonJunk $NotJunk
$Junk JunkRecorded)
05:41.16 < * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen
\Draft MATH $Forwarded $label5 $label1 $label4 $label2 $label3 NonJunk
$NotJunk $Junk JunkRecorded \*)] Flags permitted.
05:41.16 < * 6 EXISTS
05:41.16 < * 0 RECENT
05:41.16 < * OK [UIDVALIDITY xXxXxXxXxX] UIDs valid
05:41.16 < * OK [UIDNEXT xXxXxXxX] Predicted next UID
05:41.16 < FEIC2 OK [READ-WRITE] Select completed.
('OK', ['6'])
k.search(None,"ALL")
05:52.82 > FEIC3 SEARCH ALL
05:52.86 < * SEARCH 1 2 3 4 5 6
05:52.86 < FEIC3 OK Search completed.
('OK', ['1 2 3 4 5 6'])

i.select()
10:23.16 > DKNG10 SELECT INBOX
10:23.30 < * FLAGS (\Answered \Flagged \Draft \Deleted \Seen)
10:23.30 < * OK [PERMANENTFLAGS (\Answered \Flagged \Draft \Deleted
\Seen \*)]
10:23.30 < * OK [UIDVALIDITY xXxXxXxXx]
10:23.30 < * 3 EXISTS
10:23.30 < * 0 RECENT
10:23.30 < * OK [UNSEEN 3]
10:23.30 < * OK [UIDNEXT 7]
10:23.31 < DKNG10 OK [READ-WRITE] INBOX selected. (Success)
('OK', ['3'])
i.search(None,"ALL")
10:17.30 > DKNG9 SEARCH ALL
10:17.44 < * SEARCH 1 2
10:17.44 < DKNG9 OK SEARCH completed (Success)
('OK', ['1 2'])
.



Relevant Pages

  • Re: [Full-disclosure] Gmail emails issue
    ... if thats on the gmail server, then the same gmail servers /clusters hold ... So whats the big deal with the temp folder at the server end being ... > firefox and it doesn't store my mails in the temp folder under my NT ...
    (Full-Disclosure)
  • Re: Receiving email from my moms email account
    ... GMail POP access via Outlook Express will download the sent email ... > the GMail server and download it to my computer. ... If I send an email using that account via Outlook ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress)
  • Re: Anyone know reliable POP3 and auth SMTP email provider?
    ... on the Gmail server which is not always popping into their Outlook ... and provides POP and SMTP authenticated access? ... chargable service) provides free pop and smtp access. ...
    (uk.telecom.broadband)
  • Re: POP mail question
    ... account'> Receiving Options' set a tick in 'Leave messages on the ... gmail shouldn't change the messages status. ... up the gmail server. ...
    (Ubuntu)
  • newsmail@reuters.uk.ed10.net Fwd: Money for New Orleans, AL & GA Inbox
    ... Inbox ... Money for New Orleans, ... I've been using Gmail and thought you might like to try it out. ... Were if it is not good news then it is not NEWS to US. ...
    (comp.lang.java.programmer)