Timo Sirainen [Sun, 16 Aug 2015 11:07:21 +0000 (13:07 +0200)]
lib-fs: fs_write() didn't update stats.write_count correctly.
If backend implemented asynchronous write(), the write_count was updated multiple
times. If backend didn't implement write(), then it was counted twice.
Timo Sirainen [Sat, 15 Aug 2015 10:14:35 +0000 (12:14 +0200)]
dsync: Fixed syncing a recursive delete of mailbox with children.
For example if 1/2/3 exists in both sides and then 1/2/3, 1/2 and 1 are
deleted from one side, the next dsync would delete 1/2/3, but leave 1/2 and
1 undeleted.
Timo Sirainen [Wed, 12 Aug 2015 09:52:06 +0000 (12:52 +0300)]
pop3: Added pop3_delete_type setting with values "default", "expunge" or "flag".
This is related to pop3_deleted_flag setting. The main behefit here is that
you can now hide messages from POP3 by setting pop3_deleted_flag, but
without changing the actual deletion behavior by setting
pop3_delete_type=expunge.
Timo Sirainen [Fri, 7 Aug 2015 10:32:02 +0000 (13:32 +0300)]
fts-solr: "highest UID for mailbox" lookup was actually returning "highest UID for user"
If the default operator was OR instead of AND. This affected indexing mails
in newly created mailboxes.
Timo Sirainen [Thu, 6 Aug 2015 09:17:45 +0000 (12:17 +0300)]
stats: If process was used for multiple sessions, some of the fields weren't set correctly.
For example the second user's disk_output was increased at startup by the
same amount as what the previous user's last disk_output value was.
Timo Sirainen [Sun, 19 Jul 2015 07:57:26 +0000 (10:57 +0300)]
lib-storage: Fixed doing multiple changes via mailbox_attribute_set/unset()
Only the last change was committed and the earlier changes were just leaking
memory.
Timo Sirainen [Sat, 11 Jul 2015 09:16:56 +0000 (12:16 +0300)]
lib-storage: If mailboxes' vsizes are used, keep them updated also in mailbox list index.
This allows looking them up quickly without opening the actual mailbox
indexes.
Timo Sirainen [Sat, 11 Jul 2015 09:11:48 +0000 (12:11 +0300)]
lib-storage: Added MAILBOX_METADATA_PHYSICAL_SIZE
If backend always uses the same virtual and physical sizes, this is
implemented via the MAILBOX_METADATA_VIRTUAL_SIZE code. Otherwise it
searches all the messages and sums up their physical sizes.
Timo Sirainen [Fri, 3 Jul 2015 10:55:17 +0000 (13:55 +0300)]
quota: Even if quota counting fails, commit the mailbox transaction.
The only changes in the transaction are changes to dovecot.index.cache file
and we don't want to rollback those.
Timo Sirainen [Thu, 2 Jul 2015 09:06:04 +0000 (11:06 +0200)]
mdbox: Make sure rebuilding doesn't try to add a copy of the message too many times.
Currently it just silently overflowed the 16bit refcount, which caused
problems later.
Timo Sirainen [Tue, 30 Jun 2015 10:58:15 +0000 (13:58 +0300)]
doveadm: Added doveadm_username to specify the username for authentication.
The default is still "doveadm" and the server side doesn't currently support
anything except "doveadm".
Timo Sirainen [Tue, 30 Jun 2015 09:18:08 +0000 (12:18 +0300)]
istream filters: If parent's i_stream_stat() fails, copy the stream_errno.
This doesn't actually change any functionality yet, since most
i_stream_stat() callers aren't using i_stream_get_error().
Timo Sirainen [Tue, 30 Jun 2015 09:17:35 +0000 (12:17 +0300)]
lib: istream_file.stat() fails, set stream_errno and error string.
For now we'll also keep logging the error since everybody isn't using
i_stream_get_error().
Timo Sirainen [Tue, 23 Jun 2015 09:31:21 +0000 (11:31 +0200)]
lib-storage: Set MAILBOX_SELECT/NONEXISTENT for namespace prefix even if no flags are wanted.
This fixes doveadm commands attempting to access such nonexistent mailbox
prefixes.
Timo Sirainen [Wed, 17 Jun 2015 13:37:37 +0000 (16:37 +0300)]
fs-posix: Hide temporary files from fs_iter_*()
Those could exist just because another process is just using them to create
new files to the directory. Although they could also be older files caused
by earlier crashes. It would probably be a good idea to have fs_iter_*()
delete the old temporary files automatically.
Timo Sirainen [Wed, 17 Jun 2015 11:04:42 +0000 (14:04 +0300)]
fts-solr: Avoid sending too large queries to Solr due to listing wanted mailboxes.
This is mainly a problem if there are a lot of mailboxes and "All Mails"
virtual mailbox. For now hardcoded to send max 10 mailboxes in the query,
afterwards it just returns matches in all the mailboxes and we'll filter out
the unwanted mailboxes.
Timo Sirainen [Wed, 17 Jun 2015 10:55:37 +0000 (13:55 +0300)]
fts-solr: Removed assert to fix indexing multiple mailboxes.
fts plugin may want to do last-uid lookup for a new mailbox while we still
have posting open for the previous one.
Timo Sirainen [Wed, 17 Jun 2015 10:12:37 +0000 (13:12 +0300)]
fts-tika: Fixed crashes when indexing larger attachments with fts-solr.
We were mixing ioloops without switching back to the original ioloop in the
middle. Also io_remove() at deinit caused another timeout to be added, so
this needs to be done while original ioloop is active or we'll just leak the
just-added timeout in io_loop_destroy() and crash later.
Timo Sirainen [Wed, 17 Jun 2015 09:21:52 +0000 (12:21 +0300)]
lib-fs: Call o_stream_nfinish() automatically for all backends in fs_write_stream_finish()
Otherwise each backend needs to do it internally. fs-metawrap for example
was missing this and causing assert-crashes.
Phil Carmody [Wed, 17 Jun 2015 08:42:53 +0000 (11:42 +0300)]
lib: test-data-stack - simplify #if-ing out of DEBUG-only fatal test
With no canaries, nothing can be tested, so just reduce this to a trivial
1-line return on the non-DEBUG case.
Phil Carmody [Wed, 17 Jun 2015 08:42:30 +0000 (11:42 +0300)]
lib: test-data-stack - ensure t_push() and t_pop() are balanced in fatal tests
If the t_pop() unexpectedly succeeds, we won't want to do another one upon
entering the function again.
Timo Sirainen [Wed, 17 Jun 2015 08:31:02 +0000 (11:31 +0300)]
auth: Added allow_real_nets setting.
The difference to allow_nets is that it matches against the connection's
"real IP" rather than what the connection told was the original client's IP
address (%{rip} vs %{real_rip})
This means that all FS operations have a 10% chance of failing, except reads
have a 30% chance of failing. If the read fails, it'll fail somewhere
between offsets 2000-3000 (the default is 0, so it'll fail at the start of
file).
The supported operations are: wait metadata prefetch read write lock exists
stat copy rename delete iter. "all" applies to all of them.
The supported ranges are: read-range, write-range, iter-range.
Phil Carmody [Mon, 15 Jun 2015 11:54:58 +0000 (14:54 +0300)]
director: explicitly mark _disconnect() helper static to match proto
No functional change, compiler would not have exported the symbol, this
just shuts up sparse.
Timo Sirainen [Mon, 15 Jun 2015 11:51:46 +0000 (14:51 +0300)]
fs-metawrap: If written file unexpectedly shrinks, return error instead of assert-crash.
This shouldn't be happening, but we can't fully control it so an error is
better.
Phil Carmody [Mon, 15 Jun 2015 11:31:19 +0000 (14:31 +0300)]
lib-test: test_expect_error_string() to match a single known message
This gives us very fine control over what is acceptable as an expected warning.
Alas you have to do it for each message individually.
Phil Carmody [Mon, 15 Jun 2015 11:31:19 +0000 (14:31 +0300)]
lib-test: let tests invoke i_warning/i_error behaviour
Error-handling paths should be testable too. Permit a test case to register
that a known number of warnings/errors are to be expected, and to verify
that those warnings did occur afterwards. Too many messages will fail the
test exactly as it did in the past, they're unexpected messages. However,
too few messages will also cause the test case to fail.
Phil Carmody [Mon, 15 Jun 2015 11:31:19 +0000 (14:31 +0300)]
lib-test: flush test-assert failure messages
Diagnostic output to stderr may overtake these stdout logs if the streams
are combined by the shell or on the console. fflush() might help realign
them.
Phil Carmody [Mon, 15 Jun 2015 11:25:07 +0000 (14:25 +0300)]
lib: array - permit array_swap with uninitialised arrays
Before initialisation, all fields are blank, so the element_size field
is not the actual size, and the i_assert would fire.
Timo Sirainen [Thu, 11 Jun 2015 16:21:16 +0000 (19:21 +0300)]
lib-index: Avoid writing tail offset update to transaction log if it's not necessary.
This should avoid extra writes that do nothing but update the tail offset.
mdbox's map requires this behavior, so disable it for it. For others it
might cause the next sync to read more data unnecessarily, but it should be
worth the extra cost of write most of the times.
Timo Sirainen [Wed, 10 Jun 2015 17:29:35 +0000 (20:29 +0300)]
lmtp: Fixed assert-crash on anvil lookup failures.
If anvil_client_query() fails, it immediately calls the callback and returns
NULL. So we need to increase anvil_queries even before calling
anvil_client_query()