Vijina Govindan
Vijina Govindan

Reputation: 43

IMAP Search Command with date filter

I am trying to get UID list of mails in a particular date range. Am trying to perform the below command

$ UID SEARCH SINCE 24-april-2017 BEFORE 27-april-2017 UID 1:*

Getting exception as BAD COMMAND.

Any suggestion?

Upvotes: 0

Views: 1412

Answers (1)

arnt
arnt

Reputation: 9675

The syntax for month is:

date-month      = "Jan" / "Feb" / "Mar" / "Apr" / "May" / "Jun" /
                  "Jul" / "Aug" / "Sep" / "Oct" / "Nov" / "Dec"

So your command ought to be

$ uid search since 24-apr-2017 before 27-apr-2017 uid 1:*
* SEARCH 317556 317557 [...] 318139 318140
$ OK done

Or just $ uid search since 24-apr-2017 before 27-apr-2017 since the UID restriction is a no-op.

Upvotes: 1

Related Questions