Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some problem with filter #186

Open
lexamad opened this issue Sep 29, 2015 · 1 comment
Open

Some problem with filter #186

lexamad opened this issue Sep 29, 2015 · 1 comment

Comments

@lexamad
Copy link

lexamad commented Sep 29, 2015

I have a problem with MS Exchange server imap filter conditions SentOn (and others with date)

when i try
var msgs = imap.SearchMessages( SearchCondition.SentOn(new DateTime(2015, 09, 11)));

occurs error "xm004 BAD Command Argument Error. 11"

But this is example work with imap.gmail.com.

I found this article
The SEARCH command (SENTSINCE, SINCE, SENTBEFORE, SENTON, BEFORE) works only with with a date, not a date + timestamp.
http://stackoverflow.com/questions/22392120/python-imap-mail-seach-with-minutes

May be you change, for example here
in AE.Net.Mail.SearchCondition
public override string ToString(){
....
if (value is DateTime)
{
if (Field.Equals(Fields.SentSince)
|| Field.Equals(Fields.Since)
|| Field.Equals(Fields.SentBefore)
|| Field.Equals(Fields.SentOn)
|| Field.Equals(Fields.Before)
)
value = ((DateTime)value).ToString("dd-MMM-yyyy", _enUsCulture);
else
value = ((DateTime)value).GetRFC2060Date().QuoteString();
}

}

Thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants
@lexamad and others