On Tue, May 12, 2009 at 4:11 PM, David <ww...@yahoo.com> wrote: > > Hello, > > I have read related part in python library and also searched this > list, however I still can not figure out where is wrong with my code. > so I post my question. > > I am using the following code to process e-mails in a user account. > > ============================================================ > > mmailbox = '/var/spool/mail/' + user > > with open(mmailbox) as boxfile: > mbox = mailbox.UnixMailbox(boxfile, > self.msgfactory) > for mail in mbox: > if mail.get("Status") != "R" and > mail.get("Status") != "O": > begin to process > ...... > mail.add_flag("Status") = "R" > > ========================================================== > > Notice that I have used "add_flag" to change its status. However, it > does not work as my code still processes those e-mails that have been > processed already. > > Can anybody tell me where is wrong? Thanks so much. >
Did you perhaps mean to post this to comp.lang.python rather than django-users? The API you are having trouble with is not part of Django, so asking about it here is not likely to garner many useful responses. Karen --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-users?hl=en -~----------~----~----~----~------~----~------~--~---