Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Python
Python mail truncate problem
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="David, post: 3862380"] Hi, I am writing Python script to process e-mails in a user's mail account. What I want to do is to update that e-mail's Status to 'R' after processing it, however, the following script truncates old e- mails even though it updates that e-mail's Status correctly. Anybody knows how to fix this? Thanks so much. fp = '/var/spool/mail/' + user mbox = mailbox.mbox(fp) for key, msg in mbox.iteritems(): flags = msg.get_flags() if 'R' not in flags: # now process the e-mail # now update status msg.add_flag('R' + flags) mbox[key] = msg [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Python
Python mail truncate problem
Top