[Tutor] problem with key in mailbox.Maildir

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Tutor] problem with key in mailbox.Maildir

Kantesh Raj
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

_______________________________________________
Tutor maillist  -  [hidden email]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor