IMAP4 SEARCH question

Discussion in 'Python' started by Laszlo Nagy, Dec 8, 2006.

  1. Laszlo Nagy

    Laszlo Nagy Guest

    Hi,

    I'm using imaplib to access an IMAP4 server. I'm reading the IMAP4
    specification, and I found something odd. The search command can be
    used in conjuction with date values. For example, I would like to search
    for messages that are older than 30 days. However, the IMAP4 specs does
    not define date/time type(s). Here is a link:

    http://tools.ietf.org/html/rfc3501#page-16

    As you can see, there are some types: NIL, Number, String and
    Parenthesized List. So how do I specify a date? If it is encapsulated in
    a string, then what format should I use? The the RFC contains an example:

    http://tools.ietf.org/html/rfc3501#page-49

    BEFORE <date>
    Messages whose internal date (disregarding time and timezone)
    is earlier than the specified date.

    Example: C: A282 SEARCH FLAGGED SINCE 1-Feb-1994 NOT FROM "Smith"
    S: * SEARCH 2 84 882


    But of course I cannot tell what is the date format. I would like to use
    ISO8601 if possible. It is easy (at least from python) and it is well
    standardized. But will the IMAP4 server understand it? Okay, I know that
    I can try this with my IMAP server. But how strange it is that the RFC
    does not define the accepted date formats? Will my program work with any
    IMAP server? If any of you have experience with this, please respond.

    (I'm sorry, I know it is not strictly related to Python, it is more
    likely an RFC/IMAP question.)

    Best,

    Laszlo
    Laszlo Nagy, Dec 8, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Dalberg

    Free pop3 or IMAP4 control?

    John Dalberg, Sep 1, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    1,318
  2. Max M

    IMAP4.search by message-id ?

    Max M, Mar 30, 2005, in forum: Python
    Replies:
    2
    Views:
    380
    Sean Dodsworth
    Mar 30, 2005
  3. Tony Meyer

    RE: IMAP4.search by message-id ?

    Tony Meyer, Mar 31, 2005, in forum: Python
    Replies:
    1
    Views:
    849
    Sean Dodsworth
    Mar 31, 2005
  4. Luis Corrales

    IMAP4 search with special characters

    Luis Corrales, Jul 21, 2006, in forum: Python
    Replies:
    0
    Views:
    541
    Luis Corrales
    Jul 21, 2006
  5. Laszlo Nagy

    Re: IMAP4 SEARCH question

    Laszlo Nagy, Dec 8, 2006, in forum: Python
    Replies:
    0
    Views:
    387
    Laszlo Nagy
    Dec 8, 2006
Loading...

Share This Page