Timo Sirainen [Mon, 25 May 2015 15:50:48 +0000 (11:50 -0400)]
lib: Avoid race conditions in mkdir*() if directory is being deleted at the same time.
Mainly this allows the call to return failure silently without logging
unnecessary errors.
Pascal Volk [Mon, 25 May 2015 14:27:22 +0000 (14:27 +0000)]
systemd service: Fixed typos in the comment section.
The settings for the file descriptor limit is LimitNOFILE.
Removed quotes around the value infinity. Otherwise systemd will
fail to parse that resource value.
Timo Sirainen [Sun, 24 May 2015 21:40:53 +0000 (17:40 -0400)]
lib-storage: If session_id isn't given, generate a new one.
This is useful for tracking logs written by services that aren't directly
related to any specific user session.
Timo Sirainen [Fri, 22 May 2015 23:07:56 +0000 (19:07 -0400)]
auth: Don't crash if trying to add password with TAB or LF to auth cache.
This would happen only if the passwords were stored as plaintext in passdb
and the valid password actually contained TAB or LF.
Timo Sirainen [Fri, 22 May 2015 02:03:10 +0000 (22:03 -0400)]
lib-fts: ICU normalization changes some characters to spaces - remove them.
We don't really want to add spaces to our index. It would be nice if the
words between spaces were actually split to different tokens, but that's
more of the fts-tokenizer's job and at filter stage that's probably not
wanted anymore.
Teemu Huovila [Thu, 21 May 2015 10:29:15 +0000 (06:29 -0400)]
lib-fts: Fix simple tokenizer apostrophe handling.
Apostrophes and quotation marks are now treated as word breaks,
except U+0027 between non-wordbrek characters. The characters
U+2019 and U+FF07 are transformed to U+0027 before processing.
Timo Sirainen [Mon, 18 May 2015 11:53:52 +0000 (14:53 +0300)]
lib-fts: Partially reverted d097a9779c37 - don't use lib_atexit()
Because fts is loaded as plugin lib_atexit() is called after the plugin is
already unloaded, so it crashes.
Timo Sirainen [Mon, 18 May 2015 11:49:15 +0000 (07:49 -0400)]
director: Added "up" vs "down" states and doveadm director up/down commands.
These commands are intended to be used by automated watchdogs that detect if
backends are up or down. This way the vhost count doesn't get forgotten
after server goes down. It also means that admin can manually take down a
server by setting its vhost count to 0 without the watchdog automatically
bringing it back up.
Timo Sirainen [Sat, 16 May 2015 15:47:20 +0000 (18:47 +0300)]
lib-fts: Rewrite ICU handling functions.
Some of the changes:
- Use buffers instead of allocating everything from data stack.
- Optimistically attempt to write the data directly to the buffers without
first calculating their size. Grow the buffer if it doesn't fit first.
- Use u_strFromUTF8Lenient() instead of u_strFromUTF8(). Our input is
already supposed to be valid UTF-8, although we don't check if all code
points are valid, while u_strFromUTF8() does check them and return failures.
We don't really care about if code points are valid or not and
u_strFromUTF8Lenient() passes through everything.
Added unit tests to make sure all the functions work as intended and all the
UTF-8 input passes through them successfully.
Timo Sirainen [Sat, 16 May 2015 10:50:48 +0000 (13:50 +0300)]
lib-charset: Fixed compile warning caused by earlier commit.
This UNICODE_REPLACEMENT_CHAR_UTF8 part of the change was actually supposed
to be a separate commit..
Timo Sirainen [Fri, 15 May 2015 13:50:27 +0000 (16:50 +0300)]
doveadm director flush: Unless -F parameter is used, do the flush by moving users.
User moving causes the users to be properly kicked out of the old backends
before new connections are made to the new backends. This way the user isn't
accessed simultaneously by different backends.
Timo Sirainen [Fri, 15 May 2015 13:44:45 +0000 (16:44 +0300)]
director: Moving a user to another host sometimes caused the move to fail.
It could have given "User hash .. is being redirected to two hosts" error
and afterwards moved the user back to its original host.
Timo Sirainen [Fri, 15 May 2015 09:48:07 +0000 (12:48 +0300)]
Reverted d592417ec815 which added unnecessary code to Makefiles.
The original problem it tried to solve was properly fixed by 46969c4cc57e.
make will actually wait for processes to finish creating files before it
continues to the next program that wants to access the file. As long as the
dependencies are correct.
Timo Sirainen [Fri, 15 May 2015 08:15:50 +0000 (11:15 +0300)]
sdbox: When hardlink-copying a mail in alt storage, keep it within the alt storage.
Also make sure that the alt-flag is set correctly no matter where we copy
the mail.
Timo Sirainen [Thu, 14 May 2015 08:26:00 +0000 (11:26 +0300)]
director: UNIX auth sockets were wrongly detected as doveadm or ring sockets.
A workaround would be to use login/director-auth socket name instead of
login/director.
Timo Sirainen [Wed, 13 May 2015 16:24:55 +0000 (19:24 +0300)]
mbox: Fixed corruption in some usage patterns.
Something like:
- first mail is being expunged
- other mails are being rewritten and they get their space from the
expunged mail
- there's not enough space for the last mail to get space
- we add more space
- we'll now need to use up the space. We can't just decide to mark the
mails dirty.
Timo Sirainen [Wed, 13 May 2015 13:22:27 +0000 (16:22 +0300)]
director: Added "authreply" socket type.
This allows defining a socket, which receives auth replies. Director then
adds the "host" field to it if it's missing and returns back the original
string. The idea is that eventually a director ring could be running
independently from Dovecot proxies.
Timo Sirainen [Wed, 13 May 2015 12:47:14 +0000 (15:47 +0300)]
lib-master: If executing doveconf, use master_service_settings_input.service for filter
Instead of hardcoding to the master_service->name, which may be different.
This fixes reading protocol sieve {} settings when if managesieve was
reading settings via doveconf (= executed from command line).
Timo Sirainen [Wed, 13 May 2015 12:33:27 +0000 (15:33 +0300)]
director: Cleanup for director socket type configuration.
It's now possible to use any type of a socket for inet listeners by
specifying the name for the listener. The available types are: auth
(default), userdb, ring (= director<->director connection), admin/doveadm.
This change should be backwards compatible with previous configuration.
This setting also deprecates director_doveadm_port setting.
Timo Sirainen [Wed, 13 May 2015 02:25:31 +0000 (05:25 +0300)]
director: Added a new DIRECTOR-LOOKUP command that auth connections can use.
The parameters are the same as what auth lookup would receive from auth
process. So the idea is that a proxy could do an auth lookup, then forward
the reply to director, which would return back the updated reply with the
host field added.
Timo Sirainen [Tue, 12 May 2015 18:58:03 +0000 (21:58 +0300)]
lib: connection API: Added delayed_unix_client_connected_callback setting. 092a51d80bad commit changed this functionality first to fix lib-http code,
but it broke other code. 1fac17a2bc53 reversed the original behavior.
This change allows either behavior optionally.