473,569 Members | 3,035 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 1600

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

Similar topics

1
1997
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 list of messages" and "get me #34". I'm one of the latter people, and were it not for the example, I'd have no clue how to read messages with the...
0
1444
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 a cron ob. Everything works fine, but I cannot set a flag for the forwarded emails. Best would be to create an own flag to identify mails, that are...
3
2464
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 (\SEEN)
0
1320
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 accessing is 42 MB and has 80-someodd messages, so the messages are fairly big (all of them have attachments). When I run this program, I get a...
2
3589
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 'bogus search criteria' error Any ideas?
4
4458
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, actually... the problem is, if the user is behind a proxy, then the Connect method fails (times out). How do I get around this? I thought this...
7
2356
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 = M.fetch(89, '(RFC822)') Traceback (most recent call last): File "<stdin>", line 1, in ? File "C:\Python24\lib\imaplib.py", line 426, in fetch typ, dat...
0
1514
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 login conn = IMAP4(my_server) conn.login(my_user, my_pass)
0
2067
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 end of this message, but I will start with an overview of the problem. I've made a content management solution for my work with a decently...
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
1
7681
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7983
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
6290
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
1
5514
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5228
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3651
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2118
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1229
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.