rtucker / imap2maildir

Backs up an IMAP mailbox to a maildir. Useful for backing up mail stored on free webmail providers, etc.
http://blog.hoopycat.com/index.php/2009/07/04/imap2maildir-a-tool-for-mirroring-imap-t
MIT License
99 stars 22 forks source link

Search criteria problem #22

Open peterSva opened 10 years ago

peterSva commented 10 years ago

I try "FROM foo" och "KEYWORD bar" but gets UID errors. Not implemented more-than-one-word search criterias?

(Tried all (?) kinds of quoting to get the second word in, with no success.)

/Peter Svanberg, Sweden

rtucker commented 10 years ago

Hmm, seems to work OK for me, at least directly using simpleimap. Here's a quick test program:

import simpleimap
s = simpleimap.Server(hostname='a', username='b', password='c', port=d)

imap = s.Get()

f = imap.Folder(folder="INBOX.System Mail.Pkg Updates")

count = 0

# pick one
#search = '(to "root@hennepin.rochnyav.sodtech.net")'
search = '(since "05-Jul-2014")'
#search = 'ALL'

print "searching:", search
for uid in f.Uids(search=search):
    print count, uid
    count += 1

This returns, as expected:

$ python repro.py 
searching: (since "05-Jul-2014")
0 1827
1 1828

It's entirely possible that something is eating that along the line, though, since parentheses and quotation marks are terrible from the command line. What's the exact command/configuration you're using (sans passwords, of course)? I can give it a shot here.