Timo Sirainen [Fri, 6 Mar 2015 14:33:23 +0000 (16:33 +0200)]
lda/lmtp: Added a hardcoded LDA_SUBMISSION_TIMEOUT_SECS=30 timeout for SMTP client.
Maybe we could have a new setting if needed later on, but we've been working
pretty successfully without any timeout for a long time..
Timo Sirainen [Fri, 6 Mar 2015 00:10:02 +0000 (02:10 +0200)]
lmtp: Added lmtp_user_concurrency_limit setting.
This allows limiting the number of concurrent deliveries to a single user.
Useful in case one user is receiving a lot of mails and causing other
deliveries to be delayed. If the limit is reached, Dovecot returns temporary
failure error at DATA stage.
Timo Sirainen [Thu, 5 Mar 2015 22:40:46 +0000 (00:40 +0200)]
quota: If overquota-flag in userdb is wrong, execute a configured script.
The idea here is that a quota_warning script could set user's overquota-flag
to e.g. LDAP where MTA could reject mails already at RCPT TO stage. The
quota_warning scripts however have race conditions that are difficult (or
impossible) to fix, so sometimes the overquota-flag could become wrong and
might require manual intervention to fix it. This feature is supposed to
solve the issue by comparing the overquota-flag's status to the actual
current quota usage and execute a script to fix up the situation if needed.
This script is of course racy as well, but there's always the next login
that can fix the situation. Also it's pretty rare that user's quota is
jumping just around the limit.
The overquota-flag name in userdb must be "quota_over_flag". There are two
settings to configure what to do:
plugin {
# If quota_over_flag=TRUE, the overquota-flag is enabled. Otherwise not.
quota_over_flag_value = TRUE
# Any non-empty value for quota_over_flag means user is over quota.
# Wildcards can be used in a generic way, e.g. "*yes" or "*TRUE*"
#quota_over_flag_value = *
# Service script to execute if overquota-flag is wrong. Configured the
# same as quota_warning scripts. The current quota_over_flag's value is
# appended as the last parameter.
quota_over_script = quota-warning mismatch %u
}
Timo Sirainen [Thu, 5 Mar 2015 21:02:48 +0000 (23:02 +0200)]
stats process/plugin redesign to be more modular.
The visible functionality doesn't actually change with this patch yet, but
it allows other plugins/services to add their own fields to stats process.
For example auth process could send auth success/failures or auth cache
hits/misses.
Timo Sirainen [Thu, 5 Mar 2015 20:19:02 +0000 (22:19 +0200)]
lib: Don't call ioloop context deactivate() if activate() hasn't been called yet.
This could have happened immediately after the callback was registered.
Timo Sirainen [Tue, 3 Mar 2015 17:48:23 +0000 (19:48 +0200)]
doveadm backup: Try to avoid crashing on unexpected destination changes.
It's a bit difficult to reproduce this bug.. But at least this change should
change the assert, if nothing else.
Timo Sirainen [Tue, 3 Mar 2015 15:25:33 +0000 (17:25 +0200)]
lib-imap-client: Get capabilities again after reconnection to server.
This is needed most importantly if we're not using plaintext authentication
to log in.
Timo Sirainen [Sun, 1 Mar 2015 20:14:01 +0000 (22:14 +0200)]
lib-storage: Allow up to 255 chars in a single mailbox hierarchy name.
This also reduces the max number of hierarchy levels, but 16 should still be
enough for normal uses.
Timo Sirainen [Wed, 25 Feb 2015 13:05:22 +0000 (15:05 +0200)]
lib-auth: auth_master_pass/user_lookup() now returns -2 for user-specific errors.
Compared to -1 which are about a more generic error with auth process
communication. If -2 is returned the lookup could still succeed for another
user.
Timo Sirainen [Tue, 24 Feb 2015 16:42:43 +0000 (18:42 +0200)]
expire plugin: If expire_cache=yes, cache the dict db value in dovecot.index file.
This avoids all of the dict lookups when mails are being saved to a mailbox
that is tracked for expiring. The only downside is that if the dict is
externally modified, the changes won't reflect the cached value. This isn't
normally a problem (except maybe in initial testing stages).
Timo Sirainen [Fri, 20 Feb 2015 12:04:28 +0000 (14:04 +0200)]
LAYOUT=index: Reversed d977a746819d - use storage's list_index_*() callbacks after all.
Just because we have all the mailbox information in the mailbox list index
doesn't mean that we necessarily trust the folder mail counts and such to be
correct. Setting mailbox_list_index_very_dirty_syncs=yes pretty much reverts
to the earlier behavior.
Timo Sirainen [Thu, 19 Feb 2015 17:31:49 +0000 (19:31 +0200)]
lib-storage: Index rebuilding (for [sm]dbox) caused it to reset dovecot.index.cache file
Although in some situations this might be wanted, usually it's not needed
and simply makes the performance worse. If caching is explicitly unwanted
the dovecot.index.cache file can be deleted manually for now. Perhaps there
could be a separate doveadm force-resync parameter to do it as well.
Timo Sirainen [Thu, 19 Feb 2015 11:03:46 +0000 (13:03 +0200)]
lib: Replaced two test_assert()s checking for NULLs with i_assert()s
These can never happen anyway, and keeping them as test_assert()s cause
static analyzer to give warnings.
Timo Sirainen [Thu, 19 Feb 2015 10:00:11 +0000 (12:00 +0200)]
fs-posix: Removed the FS_PROPERTY_DIRECTORIES after all.
We could have kept it if we removed the auto-rmdir()-parents feature in
fs_delete(), but SIS code already somewhat relies on it so it's better not
to change it for now at least.
The downside here though is that directories are rmdir()ed only if
fs_settings.root_dir is set. So for example "doveadm fs delete -R" doesn't
ever rmdir() any directories. But that's probably not a real problem.
Timo Sirainen [Tue, 17 Feb 2015 21:07:00 +0000 (23:07 +0200)]
doveadm fs delete: When recursively deleting files, delete directories with "/" prefix.
Some backends require this to properly delete the file. Those that don't can
ignore it easily.
Timo Sirainen [Tue, 17 Feb 2015 18:42:59 +0000 (20:42 +0200)]
lib-fs: Added flag for iteration returning object IDs.
The flag is only allowed to be used if FS_PROPERTY_OBJECTIDS is set
(to avoid writing extra code for backends that don't support this).
Timo Sirainen [Sun, 15 Feb 2015 08:09:19 +0000 (10:09 +0200)]
doveadm: Added support for mail commands to read an input stream (from stdin)
This is done by calling doveadm_mail_get_input() from the command's init()
function. Currently it reads the entire input into a seekable istream with
hardcoded 5 minute timeout. The input stream sending works also through
doveadm proxying.
This could probably be used by dsync at some point to support proxying over
doveadm proxies, but that would require some more work. Especially a flag
for commands to specify that they allow non-blocking input streams.
Timo Sirainen [Sun, 15 Feb 2015 08:03:10 +0000 (10:03 +0200)]
lib-mail: ostream-dot API changes
The dot-line sending is now done when o_stream_flush() is called. This
should be used instead of relying on close() doing it, because it still
needs to write a few bytes and there are no guarantees that the parent
stream allows sending them.
Also added force_extra_crlf parameter, which specifies whether CRLF should
always be written before the dot-line, even when it already contained CRLF.
This is useful if the input is read with
i_stream_create_dot(send_last_lf=FALSE), since it allows sending a stream
that doesn't have to end with LF.
Timo Sirainen [Fri, 13 Feb 2015 14:38:35 +0000 (16:38 +0200)]
Link all libstorage.la dependencies into the library itself instead.
Instead of keeping a lot of different libraries in LIBDOVECOT_STORAGE, which
have circular dependencies and may cause linking issues.
Timo Sirainen [Tue, 10 Feb 2015 11:12:42 +0000 (13:12 +0200)]
dovecot.m4: External plugins can now more easily run their tests via Valgrind.
DC_DOVECOT macro automatically adds RUN_TEST variable to Makefiles, which
can be used to call any test programs. If valgrind exists, the tests are run
through it. This is done by writing run-test.sh to the build directory, so
the original run-test.sh in hg is no longer needed.
Timo Sirainen [Mon, 9 Feb 2015 11:03:47 +0000 (13:03 +0200)]
doveadm: Reverted changeset 3b89f2f4ffb3, which avoided calling init() for proxied commands.
The init() is required for all commands that print something, because
otherwise the doveadm_print_header*() isn't called and the commands crash.
The reason for the original change was that some commands' init() attempted
to do too much work on the proxy, which ended up failing. So looks like the
proper fix is to just remove this kind of extra work from init().
Timo Sirainen [Fri, 6 Feb 2015 16:18:10 +0000 (18:18 +0200)]
lib: Added module_dir_try_load_missing() that returns error instead of logging it.
Also module_names now can be given for it without i_fatal() being called.
Timo Sirainen [Fri, 6 Feb 2015 15:06:36 +0000 (17:06 +0200)]
lib-storage: Set the user log prefix earlier when initializing user.
So the full prefix with session and other useful information is included in
the log message as early as possible. Some fatal/panic errors wouldn't even
have shown the username.
Timo Sirainen [Thu, 5 Feb 2015 17:40:25 +0000 (19:40 +0200)]
dsync: Fixed crash in earlier patch if node didn't have a namespace.
This shouldn't have happened except in test-dsync-mailbox-tree-sync, but
easier and safer to fix it here.
Timo Sirainen [Thu, 5 Feb 2015 17:36:29 +0000 (19:36 +0200)]
dsync: Added assert to make sure namespace prefix isn't attempted to be renamed.
This can happen, I'm just not sure how exactly.. The previous behavior
caused assert-crashes also, this change just makes it happen earlier.
Timo Sirainen [Thu, 5 Feb 2015 17:20:17 +0000 (19:20 +0200)]
dsync: Don't assert-crash in configs where INBOX doesn't have a parent namespace.
The inbox=yes namespace of course exists, but if there is no prefix="" or
prefix=INBOX/ namespace, then INBOX doesn't clearly belong to any namespace.
Timo Sirainen [Tue, 3 Feb 2015 18:27:49 +0000 (20:27 +0200)]
dsync: Make sure when fixing mailbox names we don't try to change the namespace prefix.
Although in normal installations this it wouldn't have happened in any case.
Timo Sirainen [Tue, 3 Feb 2015 16:33:12 +0000 (18:33 +0200)]
imapc: Added imapc_features=search support for sending SEARCH commands.
Currently requires the remote server to support ESEARCH (but this would be
easy to avoid). This is only minimally tested for now, so bugs may exist
(especially related to sub-queries).
Timo Sirainen [Tue, 3 Feb 2015 08:15:38 +0000 (10:15 +0200)]
lib-imap-client: Implemented support for GMail [THROTTLED] resp-text-code.
If we receive it, start throttling future commands by waiting exponentially
longer until we no longer receive [THROTTLED]. Max wait time is currently
16 seconds.
Stephan Bosch [Mon, 2 Feb 2015 21:48:30 +0000 (23:48 +0200)]
lib-http: client: Fixed double unref of request when error occurs during http_client_request_try_retry().
Much like when the request is first submitted, any errors that occur while attempting a retry from within the callback are now delayed in a zero timer.
Phil Carmody [Mon, 2 Feb 2015 08:24:42 +0000 (10:24 +0200)]
lib: array - two helpers to avoid wasteful array_count
There's no need to dereference array->element_size and
perform a division when all you care about is the boolean
isempty/nonempty predicate:
Changing 6 of them has the following impact on the code:
$ size src/lib-imap-client/imapc-connection.o
text data bss dec hex filename
20879 0 4 20883 5193 src/lib-imap-client/imapc-connection.o
$ size src/lib-imap-client/imapc-connection.o
text data bss dec hex filename
20796 0 4 20800 5140 src/lib-imap-client/imapc-connection.o