Message info
 
To:tutor@python.org From:Kantesh Raj Subject:[Tutor] problem with key in mailbox.Maildir Date:Fri, 30 Mar 2012 21:35:33 +0530
 

hi everyone,
i am not able to get email from my mailbox by using key.
key is automatically removed after program termination but file is present there.
i get data by same code method by using fresh key (which is generated by adding email again)

import mailbox
mailb = mailbox.Maildir('~/Maildir',factory=none)
k=mailb.get_file('1333110477.M317089P8312Q1.Kantesh-Pc')
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/usr/lib/python2.7/mailbox.py", line 359, in get_file
f = open(os.path.join(self._path, self._lookup(key)), 'rb')
File "/usr/lib/python2.7/mailbox.py", line 529, in _lookup
raise KeyError('No message with key: %s' % key)
KeyError: 'No message with key: 1333110477.M317089P8312Q1.Kantesh-Pc

how to get email by key???
thanks in advance for help
--
Kantesh Raj