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

SearchCondition.SentSince seems not working #156

Open
bigbadabam opened this issue Apr 30, 2019 · 1 comment
Open

SearchCondition.SentSince seems not working #156

bigbadabam opened this issue Apr 30, 2019 · 1 comment

Comments

@bigbadabam
Copy link

I used SearchCondition.SentSince to filter messages by date, but in the following example search method returns empty uids collection:

 static void Main(string[] args)
        {
            string hostname = "imap.yandex.ru", username = "[email protected]", password = "mypass";
            using (ImapClient client = new ImapClient(hostname, 993, username, password, AuthMethod.Login, true))
            {
                Console.WriteLine(">> Connected");
                IEnumerable<uint> uids = client.Search(SearchCondition.SentSince(new DateTime(2018, 01, 01)));                    
                Console.WriteLine(">> Mail list received");
                IEnumerable<MailMessage> messages = client.GetMessages(uids);
                Console.WriteLine(">> Messages received");
                //string[] keys = { "Date", "From", "Return-Path" };
                string[] keys = { "Date"};
                foreach (var message in messages)
                {
                    foreach (string s in keys) 
                    {
                        Console.WriteLine("    {0}: {1}", s, message.Headers[s]);
                    }
                    Console.WriteLine();
                }
            }
            Console.ReadLine();
        }

When I used SearchCondition.All() I have following output:

Date: Thu, 05 Feb 2015 20:30:02 +0300
Date: Sun, 11 Dec 2016 14:58:23 +0400
Date: Sun, 11 Dec 2016 20:38:14 +0400
Date: Thu, 27 Jul 2017 17:41:57 +0400
Date: Tue, 03 Oct 2017 12:36:48 +0300
Date: Tue, 03 Oct 2017 15:42:34 +0300
Date: Tue, 03 Oct 2017 22:19:05 +0300
Date: Wed, 4 Oct 2017 16:30:46 +0400
Date: Sun, 08 Apr 2018 10:16:16 +0300
Date: Fri, 13 Apr 2018 09:56:55 +0000
Date: Tue, 30 Oct 2018 14:46:35 +0400
Date: Mon, 14 Jan 2019 14:09:47 +0300
Date: Fri, 22 Mar 2019 15:09:52 +0300
Date: Tue, 26 Mar 2019 11:30:13 +0300
Date: Thu, 28 Mar 2019 13:30:44 +0300
Date: Tue,  2 Apr 2019 17:20:28 +0300
Date: Tue,  9 Apr 2019 17:00:36 +0300
Date: Thu, 18 Apr 2019 18:10:13 +0300
Date: Fri, 19 Apr 2019 00:19:25 +0300
Date: Fri, 19 Apr 2019 07:45:51 +0000
Date: Fri, 19 Apr 2019 15:01:21 +0300
Date: Tue, 23 Apr 2019 15:31:19 +0300
Date: Tue, 30 Apr 2019 12:30:04 +0300

So what's wrong?

@rvalitov
Copy link

rvalitov commented Apr 10, 2023

I'm using another tool and in my case the "SENTSINCE" and "SENTBEFORE" are ignored by Yandex. "SINCE" and "BEFORE" do work.

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

3 participants
@rvalitov @bigbadabam and others