Timo Sirainen [Mon, 5 Aug 2013 19:16:02 +0000 (22:16 +0300)]
lib-storage: Use a separate auth-userdb connection for iterating through users.
This is required because the auth-userdb connection is also wanted in the
middle of the iteration to do USER lookups.
Timo Sirainen [Mon, 5 Aug 2013 17:27:09 +0000 (20:27 +0300)]
mbox: Don't use file_set_size() to grow mbox file size.
posix_fallocate() apparently grows file size in 4kB blocks in GFS2 causing
extra NULs to be written. The mbox file rarely needs to grow so much that
there's any point in using any optimizations for it.
Besides, this was the last place where file_set_size() was used. If no
further use can be found for it, it could be removed entirely.
Timo Sirainen [Tue, 30 Jul 2013 10:26:07 +0000 (13:26 +0300)]
lib-storage: With temporary privilege dropping, switch to root before doing config lookup.
This fixes the problem of not having enough permissions to connect to the
config socket.
Timo Sirainen [Mon, 29 Jul 2013 19:08:26 +0000 (22:08 +0300)]
director: Expire users a bit more correctly.
Also make sure that the "user near expiring" interval is at least 3 seconds
in case director_user_expire is very low.
Timo Sirainen [Thu, 11 Jul 2013 23:17:31 +0000 (02:17 +0300)]
lib-storage: mail_storage_service_all_init() no longer returns total number of users.
In preperation for removing the count functionality, since it requires
reading all the users into memory for it to work.
This also required removing the /total from verbosity counter with
doveadm -A.
Timo Sirainen [Thu, 11 Jul 2013 07:25:32 +0000 (10:25 +0300)]
lib-http: Minor change to make sure http_response_header.size is always correct.
The current http-header-parser already guaranteed that it is, but this
change just adds extra guarantees that it won't break in future. Besides,
this change improves the performance slightly by avoiding strlen().
Timo Sirainen [Thu, 11 Jul 2013 06:23:14 +0000 (09:23 +0300)]
lib-http: Simplify http response status-line parsing code.
Also by not using a temporary string buffer the istream can at least in
theory limit the maximum status-line length (=max memory usage).
Timo Sirainen [Wed, 10 Jul 2013 06:37:06 +0000 (09:37 +0300)]
Maildir++ quota: When recreating, don't use maildirsize.lock file.
The point was never to even try to lock it, it just used to be an easier API
to create the file. Nowadays safe_mkstemp_hostpid_group() works just as
easily. This normally doesn't matter, but apparently Exim+CPanel leaves
maildirsize.lock files lying around, causing Dovecot to not update
maildirsize.
David Hicks [Sat, 6 Jul 2013 04:46:16 +0000 (14:46 +1000)]
login-common: Add support for ECDH/ECDHE cipher suites
ECDH temporary key parameter selection must be performed during OpenSSL
context initialisation before ECDH and ECDHE cipher suites can be used.
OpenSSL >= 1.0.2 automatically handles ECDH temporary key parameter selection.
For OpenSSL < 1.0.2 we must manually specify a named elliptic curve that
Dovecot will use to generate an ephemeral key pair. By default we try to use
the same named curve as that used in the server's private EC key file. If this
attempt fails, a fall back curve of NIST P-384 (secp384r1) is used instead.
RFC 6460 states that NIST P-384 MUST be used for cipher suites that include
AES-256. For cipher suites that include AES-128, RFC 6460 states that NIST
P-256 MUST be used. No matter which curve is used as a fall back option,
Dovecot will be non-compliant. The reason for selecting NIST P-384 as a fall
back curve is to ensure that the non-compliance is in the form of providing
too great a level of security for AES-128 cipher suites rather than too little
security for AES-256 cipher suites.
Timo Sirainen [Wed, 10 Jul 2013 03:54:57 +0000 (06:54 +0300)]
imapc: Reorganize code so that imapc_list works without imapc_storage.
Most importantly fixes crashes when imapc_list is trying to lookup hierarchy
separator before storage is created.
Timo Sirainen [Tue, 9 Jul 2013 22:44:40 +0000 (01:44 +0300)]
lib-http: Always try to connect to host's all IPs when connections fail.
Previously this was done only when the new connections started from the
first IP.
Timo Sirainen [Thu, 27 Jun 2013 19:49:50 +0000 (22:49 +0300)]
lib-http: When successfully connected to a peer, don't drop the peer's pending connections.
They could have been intentionally created for other urgent requests.