0

My program reads all of the messages in my inbox, but only replies to the sender that I specified. I want to somehow make it to where the messages that weren't replied to become unread again. I'm using a Visual Code on MACOSX.

I tried setting the readonly value as True for when it checks the Inbox. The issue with this is that the program leaves the same emails unread and ends up replying to them multiple times. Is there a better way to select a folder ?

def imap_init():

    print("Initializing IMAP . . . ", end = '')
    global client 
    client = imapclient.IMAPClient(imapserver)
    client.login(radr,pwd)
    client.select_folder("Inbox", readonly=False)
L.Ruiz
  • 13
  • 1
  • 7

1 Answers1

0

Several ways.

  1. You can clear the \seen flag to make them unseen.

  2. Or you can use the \Answered flag instead, set \Answered when you answer and avoid answering messages that have \Answered. (You'll need to search for UNANSWERED messages.)

  3. Or you can use the PEEK variant when you fetch messages to avoid having \Seen set automatically, and set \Seen yourself when you answer.

Option 2 corresponds most closely with the intentions of the author of RFC, but I have no idea which option fits your situation and mindset best.

arnt
  • 8,949
  • 5
  • 24
  • 32