K
K
Kirill Batalin2017-01-07 10:30:28
Email
Kirill Batalin, 2017-01-07 10:30:28

IMAP: How to remove the recent flag?

Hello.

How to properly "read" emails with imap?
Select mailbox: EXAMINE INBOX
Search for new messages: SEARCH RECENT
Server response:

a5 SEARCH RECENT
* SEARCH 27
a5 OK Search completed (0.001 + 0.000 secs).

I read the message: FETCH 27 BODY[]

But after that it SEARCH RECENTcontinues to return letter No. 27. How to read a letter so that the RECENT flag is removed from it?

UPD: The task is as follows. It is necessary to write a program that once every N seconds checks the mailbox for new messages. If there is a new letter, then displays it. By condition, you must use the \Recent flag to determine new mail

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question