By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,100 Members | 2,892 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,100 IT Pros & Developers. It's quick & easy.

setting email FLAGs in IMAP4 box

P: n/a
Hello Everybody, I need your help,

I'm trying to write a simple forwarding script with python2.2. I want
to forward unseen emails to another box after two days. This script
runs every morning by a cron ob. Everything works fine, but I cannot
set a flag for the forwarded emails. Best would be to create an own
flag to identify mails, that are forwarded a day before. I don't know
how to create an own flag. If I try to use an existing flag like
'UNSEEN', 'Deleted'.. or so, I use the commands:

imap = imaplib.IMAP4("hostname")
imap.login("name","passwd")
imap.select("INBOX",1)
imap.store(1, 'FLAGS', '(\Deleted)')

, but it doesn't work. I always get the message

('NO', ['Permission denied'])

Other commands are working fine, e.g.
imap.fetch(1,"INTERNALDATE")

('OK', ['1 (INTERNALDATE "29-Jan-2004 11:43:41 +0100")'])

How can I get 'Permissions' to change flags?? Does anybody know??

best regards
Christian Rothe
Jul 18 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.