SUCHE VORHER/nachher mit Pythons imaplib

Habe ich eine kleinere IMAP-Skript geschrieben ich Python(3.2).

Ich meine Suche-Zeile sieht wie folgt aus:

typ, data = M.search(None, 'FROM', '"MyName"')

Bekomme ich die erwarteten Ergebnisse. Allerdings, wenn ich es ändern auf etwas wie:

typ, data = M.search(None, 'AFTER', '"01-Jan-2010"')

(mit oder ohne Datum zitiert, ich bekomme diese Fehlermeldung

Traceback (most recent call last):
  File "./priv/imap.py", line 100, in <module>
    main()
  File "./priv/imap.py", line 93, in main
    print(to_json(fetch_result(M, args), args))
  File "./priv/imap.py", line 51, in fetch_result
    typ, data = M.search(None, 'AFTER', '"01-Jan-2010"')
  File "/usr/lib/python3.2/imaplib.py", line 652, in search
    typ, dat = self._simple_command(name, *criteria)
  File "/usr/lib/python3.2/imaplib.py", line 1121, in _simple_command
    return self._command_complete(name, self._command(name, *args))
  File "/usr/lib/python3.2/imaplib.py", line 957, in _command_complete
    raise self.error('%s command error: %s %s' % (name, typ, data))
imaplib.error: SEARCH command error: BAD [b'Could not parse command']

Ich habe keine Ahnung, warum das illegal sein, aber alle Hilfe wird dankbar sein! Auch, was ich ultimatly tun möchten, verwenden Sie "JÜNGER 1234567", um auch feinere Filterung, aber ich bin mir nicht sicher, ob gmail/python unterstützt dies noch.

vielen Dank im Voraus

InformationsquelleAutor Martin Hansen | 2011-04-11

Schreibe einen Kommentar