473,507 Members | 5,060 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

IMAP4 SEARCH question

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
Dec 8 '06 #1
0 1592

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1983
by: Wilfredo Sanchez | last post by:
The docs for imaplib are pretty scant, and i guess the library is meant for people who already know IMAP well and want low-level access to the protocol, as opposed to someone who wants "get me the...
0
1437
by: Christian Rothe | last post by:
Hello Everybody, I need your help, I'm trying to write a simple forwarding script with python2.2. I want to forward unseen emails to another box after two days. This script runs every morning by...
3
2463
by: Oliver Kurz | last post by:
Hello, I just discovered a "bug" in the imaplib. I want to send the following command to the imap-server and I was suprisedto get a error. :-) The command: UID STORE 2349672398 +FLAGS...
0
1316
by: John Owens | last post by:
I am running the IMAP4 example in the documentation: http://www.python.org/doc/lib/imap4-example.html with two small changes (different username, comment out print statement). The inbox I am...
2
3578
by: Sean Dodsworth | last post by:
Can anyone tell me how to get a message's number from the message-id using IMAP4.search? I've tried this: resp, items = server.search(None, 'HEADER', '"Message-id"', msgID) but it gives me a...
4
4443
by: WATYF1 | last post by:
Hello. I'm writing a VB.NET app to check email message counts for both POP3 and IMAP4. I'm using TCPClient to connect, and a NetworkStream to send simple commands. It's a very simple bit of code,...
7
2353
by: Dody Suria Wijaya | last post by:
Hi, I encountered a Memory Error Exception on using IMAP4 just like in Python documentation example, on a specially large email (10 MB). Any idea how to fix/circumvent this? >>> typ, data =...
0
1511
by: Luis Corrales | last post by:
Hi all, I have a problem when searching for text with special characters in e-mails in an IMAP server. I'm using imaplib in python 2.4.3 and I can't get this code working: # first connect and...
0
2065
by: | last post by:
I have a question about spawning and displaying subordinate list controls within a list control. I'm also interested in feedback about the design of my search application. Lots of code is at the...
0
7223
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7110
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7314
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7372
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7482
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
5041
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
411
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.