-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdemo.py
More file actions
23 lines (18 loc) · 786 Bytes
/
demo.py
File metadata and controls
23 lines (18 loc) · 786 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
from imaptools import MyIMAP
import config
M = MyIMAP(config.imap_host, config.imap_port)
M.login(config.imap_username, config.imap_password)
M.select()
def testFolder(name):
print "Nr in " + name, M.countMails(name, '(ALL)')
print "Nr of SEEN in " + name, M.countMails(name, '(SEEN)')
print "Nr of UNSEEN in " + name, M.countMails(name, '(UNSEEN)')
print "Nr of NEW in " + name, M.countMails(name, '(NEW)')
print "Nr of OLD in " + name, M.countMails(name, '(OLD)')
print "Nr of RECENT in " + name, M.countMails(name, '(RECENT)')
testFolder('INBOX')
print "Nr of unread in Important", M.countMails('[Gmail]/Important', '(UNSEEN)')
print "Nr in Drafts", M.countMails('[Gmail]/Drafts', '(OLD)')
print
print "\n".join(M.listTasks('INBOX', '(ALL)'))
M.logout()