From 4eb9bf0b808335fb9134531865d07798a690ee4e Mon Sep 17 00:00:00 2001 From: msmits Date: Wed, 2 May 2007 08:48:22 +0000 Subject: [PATCH] initial versions of these files --- imapclient/AUTHORS | 4 ++++ imapclient/example.py | 23 +++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 imapclient/AUTHORS create mode 100644 imapclient/example.py diff --git a/imapclient/AUTHORS b/imapclient/AUTHORS new file mode 100644 index 0000000..42bc582 --- /dev/null +++ b/imapclient/AUTHORS @@ -0,0 +1,4 @@ +imapclient.py was created and is maintained by Menno Smits . + +The project was started while the author was working at NetBox Blue +(http://netboxblue.com/). diff --git a/imapclient/example.py b/imapclient/example.py new file mode 100644 index 0000000..4384561 --- /dev/null +++ b/imapclient/example.py @@ -0,0 +1,23 @@ +from imapclient import IMAPClient + +HOST = 'imap.host.com' +USERNAME = 'someuser' +PASSWORD = 'secret' + +server = IMAPClient(HOST, use_uid=True) +server.login(USERNAME, PASSWORD) + +number_msgs = server.select_folder('INBOX') +print '%d messages in INBOX' % number_msgs + +messages = server.search(['NOT DELETED']) +print "%d messages that aren't deleted" % len(messages) + +print +print "Messages:" +response = server.fetch(messages, ['FLAGS', 'RFC822.SIZE']) +for msgid, data in response.iteritems(): + print ' ID %d: %d bytes, flags=%s' % ( + msgid, + data['RFC822.SIZE'], + ','.join(data['FLAGS'])) -- 2.43.0