GetMessage set's the seen-flag on server

0 votes
asked Mar 25, 2011 by martin (990 points)
edited Dec 4, 2013

in my example program the call of GetMessage() set's always the seen-flag on message that is download. How can i avoid this?

oImap.GetMessage(oMessageInfo.UniqueId, srMsgMemStream)

I've already sent you the logfile per email.

Applies to: Rebex Secure Mail

1 Answer

+1 vote
answered Mar 25, 2011 by Lukas Pokorny (126,910 points)
edited Dec 4, 2013
Best answer

By default, Rebex IMAP marks messages as Seen (that's what read messages are called in IMAP) when you call GetMessage/GetMailMessage/GetMimeMessage, or GetMessageInfo/GetMessageList with ImapListFields.Body flag.

This behavior can be disabled using `UsePeekForGetMessage` option:


Imap client = new Imap();
client.Settings.UsePeekForGetMessage = true;


Dim client As New Imap()
client.Settings.UsePeekForGetMessage = True

If you are using one of the older versions of Rebex components, please use the old Options property like this:


client.Options |= ImapOptions.UsePeekForGetMessage;


client.Options = client.Options Or ImapOptions.UsePeekForGetMessage

(where "client" is an instance of "Imap" object)