whiteout-io/browserbox — pull request #42 by asutherland (2014-11-20 15:48:29+00:00)
Title: Do not quote Date objects in SEARCH to appease yandex IMAP

The RFC 3501 grammar for date is:

```
date = date-text / DQUOTE date-text DQUOTE
date-text = date-day "-" date-month "-" date-year
```

Currently the search functionality emits dates as strings which results
in them being double-quoted. This is legal, although section 6.4.4's
example does not use the quotes.

The problem is that the Yandex IMAP server, at least, does not like the
quotes. In my tests, if I send 'W6 UID SEARCH NOT DELETED SINCE "1-Jan-1990"'
I get back 'W6 Command syntax error.' However, if I do not quote the date,
things work.

This patch changes the behaviour in a non-configurable fashion since the
assumption is that all servers can handle the unquoted form and it's also
less bytes on the wire.

I checked the grammar and the only place that "date" is used is inside SEARCH,
so hopefully there are no other cases where something like this needs to be
done. (APPEND explicitly uses "date-time" which is explicitly wrapped in
DQUOTEs.)