0 votes
by (990 points)
edited

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
by (144k points)
edited
 
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:

C#:

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

VB:

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:

C#:

client.Options |= ImapOptions.UsePeekForGetMessage;

VB.NET:

client.Options = client.Options Or ImapOptions.UsePeekForGetMessage

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

...