+1 vote

The ICriterion returned by the Limilabs.Client.IMAP.SentSince(DateTime) function does not consider time and timezone, only the date.
(I don't see how usefull this method can be if it is that vague.)

Today I do a double filter :

List<long> uids = imap.Search().Where(Expression.SentSince(LastDate));
List<MessageInfo> infos = imap.GetMessageInfoByUID(uids);

foreach (MessageInfo info in infos)
{
    if (info.Envelope.Date > LastDate)
    {
       // Process email
    }
    else 
       break;
}

Is there a way to make query more precisely on the email Date ? (without opening the emails :) )

by

1 Answer

0 votes
 
Best answer

This is the limitation of the IMAP protocol and not Mail.dll. RFC 3501:

SENTSINCE
Messages whose [RFC-2822] Date: header (disregarding time and
timezone) is within or later than the specified date.

Using Imap.GetMessageInfoByUID method is a good solution.

If you plan to download only new emails check this article: Get new emails using IMAP.

by (297k points)
selected by
...