]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agolib-storage: mailbox_list_index - Don't overwrite INBOX's flags with prefix/INBOX's
Timo Sirainen [Thu, 14 Dec 2017 00:11:28 +0000 (02:11 +0200)] 
lib-storage: mailbox_list_index - Don't overwrite INBOX's flags with prefix/INBOX's

This made the real INBOX appear as if it was \NoSelect

7 years agolib-storage: mailbox_list_index - indentation cleanup
Timo Sirainen [Thu, 14 Dec 2017 00:10:27 +0000 (02:10 +0200)] 
lib-storage: mailbox_list_index - indentation cleanup

7 years agolib-storage: mailbox_list_index - List prefix/INBOX if it necessary
Timo Sirainen [Wed, 13 Dec 2017 23:39:32 +0000 (01:39 +0200)] 
lib-storage: mailbox_list_index - List prefix/INBOX if it necessary

7 years agoLAYOUT=fs: Fix listing prefix/INBOX
Timo Sirainen [Wed, 13 Dec 2017 23:36:50 +0000 (01:36 +0200)] 
LAYOUT=fs: Fix listing prefix/INBOX

Removed some confusing special case code that didn't seem to work very well.
Implemented this now properly so that prefix/INBOX is listed as \NoSelect
mailbox whenever it has children.

It's not actually possible to differentiate between INBOX and prefix/INBOX
in the storage for a inbox=yes namespace, because they both are converted
into the same storage_name=INBOX.

7 years agoLAYOUT=fs: List INBOX as \NoInferiors when necessary
Timo Sirainen [Wed, 13 Dec 2017 23:34:25 +0000 (01:34 +0200)] 
LAYOUT=fs: List INBOX as \NoInferiors when necessary

7 years agoLAYOUT=index: List INBOX as \NoInferiors when necessary
Timo Sirainen [Wed, 13 Dec 2017 23:31:10 +0000 (01:31 +0200)] 
LAYOUT=index: List INBOX as \NoInferiors when necessary

7 years agoLAYOUT=Maildir++: List INBOX as \NoInferiors when necessary
Timo Sirainen [Wed, 13 Dec 2017 23:23:45 +0000 (01:23 +0200)] 
LAYOUT=Maildir++: List INBOX as \NoInferiors when necessary

7 years agolib-storage: Add mail_namespace_is_inbox_noinferiors()
Timo Sirainen [Wed, 13 Dec 2017 23:23:01 +0000 (01:23 +0200)] 
lib-storage: Add mail_namespace_is_inbox_noinferiors()

7 years agoimapc: Don't skip listing "INBOX" when INBOX/ namespace prefix is used.
Timo Sirainen [Fri, 8 Dec 2017 14:14:11 +0000 (16:14 +0200)] 
imapc: Don't skip listing "INBOX" when INBOX/ namespace prefix is used.

The INBOX was still listed as part of the autocreated mailboxes, unless
MAILBOX_LIST_ITER_NO_AUTO_BOXES was used.

7 years agopop3: Include mail user variables in logout format
Aki Tuomi [Mon, 4 Dec 2017 09:18:24 +0000 (11:18 +0200)] 
pop3: Include mail user variables in logout format

7 years agopop3: Simplify logout format variable handling
Aki Tuomi [Mon, 4 Dec 2017 09:15:15 +0000 (11:15 +0200)] 
pop3: Simplify logout format variable handling

7 years agoimap: Include mail user variables in logout format
Aki Tuomi [Mon, 4 Dec 2017 09:04:09 +0000 (11:04 +0200)] 
imap: Include mail user variables in logout format

7 years agoimap: Simplify logout format variable handling
Aki Tuomi [Mon, 4 Dec 2017 09:03:45 +0000 (11:03 +0200)] 
imap: Simplify logout format variable handling

7 years agolib-storage: Log an error when mailbox list index is rebuilt due to header fsck flag
Timo Sirainen [Wed, 29 Nov 2017 13:20:29 +0000 (15:20 +0200)] 
lib-storage: Log an error when mailbox list index is rebuilt due to header fsck flag

7 years agolib-storage: Rebuild list index when doing doveadm force-resync
Timo Sirainen [Wed, 29 Nov 2017 13:14:02 +0000 (15:14 +0200)] 
lib-storage: Rebuild list index when doing doveadm force-resync

7 years agoLAYOUT=index: Rebuild list index if INBOX is missing on inbox=yes namespace
Timo Sirainen [Wed, 29 Nov 2017 12:51:02 +0000 (14:51 +0200)] 
LAYOUT=index: Rebuild list index if INBOX is missing on inbox=yes namespace

This avoids having to manually rebuild the list index afterwards if it
becomes lost.

7 years agolib-storage: Add rebuild reason for mail_storage.list_index_corrupted()
Timo Sirainen [Wed, 29 Nov 2017 13:39:45 +0000 (15:39 +0200)] 
lib-storage: Add rebuild reason for mail_storage.list_index_corrupted()

This is done in a bit kludgy way to keep API backwards compatible.
v2.3 cleans this up.

7 years agolib-storage: Remove obsolete comment
Timo Sirainen [Wed, 29 Nov 2017 12:38:38 +0000 (14:38 +0200)] 
lib-storage: Remove obsolete comment

7 years agodirector: Fix logging disconnection error reasons
Timo Sirainen [Tue, 28 Nov 2017 17:01:19 +0000 (19:01 +0200)] 
director: Fix logging disconnection error reasons

The previous commit set errno=0, which weren't logged. If error string is
provided, it doesn't matter what the errno is set (as long as it's not 0),
so we'll just use EINVAL.

7 years agodirector: Log connection stats for all types of disconnections
Timo Sirainen [Tue, 28 Nov 2017 13:06:27 +0000 (15:06 +0200)] 
director: Log connection stats for all types of disconnections

7 years agodirector: Log whether connection is synced when it's being disconnected.
Timo Sirainen [Tue, 28 Nov 2017 12:57:27 +0000 (14:57 +0200)] 
director: Log whether connection is synced when it's being disconnected.

7 years agodirector: Fix crash when handling expired USER timestamps.
Timo Sirainen [Tue, 28 Nov 2017 11:10:35 +0000 (13:10 +0200)] 
director: Fix crash when handling expired USER timestamps.

The fix in 154f91726624265fce15097eb4bbbf6e55f8c477 wasn't complete.

7 years agolib-storage: Fix sorting mails with the same primary sort key
Timo Sirainen [Fri, 24 Nov 2017 10:31:22 +0000 (12:31 +0200)] 
lib-storage: Fix sorting mails with the same primary sort key

The sorting order may have been wrong when there was a combination of:
 * Messages were sorted by a string (e.g. Subject)
 * Some messages had the same sort key (e.g. same base subject)
 * Within the messages with the same sort key, some of the messages already
   had the "sort-*" index number in Dovecot indexes, but some of them
   didn't.

The result was that Dovecot found that the two messages had exactly the same
sort key. It should have continued with the secondary sort key (e.g.
message sequence number), but it didn't.

7 years agodirector: Fix logging of uninitialized PONG buffer size
Timo Sirainen [Mon, 27 Nov 2017 09:58:39 +0000 (11:58 +0200)] 
director: Fix logging of uninitialized PONG buffer size

PONG always has 0 or 2 parameters. The easiest fix here is to just not even
try to support 1 parameter.

7 years agodirector: Fix delayed request count in ps title after request timeouts
Timo Sirainen [Sun, 26 Nov 2017 21:00:30 +0000 (23:00 +0200)] 
director: Fix delayed request count in ps title after request timeouts

The timeouts weren't shrinking the delayed request count. This didn't cause
any other problems.

7 years agodirector: DIRECTOR-LIST - Return results sorted by host
Timo Sirainen [Sun, 26 Nov 2017 10:33:33 +0000 (12:33 +0200)] 
director: DIRECTOR-LIST - Return results sorted by host

7 years agodirector: DIRECTOR-LIST - Move connection/host output to their own functions
Timo Sirainen [Sun, 26 Nov 2017 10:26:27 +0000 (12:26 +0200)] 
director: DIRECTOR-LIST - Move connection/host output to their own functions

7 years agodirector: Make director_host_cmp_p() public
Timo Sirainen [Sun, 26 Nov 2017 10:36:54 +0000 (12:36 +0200)] 
director: Make director_host_cmp_p() public

7 years agodirector: Improve PING/PONG timeout errors and add new warnings
Timo Sirainen [Fri, 24 Nov 2017 16:46:19 +0000 (18:46 +0200)] 
director: Improve PING/PONG timeout errors and add new warnings

Log a warning if PING-PONG takes over 5 secs in total, or also if the
recipient notices that the PING took >= 5 seconds to receive.

7 years agodirector: Add director_ping_idle/max_timeout setting.
Timo Sirainen [Fri, 24 Nov 2017 16:22:04 +0000 (18:22 +0200)] 
director: Add director_ping_idle/max_timeout setting.

director_ping_idle_timeout is used when there's otherwise no input coming
from the connection. Changed its default from 10 secs to 30 secs.

director_ping_max_timeout is used when the other director keeps sending
input, but among it is no PONG reply.

7 years agodirector: Log exactly how long PING was waited on before it timed out.
Timo Sirainen [Fri, 24 Nov 2017 16:18:45 +0000 (18:18 +0200)] 
director: Log exactly how long PING was waited on before it timed out.

7 years agodirector: DIRECTOR-LIST - Add "ring " prefix to self's status
Timo Sirainen [Sun, 26 Nov 2017 10:20:26 +0000 (12:20 +0200)] 
director: DIRECTOR-LIST - Add "ring " prefix to self's status

This is to make it a bit easier to understand the difference between a
connection's "handshaking" state vs. "ring handshaking" state.

7 years agodirector: DIRECTOR-LIST - Show number of USERs sent/received in "handshaking" state
Timo Sirainen [Sun, 26 Nov 2017 10:19:36 +0000 (12:19 +0200)] 
director: DIRECTOR-LIST - Show number of USERs sent/received in "handshaking" state

7 years agodirector: Include number of users sent in handshake in disconnection log lines
Timo Sirainen [Sun, 26 Nov 2017 10:13:35 +0000 (12:13 +0200)] 
director: Include number of users sent in handshake in disconnection log lines

7 years agodirector: Show number of incoming USERs/sec in ps title
Timo Sirainen [Sun, 26 Nov 2017 01:45:00 +0000 (03:45 +0200)] 
director: Show number of incoming USERs/sec in ps title

7 years agodirector: Include number of USERs received in disconnection log lines
Timo Sirainen [Sat, 25 Nov 2017 21:28:12 +0000 (23:28 +0200)] 
director: Include number of USERs received in disconnection log lines

Separate handshake and refresh USERs.

7 years agodirector: Don't send USERs in handshake that were already sent between handshake
Timo Sirainen [Sat, 25 Nov 2017 08:01:31 +0000 (10:01 +0200)] 
director: Don't send USERs in handshake that were already sent between handshake

If the user was refreshed since the handshake was started, it means that
the same user was already sent to the other side (added to the stream
immediately after it was received/handled). There's no need to send it
again.

This fixes a potentally infinite handshake when users are rapidly changing
and the handshake iterator never sees the end of the list. (Each refreshed
user is moved to the end of the list, so handshaking can keep sending the
same user over and over again.)

7 years agodirector: Delay sorting users until there are no more user iterators
Timo Sirainen [Sat, 25 Nov 2017 08:05:27 +0000 (10:05 +0200)] 
director: Delay sorting users until there are no more user iterators

This shouldn't have normally happened. Only when an outgoing handshake was
going on at the same time as a) another outgoing handshake was going on, or
b) doveadm was doing HOST-RESET-USERS

7 years agodirector: Avoid USER loops with >1s ring latency also with old directors
Timo Sirainen [Sat, 25 Nov 2017 23:31:08 +0000 (01:31 +0200)] 
director: Avoid USER loops with >1s ring latency also with old directors

Do this by ignoring USER refreshes that were already updated recently.
The "recently" is calculated by director_user_expire/4 seconds ago, but
with an upper limit of 15 secs. This means that the USER loops can now
only exist if the director ring latency is above 15 seconds. (Once all
directors in the ring are running the new version, there's no looping
at any latency.)

7 years agodirector: Avoid USER loops when ring latency is over 1 second
Timo Sirainen [Sat, 25 Nov 2017 23:19:35 +0000 (01:19 +0200)] 
director: Avoid USER loops when ring latency is over 1 second

Do this by adding a timestamp parameter to USER events. This way if it
takes over 1 second for the USER event to traverse the ring, it won't get
into an infinite loop getting the user updated over and over again.

7 years agodirector: Replace USER command during handshake with "U"
Timo Sirainen [Sat, 25 Nov 2017 23:14:01 +0000 (01:14 +0200)] 
director: Replace USER command during handshake with "U"

This clearly differentiates the two commands and allows extending the USER
command with new parameters without mixing it up with the handshake-USER.

7 years agodirector: Ignore refresh requests for already expired user timestamps
Timo Sirainen [Sat, 25 Nov 2017 23:06:43 +0000 (01:06 +0200)] 
director: Ignore refresh requests for already expired user timestamps

7 years agodirector: Keep users unsorted during handshake and sort them at the end
Timo Sirainen [Fri, 17 Nov 2017 11:24:59 +0000 (13:24 +0200)] 
director: Keep users unsorted during handshake and sort them at the end

This is simpler and sometimes more efficient than the current way of
immediately inserting the users to the correct place in the linked list.
This is especially useful if handshaking is mixed with regular USER updates,
because each switch between them required walking the linked list backwards
to find the proper insert position.

It's not a big problem if the users list is temporarily unordered. It mainly
means that some of the users won't be expired as early as they should have.

7 years agodirector: Make sure users are sorted after unfinished handshake
Timo Sirainen [Fri, 17 Nov 2017 16:53:18 +0000 (18:53 +0200)] 
director: Make sure users are sorted after unfinished handshake

The users were sorted after the handshake was finished, but if the
connection was closed before that hapepned, the users were left
unsorted. This could have caused the users to not expire early
enough.

7 years agodirector: Make sure user's timestamp isn't set to future
Timo Sirainen [Fri, 17 Nov 2017 12:56:20 +0000 (14:56 +0200)] 
director: Make sure user's timestamp isn't set to future

The sending director could have the system clock slightly in the future.

7 years agodirector: Make sure a missing right-side connection is always reconnected
Timo Sirainen [Wed, 15 Nov 2017 22:53:34 +0000 (00:53 +0200)] 
director: Make sure a missing right-side connection is always reconnected

This code shouldn't be needed, but add it just to be sure.

7 years agodirector: Reconnect after detecting a write failure to director
Timo Sirainen [Wed, 15 Nov 2017 22:44:17 +0000 (00:44 +0200)] 
director: Reconnect after detecting a write failure to director

If disconnection is detected during write failure, or "Output buffer full"
occurs, the connection is disconnected. However, if this was the right side
connection, it wasn't automatically reconnected to. This left the ring
nonworking.

7 years agolib-http: client: Send empty payload (Content-Length: 0) for requests that normally...
Stephan Bosch [Wed, 20 Sep 2017 22:38:33 +0000 (00:38 +0200)] 
lib-http: client: Send empty payload (Content-Length: 0) for requests that normally expect a payload.

This includes the standard POST and PUT methods.
Others need to use the new http_client_request_set_payload_empty() function to force sending an empty payload.

7 years agodirector: Fix director_max_parallel_moves/kicks type
Timo Sirainen [Thu, 9 Nov 2017 10:24:16 +0000 (12:24 +0200)] 
director: Fix director_max_parallel_moves/kicks type

Should be uint, not time.

7 years agolib-storage: When copying mails, copy also empty cache fields
Timo Sirainen [Mon, 6 Nov 2017 16:59:34 +0000 (18:59 +0200)] 
lib-storage: When copying mails, copy also empty cache fields

This mainly means that it copies cache fields for nonexistent message
headers. Those are still important, because otherwise Dovecot doesn't know
whether they exist or not.

7 years agodirector: Add director_max_parallel_moves/kicks settings
Timo Sirainen [Tue, 7 Nov 2017 15:36:05 +0000 (17:36 +0200)] 
director: Add director_max_parallel_moves/kicks settings

The director_max_parallel_moves setting controls the default limit, which
can still be increased by explicitly using the doveadm director flush
--max-parallel" parameter.

7 years agodirector: Limit max kicking count
Aki Tuomi [Mon, 6 Nov 2017 08:36:07 +0000 (10:36 +0200)] 
director: Limit max kicking count

7 years agodirector: Add kick_callback to director
Aki Tuomi [Tue, 7 Nov 2017 12:34:32 +0000 (14:34 +0200)] 
director: Add kick_callback to director

This callback gets called whenever director has performed
a kick.

7 years ago*-login: Add login_proxy_notify_path setting to configure proxy-notify path
Timo Sirainen [Fri, 27 Oct 2017 13:45:16 +0000 (16:45 +0300)] 
*-login: Add login_proxy_notify_path setting to configure proxy-notify path

A single FIFO can be a bottleneck, so this could be set to e.g.:

login_proxy_notify_path = proxy-notify%1R{pid}

or:

login_proxy_notify_path = proxy-notify%10N{pid}

7 years agodirector: Allow proxy-notify to optionally be a socket
Timo Sirainen [Fri, 27 Oct 2017 13:24:54 +0000 (16:24 +0300)] 
director: Allow proxy-notify to optionally be a socket

Dovecot isn't using this currently, but it can be useful if external
services want to send notifications.

7 years agodirector: Support multiple proxy-notify connections
Timo Sirainen [Fri, 27 Oct 2017 13:20:15 +0000 (16:20 +0300)] 
director: Support multiple proxy-notify connections

7 years agodirector: Make sure HOST-RESET-USERS isn't used with max_moving_users=0
Timo Sirainen [Sun, 5 Nov 2017 21:51:56 +0000 (23:51 +0200)] 
director: Make sure HOST-RESET-USERS isn't used with max_moving_users=0

The reset command would just hang in that case. doveadm would never have
sent this, so this is just an extra sanity check.

7 years agodirector: Show in process title how many users are being kicked.
Timo Sirainen [Sun, 5 Nov 2017 21:27:36 +0000 (23:27 +0200)] 
director: Show in process title how many users are being kicked.

7 years agodirector: Show in process title how many requests are being delayed.
Timo Sirainen [Sun, 5 Nov 2017 21:01:56 +0000 (23:01 +0200)] 
director: Show in process title how many requests are being delayed.

7 years agodirector: Log an error if login process sends unexpected reply to KICK* commands
Timo Sirainen [Mon, 6 Nov 2017 08:57:03 +0000 (10:57 +0200)] 
director: Log an error if login process sends unexpected reply to KICK* commands

7 years agodirector: Log whenever HOST-RESET-USERS is used
Timo Sirainen [Sun, 5 Nov 2017 20:53:23 +0000 (22:53 +0200)] 
director: Log whenever HOST-RESET-USERS is used

7 years agodirector: Include used CPU secs in director connection log messages
Timo Sirainen [Sun, 5 Nov 2017 20:38:27 +0000 (22:38 +0200)] 
director: Include used CPU secs in director connection log messages

It's counting the process's full CPU seconds used since the handshake
started, so it's not specific to the connection itself. Still, this is
likely to be very useful in debugging whether a slow handshake was due
to CPU usage or something else.

7 years agodirector: Deduplicate code into director_connection_set_connected()
Timo Sirainen [Sun, 5 Nov 2017 20:37:27 +0000 (22:37 +0200)] 
director: Deduplicate code into director_connection_set_connected()

7 years agodirector: Include peak output buffer size in director connection log messages
Timo Sirainen [Sun, 5 Nov 2017 20:27:41 +0000 (22:27 +0200)] 
director: Include peak output buffer size in director connection log messages

7 years agodirector: Don't block too long when sending users during director handshake
Timo Sirainen [Sun, 5 Nov 2017 23:30:13 +0000 (01:30 +0200)] 
director: Don't block too long when sending users during director handshake

All the other work is blocked while the users are being sent.

7 years agolib: str_parse/to_*int*() - minor optimization
Timo Sirainen [Sun, 5 Nov 2017 19:36:55 +0000 (21:36 +0200)] 
lib: str_parse/to_*int*() - minor optimization

7 years agodirector: Avoid str_printfa() in director_connection_send_users()
Timo Sirainen [Sat, 4 Nov 2017 13:29:29 +0000 (15:29 +0200)] 
director: Avoid str_printfa() in director_connection_send_users()

Optimizes the CPU usage.

7 years agodirector: Avoid str_printfa() in login_host_callback()
Timo Sirainen [Sat, 4 Nov 2017 00:17:55 +0000 (02:17 +0200)] 
director: Avoid str_printfa() in login_host_callback()

Optimizes the CPU usage.

7 years agodirector: Change request callback to take mail_host parameter
Timo Sirainen [Sat, 4 Nov 2017 00:05:26 +0000 (02:05 +0200)] 
director: Change request callback to take mail_host parameter

This allows accessing the IP address both as struct and as string without
any conversions.

7 years agodirector: Use *_host.ip_str to avoid net_ip2addr() calls
Timo Sirainen [Fri, 3 Nov 2017 23:59:27 +0000 (01:59 +0200)] 
director: Use *_host.ip_str to avoid net_ip2addr() calls

7 years agodirector: Add director_host.ip_str
Timo Sirainen [Fri, 3 Nov 2017 23:51:25 +0000 (01:51 +0200)] 
director: Add director_host.ip_str

This avoids having to use net_ip2addr() all the time to convert it into a
string.

7 years agodirector: Add mail_host.ip_str
Timo Sirainen [Fri, 3 Nov 2017 23:49:29 +0000 (01:49 +0200)] 
director: Add mail_host.ip_str

This avoids having to use net_ip2addr() all the time to convert it into a
string.

7 years agodirector: Use t_strsplit_tabescaped_inplace() for director connection input
Timo Sirainen [Fri, 3 Nov 2017 23:48:41 +0000 (01:48 +0200)] 
director: Use t_strsplit_tabescaped_inplace() for director connection input

7 years agolib: net_addr2ip() - Optimize for parsing IPv4 addresses
Timo Sirainen [Fri, 3 Nov 2017 23:43:41 +0000 (01:43 +0200)] 
lib: net_addr2ip() - Optimize for parsing IPv4 addresses

7 years agolib: net_ip2addr() - Optimize by allocating destination memory immediately
Timo Sirainen [Fri, 3 Nov 2017 23:42:37 +0000 (01:42 +0200)] 
lib: net_ip2addr() - Optimize by allocating destination memory immediately

It doesn't really matter if we allocate a few extra bytes.

7 years agolib: *_strsplit() - implement more efficient version for a single separator char
Timo Sirainen [Fri, 3 Nov 2017 23:40:24 +0000 (01:40 +0200)] 
lib: *_strsplit() - implement more efficient version for a single separator char

7 years agolib: Implement t_strsplit_tabescaped_inplace()
Timo Sirainen [Fri, 3 Nov 2017 23:39:38 +0000 (01:39 +0200)] 
lib: Implement t_strsplit_tabescaped_inplace()

This is a more efficient version of t_strsplit_tabescaped(), which modifies
the input string instead of duplicating it.

7 years agolib: t_strsplit_tabescaped() - don't create unnecessary data stack mempool
Timo Sirainen [Fri, 3 Nov 2017 23:37:19 +0000 (01:37 +0200)] 
lib: t_strsplit_tabescaped() - don't create unnecessary data stack mempool

unsafe_data_stack_pool is more efficient to use

7 years agolib: str_tabunescape() - optimize initial escape char lookup
Timo Sirainen [Fri, 3 Nov 2017 23:35:44 +0000 (01:35 +0200)] 
lib: str_tabunescape() - optimize initial escape char lookup

strchr() is faster than looping ourself.

7 years agodirector: Don't recreate timeout on every user lookup
Timo Sirainen [Fri, 3 Nov 2017 23:34:02 +0000 (01:34 +0200)] 
director: Don't recreate timeout on every user lookup

Recreate it only when the timeout should change.

7 years agodirector: Fix off-by-one when checking if user weakness is stuck
Timo Sirainen [Sun, 5 Nov 2017 21:11:25 +0000 (23:11 +0200)] 
director: Fix off-by-one when checking if user weakness is stuck

When the weakness was exactly at the second, the weakness wasn't detected
and the next expiration timeout was removed entirely. This shouldn't have
caused any bigger problems, because another user lookup on the following
second would have then detected the weakness, removed the user and restored
the next expiration timeout.

7 years agodirector: Show each director connection in doveadm DIRECTOR-LIST
Timo Sirainen [Thu, 26 Oct 2017 10:56:25 +0000 (13:56 +0300)] 
director: Show each director connection in doveadm DIRECTOR-LIST

Previously the host was shown only once, regardless of how many connections
it had. This especially helps when there are just two directors, but also
can be useful when showing incoming/outgoing connections that are still
in handshaking phase.

7 years agodoveadm director ring status: Add more fields related to connection status
Timo Sirainen [Thu, 26 Oct 2017 11:10:51 +0000 (14:10 +0300)] 
doveadm director ring status: Add more fields related to connection status

7 years agodirector: Track show long the last ring sync took.
Timo Sirainen [Thu, 26 Oct 2017 11:18:50 +0000 (14:18 +0300)] 
director: Track show long the last ring sync took.

7 years agodirector: Track connections' last ping time
Timo Sirainen [Thu, 26 Oct 2017 11:07:56 +0000 (14:07 +0300)] 
director: Track connections' last ping time

7 years agodirector: Add director_connection_get_status()
Timo Sirainen [Thu, 26 Oct 2017 10:07:30 +0000 (13:07 +0300)] 
director: Add director_connection_get_status()

Can be used to access connection-specific status information.

7 years agodirector: Fix updating director connection's last_output timestamp
Timo Sirainen [Thu, 26 Oct 2017 10:02:32 +0000 (13:02 +0300)] 
director: Fix updating director connection's last_output timestamp

It was previously updated only in ostream's flush callback, which was called
only when there were a lot of output. This only caused the "last output"
timestamp in disconnection log lines to be wrong.

7 years agodoveadm director: Parse timestamp parameters with str_to_time()
Timo Sirainen [Thu, 26 Oct 2017 09:44:34 +0000 (12:44 +0300)] 
doveadm director: Parse timestamp parameters with str_to_time()

7 years agodirector: Close director connection immediately when output buffer is full
Timo Sirainen [Wed, 25 Oct 2017 14:22:42 +0000 (17:22 +0300)] 
director: Close director connection immediately when output buffer is full

Only the ostream was closed, which didn't actually cause the disconnection
until the other side closed the connection.

7 years agodirector: Add director_output_buffer_size setting
Timo Sirainen [Wed, 25 Oct 2017 14:18:03 +0000 (17:18 +0300)] 
director: Add director_output_buffer_size setting

This allows configuring the max buffer size for outgoing connections.
Previously it was hardcoded to 10 MB, which wasn't necessarily enough for
very busy directors.

7 years agolib-fs: Fix fs_wrapper_write_stream_finish() to work with async parent fs
Timo Sirainen [Mon, 16 Oct 2017 10:53:58 +0000 (13:53 +0300)] 
lib-fs: Fix fs_wrapper_write_stream_finish() to work with async parent fs

This only became a problem with the previous fs-compress change.

7 years agolib-storage: Fix assert-crash when searching header and MIMEPART
Timo Sirainen [Thu, 19 Oct 2017 11:39:01 +0000 (14:39 +0300)] 
lib-storage: Fix assert-crash when searching header and MIMEPART

For now this is just a bit kludgy workaround. The proper fix requires
larger changes, which aren't worth the effort right now.

For example:
doveadm fetch -u testuser uid MAILBOX inbox FROM foo MIMEPART FILENAME CONTAINS bar BODY baz

Crashes with:
Panic: file index-mail-headers.c: line 294 (index_mail_parse_header): assertion failed: (part != NULL)

7 years agoauth: Fix %{ldap_dn} not to leak memory
Timo Sirainen [Thu, 19 Oct 2017 12:39:28 +0000 (15:39 +0300)] 
auth: Fix %{ldap_dn} not to leak memory

7 years agoacl plugin: avoid "'struct stat' declared inside parameter list" warning
Josef 'Jeff' Sipek [Wed, 11 Oct 2017 20:33:57 +0000 (16:33 -0400)] 
acl plugin: avoid "'struct stat' declared inside parameter list" warning

7 years agoAdded "ULL" to the hex literals that needed it.
Bill Cole [Tue, 10 Oct 2017 21:40:04 +0000 (17:40 -0400)] 
Added "ULL" to the hex literals that needed it.

On 32-bit platforms with older compilers (e.g. gcc 4.2 on MacOS 10.6
running on a 1st-gen Core Duo) a 'long' is 4 bytes and the compiler does
not automatically use a 'long long' when needed, but instead generates
an error. e.g.:

libtool: compile:  /usr/bin/g++-4.2 -DHAVE_CONFIG_H -I. -I../../.. -I../../../src/lib -I../../../src/lib-mail -I../../../src/lib-index -I../../../src/lib-storage -I../../../src/plugins/fts -I../../../src/doveadm -I/opt/local/include/openssl -I/opt/local/include -I/opt/local/include/CLucene/ext -pipe -Os -arch i386 -D__STDC_LIMIT_MACROS -MT lucene-wrapper.lo -MD -MP -MF .deps/lucene-wrapper.Tpo -c lucene-wrapper.cc  -fno-common -DPIC -o .libs/lucene-wrapper.o
In file included from ../../../src/lib/lib.h:33,
                 from lucene-wrapper.cc:4:
../../../src/lib/byteorder.h:94: error: integer constant is too large for ‘long’ type
../../../src/lib/byteorder.h:95: error: integer constant is too large for ‘long’ type
../../../src/lib/byteorder.h:96: error: integer constant is too large for ‘long’ type
../../../src/lib/byteorder.h:97: error: integer constant is too large for ‘long’ type
make[4]: *** [lucene-wrapper.lo] Error 1

Adding the 'ULL' to the end of the 16-digit hex literals that are used
to test the structure of 64-bit integers fixes this and avoids any
problem which could arise from the compiler using a 32-bit type for
those literals that could fit in 32 bites.

7 years agocassandra: Support "timestamp" type fields properly
Timo Sirainen [Mon, 16 Oct 2017 12:41:56 +0000 (15:41 +0300)] 
cassandra: Support "timestamp" type fields properly

Fixes setting them with prepared statements. Reading them never worked
earlier.

7 years agocassandra: Include "prepared" when logging about prepared statement queries
Timo Sirainen [Mon, 16 Oct 2017 12:12:12 +0000 (15:12 +0300)] 
cassandra: Include "prepared" when logging about prepared statement queries

Mainly useful for debugging/testing.

7 years agocassandra: Fix using bigint types with unprepared statements
Timo Sirainen [Mon, 16 Oct 2017 11:49:56 +0000 (14:49 +0300)] 
cassandra: Fix using bigint types with unprepared statements

This reverts the code to not using the statements with binding at all.
Alternative fix would be to start using explicit int32 or int64 parameter
types, but that breaks backwards compatibility a bit.

7 years agodoveadm proxy: Don't crash if remote doesn't support log proxying
Timo Sirainen [Sat, 14 Oct 2017 09:54:18 +0000 (12:54 +0300)] 
doveadm proxy: Don't crash if remote doesn't support log proxying

7 years agofs-compress: Allow compress level 0 to skip compression
Timo Sirainen [Fri, 13 Oct 2017 09:34:01 +0000 (12:34 +0300)] 
fs-compress: Allow compress level 0 to skip compression

This can be useful when combined with the "maybe-" prefix, so Dovecot will
support reading compressed files without creating new ones.