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.
Timo Sirainen [Fri, 15 Jan 2016 13:12:30 +0000 (15:12 +0200)]
dsync: Fixed syncing subscription state with doveadm backup.
If DSYNC_MAILBOX_TREES_SYNC_TYPE_PRESERVE_REMOTE was set, we could still have
preserved the local subscription state. Also cleaned up the code a bit to
make it clearer.
This matches all mailboxes, which contain a virtual METADATA entry that has
any value except "ignore".
Note that the current implementation requires still opening all the mailboxes
before matching the METADATA entries. This could be avoided in v2.3 with some
lib-storage API changes.
Timo Sirainen [Wed, 13 Jan 2016 11:46:33 +0000 (13:46 +0200)]
virtual plugin: Cleaned up behavior of '!' prefix with '+' and '-'
It makes a bit more sense now. Mainly the difference is that "!foo*" means
to save mails to a mailbox called "foo*", instead of including mailboxes
matching "!foo*" pattern to the virtual mailbox. It's unlikely anyone was
relying on this behavior.
Timo Sirainen [Wed, 13 Jan 2016 11:41:05 +0000 (13:41 +0200)]
virtual plugin: Don't treat "+-box" as a negative entry.
This was already documented by wiki to work as a mailbox named "-box",
although it didn't actually work that way. There wasn't any practical
difference between "+-box" and "-box", so this change is unlikely to break
anyone's config. It was mainly done as code cleanup.
Timo Sirainen [Wed, 13 Jan 2016 11:31:54 +0000 (13:31 +0200)]
virtual plugin: Minor cleanup/fix - find the namespace after we have processed special prefixes.
We already skipped over them earlier, but the logic wasn't exactly the same
as when they were actually being processed, so there could have been some
unexpected mismatches.
Timo Sirainen [Wed, 16 Dec 2015 13:06:52 +0000 (15:06 +0200)]
lib-compress: lz4 istream wasn't detected reliably in some situations.
We requested too few bytes from istream, so there wasn't any guarantee that
the istream actually had all the bytes. This caused a problem for example
with mdbox when the previous mail was already fetched and the stream happened
to end in the middle of the lz4 header.
Timo Sirainen [Tue, 15 Dec 2015 15:29:11 +0000 (17:29 +0200)]
lib-mail: message_header_parser_next() updates istream position immediately now.
Earlier it updated the position only on the next call or at deinit. This was
because some earlier code kept pointers to the stream data and stored them
to the returned struct message_header_line, but we don't do this anymore.
This allows more easily accessing the same istream for other purposes during
the header parsing.
Timo Sirainen [Sun, 13 Dec 2015 10:33:20 +0000 (12:33 +0200)]
stats: Avoid assert-crash with dsync.
dsync creates two mail_users and they're deinited at the same time.
stats_global_user isn't set after the first one is deinited, so the next
deinit crashed because it wasn't set.