Timo Sirainen [Thu, 28 Jan 2016 13:36:58 +0000 (15:36 +0200)]
imap: Send all pending tagged command replies before APPEND is started.
This probably doesn't matter a lot, but it's cleaner.
One side effect of this change is that if multiple APPENDs are pipelined
(without MULTIAPPEND) on the selected mailbox, this now performs a sync
between each APPEND and sends the EXISTS replies. This may be slightly
lower in performance, but it's also slightly more correct behavior.
Timo Sirainen [Wed, 27 Jan 2016 13:16:18 +0000 (15:16 +0200)]
imapc: Don't use fetch-fix-broken-mails for OK and NO [SERVERBUG] FETCH replies
Hopefully no servers are actually returning OK without returning a FETCH
reply. If they are, maybe we need another workaround..
In any case Yahoo IMAP sometimes loses state and starts returning OK without
FETCH replies to all UID FETCH requests (and BADs to FETCHes). It also may
return NO [UNAVAILABLE] for both permanent and temporary FETCH failures, so
we can't do anything with that.
I added NO [SERVERBUG] because that's what Dovecot responds to temporary
failures. I'm not sure how useful that check is though.
Timo Sirainen [Tue, 26 Jan 2016 22:35:34 +0000 (00:35 +0200)]
fts-solr: Changed default operator to AND to fix multi-word queries.
Previously for example searching from:foo@example.com was expanded to
foo OR example OR com. Now it's foo AND example AND com, which makes a lot
more sense.
Timo Sirainen [Tue, 26 Jan 2016 17:56:43 +0000 (19:56 +0200)]
dsync: When comparing headers' hashes to match messages, try to normalize the input.
This is especially useful because some IMAP servers return different data
depending on whether we're fetching only specific header fields, all headers
or entire body. For now we're assuming that any non-ASCII is going to be
replaced with '?', which helps at least with Zimbra and Yahoo. The header
hashing algorithm is now versionable, so it can be modified more easily in
future.
This change should make imapc_features=zimbra-workarounds setting obsolete.
Timo Sirainen [Tue, 26 Jan 2016 13:22:50 +0000 (15:22 +0200)]
pop3-migration: Cached header hashes weren't actually being used for imapc.
We'll need to do the search twice: Once to find out the actual cached header
hashes and then second time do a search for the message headers excluding the
emails whose hashes we already know. This allows prefetching to work for imapc
without prefetching all the emails as it was doing.
This allows ignoring a missing FETCH reply. It shouldn't be used normally,
but if there's a mail that the IMAP server simply won't serve, this can be
used to finish dsync successfully.
Timo Sirainen [Sun, 24 Jan 2016 14:28:29 +0000 (16:28 +0200)]
pop3-migration: When failing because some messages couldn't be matched, show the first message's number and UIDL
This was already being done for the warning message when
pop3_migration_ignore_missing_uidls was set, but not for the error message
when it wasn't set.
If we know that we're not going to be able to match any messages by sizes,
we might as well not ask for the messages' sizes. This is useful at least
with Yahoo.
Timo Sirainen [Sat, 23 Jan 2016 12:05:19 +0000 (14:05 +0200)]
ldap auth: %variables in pass/user_attrs are now included in auth cache key.
This makes sure that the result won't be cached too aggressively, for example
if %{lport} or %{rip} was used as a field's value. Although each of these
fields just makes the cache less effective, so it's a good idea to avoid
variables entirely in the pass/user_attrs. An alternative is to use
passdb/userdb { override_fields }
Timo Sirainen [Sat, 23 Jan 2016 11:57:54 +0000 (13:57 +0200)]
auth: Apply passdb/userdb { override_fields } only after caching
Now they're not be unnecessarily saved to cache to waste memory. More
importantly they will always override the cached fields, which is required
for %variables to work.
Alin Dobre [Fri, 22 Jan 2016 15:15:03 +0000 (15:15 +0000)]
doveadm: Add plugins support for doveadm pw
This simply tries to load all the auth plugins. The ones that aren't
password scheme plugins will most likely just fail. Hopefully this will
work fine so we don't need to require any specific naming rules for the
plugins.
Aki Tuomi [Mon, 18 Jan 2016 13:50:23 +0000 (15:50 +0200)]
master: Do not close stdout if going foreground
This lets one to use /dev/stdout for logging. Mainly
useful for testing purposes where we can generate
log output to stdout and use tee to write it to a
file for later examination.
Timo Sirainen [Wed, 20 Jan 2016 11:22:15 +0000 (13:22 +0200)]
lib-storage: Fixed looking up MAILBOX_METADATA_FIRST_SAVE_DATE from mailbox list index.
If the mailbox was cached as empty, we didn't check if it had since received
new messages. This caused the first-save-date to be returned as nonexistent,
which caused autoexpunging to not always work.
Timo Sirainen [Tue, 19 Jan 2016 18:45:27 +0000 (20:45 +0200)]
lib: Don't crash if getenv() is called after process_title_deinit() with Linux/OSX PROCTITLE_HACK
Right now the only known issue is GNUTLS's lib_deinit():
e = getenv("GNUTLS_NO_EXPLICIT_INIT");
But we likely never want that to be set. Alternative ways to solve this are
more annoying than our clearing the environment. Libraries probably shouldn't
rely on it much anyway, because some parts of Dovecot clear the whole
environment while running.
Timo Sirainen [Tue, 19 Jan 2016 13:15:19 +0000 (15:15 +0200)]
quota-clone: Avoid leaving a dict transaction open for unnecessarily long.
Even though the earlier change should fix the dict assert crash due to
opening multiple transactions when recursing back, this makes sure of it.
It could also be helpful for some dict backends to not keep the transaction
open for unnecessarily long.
Which would happen because request->passdb=NULL because there are only
master passdbs. Even if only master passdb is actually needed, there should
still be a non-master passdb for non-master logins to specify what happens
to them.
Timo Sirainen [Sat, 16 Jan 2016 19:31:55 +0000 (21:31 +0200)]
imapc: Added support for PROXYAUTH command by setting imapc_features = proxyauth
This can be useful when talking to Sun/Oracle IMAP server, which wants you
to use LOGIN+PROXYAUTH to perform master user logins, instead of supporting
the standard SASL PLAIN authentication.