]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agolib-storage: Replace "if(mail_debug){i_debug}" "e_debug"
Sergey Kitov [Tue, 20 Mar 2018 09:05:13 +0000 (11:05 +0200)] 
lib-storage: Replace "if(mail_debug){i_debug}" "e_debug"

7 years agolib-storage: Force mail_storage_service_user event debug when mail_debug=yes
Sergey Kitov [Thu, 24 May 2018 12:18:30 +0000 (15:18 +0300)] 
lib-storage: Force mail_storage_service_user event debug when mail_debug=yes

7 years agolda & lib-lda: "if(mail_debug){i_debug}" with "e_debug"
Sergey Kitov [Tue, 20 Mar 2018 08:51:21 +0000 (10:51 +0200)] 
lda & lib-lda: "if(mail_debug){i_debug}" with "e_debug"

7 years agoindexer: Replace "if(mail_debug){i_debug}" with "e_debug"
Sergey Kitov [Tue, 20 Mar 2018 08:49:08 +0000 (10:49 +0200)] 
indexer: Replace "if(mail_debug){i_debug}" with "e_debug"

7 years agoimap: Replace "if(mail_debug){i_debug}" with "e_debug"
Sergey Kitov [Tue, 20 Mar 2018 08:46:19 +0000 (10:46 +0200)] 
imap: Replace "if(mail_debug){i_debug}" with "e_debug"

7 years agolib-imap-urlauth & imap-urlauth: replace "if(mail_debug){i_debug}" with "e_debug...
Sergey Kitov [Tue, 20 Mar 2018 08:17:27 +0000 (10:17 +0200)] 
lib-imap-urlauth & imap-urlauth: replace "if(mail_debug){i_debug}" with "e_debug(client->event)"

7 years agoimap-urlauth: Add event with "imap-urlauth" category to struct client of imap-urlauth
Sergey Kitov [Tue, 20 Mar 2018 07:52:38 +0000 (09:52 +0200)] 
imap-urlauth: Add event with "imap-urlauth" category to struct client of imap-urlauth

7 years agoglobal: Replace check for auth_debug with event_want_debug_log in doveadm-auth::auth_...
Sergey Kitov [Tue, 20 Mar 2018 07:05:26 +0000 (09:05 +0200)] 
global: Replace check for auth_debug with event_want_debug_log in doveadm-auth::auth_connected()

These functions will create event with "auth" category and unref it in
the end.

7 years agoglobal: Replace "if(auth_debug){i_debug(...)}" with e_debug(event, ...)
Sergey Kitov [Mon, 19 Mar 2018 14:10:49 +0000 (16:10 +0200)] 
global: Replace "if(auth_debug){i_debug(...)}" with e_debug(event, ...)

event is one of: global auth::auth_event,
auth_client_connection->event, auth_request->event,
login-common::event_auth. These event have category "auth".

7 years agoglobal: Remove unnecessary checks for mail_debug and auth_request->debug
Sergey Kitov [Mon, 19 Mar 2018 12:50:31 +0000 (14:50 +0200)] 
global: Remove unnecessary checks for mail_debug and auth_request->debug

These checks are performed before calling auth_request_log_debug() and
push_notification_driver_debug(), while the same checks are performed
inside of these functions, and they return without doing anything.

7 years agoauth: Add event with category "auth" to struct auth_request.
Sergey Kitov [Mon, 19 Mar 2018 11:53:33 +0000 (13:53 +0200)] 
auth: Add event with category "auth" to struct auth_request.

7 years agoauth: Add event with category "auth" to struct auth_client_connection.
Sergey Kitov [Mon, 19 Mar 2018 10:16:23 +0000 (12:16 +0200)] 
auth: Add event with category "auth" to struct auth_client_connection.

7 years agologin-common: Add global event_auth with "auth" category.
Sergey Kitov [Mon, 19 Mar 2018 09:44:59 +0000 (11:44 +0200)] 
login-common: Add global event_auth with "auth" category.

7 years agolib: Add event_want_debug and event_want_debug_log macros
Sergey Kitov [Mon, 19 Mar 2018 09:20:58 +0000 (11:20 +0200)] 
lib: Add event_want_debug and event_want_debug_log macros

7 years agoauth: Add global auth_event with category "auth".
Sergey Kitov [Mon, 19 Mar 2018 09:14:22 +0000 (11:14 +0200)] 
auth: Add global auth_event with category "auth".

7 years agopop3c: Ensure pop3c index directory is autocreated
Aki Tuomi [Tue, 29 May 2018 08:53:15 +0000 (11:53 +0300)] 
pop3c: Ensure pop3c index directory is autocreated

Otherwise we might think that the box has been unexpectedly
autodeleted and pop3_migration will fail.

Broken by 91ee70ed04d33fecd7fc94621f236013d520d7b3

7 years agolib-dict-backend: Fix building --with-cdb --without-shared-libs
Timo Sirainen [Fri, 25 May 2018 11:44:10 +0000 (14:44 +0300)] 
lib-dict-backend: Fix building --with-cdb --without-shared-libs

7 years agolib: Fix filtering by event name in log_core_filter
Timo Sirainen [Sun, 27 May 2018 12:42:26 +0000 (15:42 +0300)] 
lib: Fix filtering by event name in log_core_filter

event->sending_name was already cleared by the time it was checked, so any
event:* filters never matched.

7 years agopush-notification: Add SSL support for OX driver
Michael Slusarz [Fri, 25 May 2018 03:43:42 +0000 (21:43 -0600)] 
push-notification: Add SSL support for OX driver

7 years agoimap: Log unhibernation debug message only with mail_debug=yes
Timo Sirainen [Sun, 27 May 2018 12:48:42 +0000 (15:48 +0300)] 
imap: Log unhibernation debug message only with mail_debug=yes

7 years agolib-smtp: client: Avoid sending an XCLIENT command longer than 512 bytes.
Stephan Bosch [Sat, 26 May 2018 12:49:01 +0000 (14:49 +0200)] 
lib-smtp: client: Avoid sending an XCLIENT command longer than 512 bytes.

Send several separate XCLIENT commands instead. This way, it complies with the
base SMTP line length limit and with Postfix' original specification for the
XCLIENT command.

With the XCLIENT fields that Dovecot currently uses, this is very unlikely to
happen. Still, this needs to be fixed to make things reliable.

7 years agolib-smtp: client: Do not start authentication before initial XCLIENT gets reply.
Stephan Bosch [Sun, 27 May 2018 09:30:06 +0000 (11:30 +0200)] 
lib-smtp: client: Do not start authentication before initial XCLIENT gets reply.

7 years agolib-smtp: server: Provide full proxy data to the conn_proxy_data_updated() callback.
Stephan Bosch [Sat, 26 May 2018 13:44:43 +0000 (15:44 +0200)] 
lib-smtp: server: Provide full proxy data to the conn_proxy_data_updated() callback.

Before, it would only provide the fields that were updated, meaning that some
fields would remain unset, which caused problems for LMTP when more than one
XCLIENT command was sent or the ADDR field was not specified.

7 years agoglobal: start relying on http_client_request_abort(NULL) being a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 23:13:30 +0000 (19:13 -0400)] 
global: start relying on http_client_request_abort(NULL) being a no-op

Cleanup performed with the following semantic patch:

@@
expression E;
@@

- if (E != NULL) {
-  http_client_request_abort(&E);
- }
+ http_client_request_abort(&E);

7 years agolib-http: http_client_request_abort(NULL) should be a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 23:11:35 +0000 (19:11 -0400)] 
lib-http: http_client_request_abort(NULL) should be a no-op

7 years agolda: Allow -f sender to omit domain.
Stephan Bosch [Sat, 26 May 2018 11:12:26 +0000 (13:12 +0200)] 
lda: Allow -f sender to omit domain.

Several people complained about the original enforcement of the presence of a
domain (added for v2.3.0) to be too restrictive. Apparently, this legitimately
happens with bounce messages on certain platforms.

7 years agolib-fs: fs_unlock(NULL) should be a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 15:07:38 +0000 (11:07 -0400)] 
lib-fs: fs_unlock(NULL) should be a no-op

7 years agoglobal: start relying on fs_iter_deinit(NULL) being a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 15:03:25 +0000 (11:03 -0400)] 
global: start relying on fs_iter_deinit(NULL) being a no-op

7 years agolib-fs: fs_iter_deinit(NULL) should be a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 15:02:56 +0000 (11:02 -0400)] 
lib-fs: fs_iter_deinit(NULL) should be a no-op

7 years agoglobal: start relying on fs_deinit(NULL) and fs_unref(NULL) being no-ops
Josef 'Jeff' Sipek [Fri, 25 May 2018 14:53:54 +0000 (10:53 -0400)] 
global: start relying on fs_deinit(NULL) and fs_unref(NULL) being no-ops

Cleanup performed with the following semantic patch:

@@
expression E;
@@

- if (E != NULL) {
-  fs_unref(&E);
- }
+ fs_unref(&E);

@@
expression E;
@@

- if (E != NULL) {
-  fs_deinit(&E);
- }
+ fs_deinit(&E);

7 years agolib-fs: fs_unref(NULL) should be a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 14:48:29 +0000 (10:48 -0400)] 
lib-fs: fs_unref(NULL) should be a no-op

7 years agoglobal: start relying on fs_file_close(NULL) being a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 14:38:36 +0000 (10:38 -0400)] 
global: start relying on fs_file_close(NULL) being a no-op

Cleanup performed with the following semantic patch:

@@
expression E;
@@

- if (E != NULL) {
-  fs_file_close(E);
- }
+ fs_file_close(E);

7 years agolib-fs: fs_file_close(NULL) should be a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 14:35:35 +0000 (10:35 -0400)] 
lib-fs: fs_file_close(NULL) should be a no-op

7 years agoglobal: start relying on fs_file_deinit(NULL) being a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 14:31:27 +0000 (10:31 -0400)] 
global: start relying on fs_file_deinit(NULL) being a no-op

Cleanup performed with the following semantic patch:

@@
expression E;
@@

- if (E != NULL) {
-  fs_file_deinit(&E);
- }
+ fs_file_deinit(&E);

7 years agolib-fs: fs_file_deinit(NULL) should be a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 14:18:34 +0000 (10:18 -0400)] 
lib-fs: fs_file_deinit(NULL) should be a no-op

7 years agolib-smtp: Add test-smtp-payload, test-smtp-submit, test-smtp-client-errors, and test...
Stephan Bosch [Sat, 17 Mar 2018 23:57:36 +0000 (00:57 +0100)] 
lib-smtp: Add test-smtp-payload, test-smtp-submit, test-smtp-client-errors, and test-smtp-server-errors to `make check`.

7 years agolib-http: Add test-http-payload, test-http-client-errors, and test-http-server-errors...
Stephan Bosch [Sat, 17 Mar 2018 23:53:14 +0000 (00:53 +0100)] 
lib-http: Add test-http-payload, test-http-client-errors, and test-http-server-errors to `make check`.

7 years agolib-http: test-http-client-errors: Make the reconnect failure test less time-sensitive.
Stephan Bosch [Sun, 18 Mar 2018 00:25:42 +0000 (01:25 +0100)] 
lib-http: test-http-client-errors: Make the reconnect failure test less time-sensitive.

Easily breaks in Valgrind.

7 years agolib-smtp: test-smtp-payload: Terminate the test if it is hanging for some reason.
Stephan Bosch [Sat, 17 Mar 2018 23:46:32 +0000 (00:46 +0100)] 
lib-smtp: test-smtp-payload: Terminate the test if it is hanging for some reason.

7 years agolib-smtp: test-smtp-client-errors: Terminate the test if it is hanging for some reason.
Stephan Bosch [Sat, 17 Mar 2018 23:34:22 +0000 (00:34 +0100)] 
lib-smtp: test-smtp-client-errors: Terminate the test if it is hanging for some reason.

7 years agolib-http: test-http-client-errors: Terminate the test if it is hanging for some reason.
Stephan Bosch [Thu, 28 Dec 2017 15:33:49 +0000 (16:33 +0100)] 
lib-http: test-http-client-errors: Terminate the test if it is hanging for some reason.

7 years agolib-http: test-http-payload: Add SSL tests.
Stephan Bosch [Fri, 9 Feb 2018 22:58:51 +0000 (23:58 +0100)] 
lib-http: test-http-payload: Add SSL tests.

7 years agolib-smtp: test-smtp-payload: Add SSL tests.
Stephan Bosch [Fri, 9 Feb 2018 21:09:27 +0000 (22:09 +0100)] 
lib-smtp: test-smtp-payload: Add SSL tests.

7 years agolib-http: test-http-payload: Ignore SIGPIPE.
Stephan Bosch [Fri, 9 Feb 2018 23:00:17 +0000 (00:00 +0100)] 
lib-http: test-http-payload: Ignore SIGPIPE.

7 years agolib-smtp: test-smtp-payload: Ignore SIGPIPE.
Stephan Bosch [Fri, 9 Feb 2018 21:09:47 +0000 (22:09 +0100)] 
lib-smtp: test-smtp-payload: Ignore SIGPIPE.

7 years agolib-http: server: Allow creating server with custom SSL settings.
Stephan Bosch [Fri, 9 Feb 2018 21:27:00 +0000 (22:27 +0100)] 
lib-http: server: Allow creating server with custom SSL settings.

Normally, the settings are obtained through lib-master, but that is not
really suitable for the test suite.

7 years agolib-smtp: server: Allow creating server with custom SSL settings.
Stephan Bosch [Fri, 9 Feb 2018 21:06:49 +0000 (22:06 +0100)] 
lib-smtp: server: Allow creating server with custom SSL settings.

Normally, the settings are obtained through lib-master, but that is not
really suitable for the test suite.

7 years agolib-smtp: client: Amend connection debug message with source ip:port.
Stephan Bosch [Sat, 17 Mar 2018 20:08:09 +0000 (21:08 +0100)] 
lib-smtp: client: Amend connection debug message with source ip:port.

Helps matching debug logs between client and server.

7 years agolib-smtp: test-smtp-payload: Keep the number of pending transactions constant.
Stephan Bosch [Sat, 17 Mar 2018 17:10:04 +0000 (18:10 +0100)] 
lib-smtp: test-smtp-payload: Keep the number of pending transactions constant.

Before, a window was used.

7 years agolib-smtp: test-smtp-payload: Make proper definition for the maximum number of paralle...
Stephan Bosch [Sat, 17 Mar 2018 17:05:01 +0000 (18:05 +0100)] 
lib-smtp: test-smtp-payload: Make proper definition for the maximum number of parallel transactions.

7 years agolib-http: test-http-payload: Add test for exchanging payload with unknown size.
Stephan Bosch [Sat, 10 Feb 2018 01:20:31 +0000 (02:20 +0100)] 
lib-http: test-http-payload: Add test for exchanging payload with unknown size.

This will force using the chunked transfer encoding.

7 years agolib-http: test-http-payload: server: Fix asynchronous listening.
Stephan Bosch [Sat, 17 Mar 2018 20:34:11 +0000 (21:34 +0100)] 
lib-http: test-http-payload: server: Fix asynchronous listening.

The listening socket was blocking and the io handler only accepted one connection per run.

7 years agolib-smtp: test-smtp-payload: server: Fix asynchronous listening.
Stephan Bosch [Sat, 17 Mar 2018 13:14:03 +0000 (14:14 +0100)] 
lib-smtp: test-smtp-payload: server: Fix asynchronous listening.

The listening socket was blocking and the io handler only accepted one connection per run.

7 years agolib-ssl-iostream: Add support for creating server and client test SSL settings.
Stephan Bosch [Fri, 9 Feb 2018 21:04:23 +0000 (22:04 +0100)] 
lib-ssl-iostream: Add support for creating server and client test SSL settings.

This is useful for building test cases with SSL support.

7 years agolib-master: If stats process wants no events, send nothing to it
Timo Sirainen [Wed, 23 May 2018 12:14:50 +0000 (15:14 +0300)] 
lib-master: If stats process wants no events, send nothing to it

Instead of sending everything to it..

7 years agolib-charset: test-charset can now be used to convert input file
Timo Sirainen [Mon, 21 May 2018 21:22:42 +0000 (00:22 +0300)] 
lib-charset: test-charset can now be used to convert input file

Usage: test-charset <charset> [<input path>]

If <input path> isn't specified, read input from stdin.  The input is
converted to UTF-8 and written to stdout.

7 years agodoveadm director: Remove unnecessary extra newlines from output
Timo Sirainen [Wed, 23 May 2018 14:13:23 +0000 (17:13 +0300)] 
doveadm director: Remove unnecessary extra newlines from output

7 years agolib-master: Move const char *error declaration inside ifdef HAVE_SSL
Martti Rannanjärvi [Thu, 24 May 2018 11:55:59 +0000 (14:55 +0300)] 
lib-master: Move const char *error declaration inside ifdef HAVE_SSL

This is so you can compile dovecot without ssl.

7 years agolib: io_loop_stop() should stop the ioloop immediately
Timo Sirainen [Tue, 22 May 2018 19:45:32 +0000 (22:45 +0300)] 
lib: io_loop_stop() should stop the ioloop immediately

Other timeouts or IOs shouldn't be called anymore.

7 years agolib: test-multiplex - Make sure alt istream's final input is read
Timo Sirainen [Wed, 23 May 2018 21:40:41 +0000 (00:40 +0300)] 
lib: test-multiplex - Make sure alt istream's final input is read

Previously the code trusted that the the alt istream's final IO callback was
called even after io_loop_stop().

7 years agocassandra: Fix empty binary parameters with prepared statements
Timo Sirainen [Wed, 23 May 2018 22:32:40 +0000 (01:32 +0300)] 
cassandra: Fix empty binary parameters with prepared statements

Fixes:
Panic: Trying to allocate 0 bytes

7 years agolib-smtp: server: Fix the enforcement of the maximum DATA command message size.
Stephan Bosch [Wed, 23 May 2018 13:54:53 +0000 (15:54 +0200)] 
lib-smtp: server: Fix the enforcement of the maximum DATA command message size.

The global setting from the server object was used, rather than the
per-connection setting. The latter is usually the one that is properly set,
while the global server setting is left at zero. For LMTP this meant that the
40 Mb implicit limit was still in force.

7 years agolib-smtp: client: Increase the default BDAT chunk size.
Stephan Bosch [Sat, 17 Mar 2018 17:00:54 +0000 (18:00 +0100)] 
lib-smtp: client: Increase the default BDAT chunk size.

Reduces the number of roundtrips and keeps the TCP window filled better.
The default is now based on the NET_BLOCK_SIZE definition.

7 years agolib: Define NET_BLOCK_SIZE.
Stephan Bosch [Tue, 22 May 2018 07:42:00 +0000 (09:42 +0200)] 
lib: Define NET_BLOCK_SIZE.

This defines the default size for data blocks transferred over the network. It
should be large enough to guarantee filling up the TCP window (for efficiency),
while still preventing sending much data while the peer has already rejected
the rest of the transfer.

7 years agofs-posix: Support FS_METADATA_WRITE_FNAME for fs_copy()
Timo Sirainen [Tue, 22 May 2018 13:06:15 +0000 (16:06 +0300)] 
fs-posix: Support FS_METADATA_WRITE_FNAME for fs_copy()

7 years agoauth: db-lua - Remove unnecessary pushnil usage
Aki Tuomi [Tue, 22 May 2018 06:23:32 +0000 (09:23 +0300)] 
auth: db-lua - Remove unnecessary pushnil usage

lua_pushstring is NULL-safe

7 years agolog: Fix the default prefix
Timo Sirainen [Tue, 22 May 2018 07:24:33 +0000 (10:24 +0300)] 
log: Fix the default prefix

"listen_fd(123): foo" is better than "listen_fd 14foo"

7 years agoman: doveadm-mailbox.1.in - Fix doveadm-search-query(7) section
Timo Sirainen [Tue, 22 May 2018 07:59:11 +0000 (10:59 +0300)] 
man: doveadm-mailbox.1.in - Fix doveadm-search-query(7) section

7 years agolib-storage: maildir - Remove unnecessary variable
Aki Tuomi [Mon, 21 May 2018 16:38:29 +0000 (19:38 +0300)] 
lib-storage: maildir - Remove unnecessary variable

7 years agolib-storage: maildir - Use index keywords only when saving mail
Aki Tuomi [Mon, 21 May 2018 11:31:58 +0000 (14:31 +0300)] 
lib-storage: maildir - Use index keywords only when saving mail

This fixes mail attachment keywords to work with maildir too.

7 years agolib-storage: maildir - Use array code for keywords when saving mail
Aki Tuomi [Mon, 21 May 2018 11:28:03 +0000 (14:28 +0300)] 
lib-storage: maildir - Use array code for keywords when saving mail

This is safer alternative and makes following change easier.

7 years agodirector: Make sure host's last_updown_change never shrinks.
Timo Sirainen [Sun, 20 May 2018 15:20:47 +0000 (18:20 +0300)] 
director: Make sure host's last_updown_change never shrinks.

Otherwise the ring might get into a loop where two HOST updates keep
fighting each others. This could probably happen if one update comes at
"desynced" state and other one in non-desynced state.

I'm not entirely sure if this is fixing such a loop or not, but it at least
shouldn't hurt.

7 years agoauth: Fix assert-crash if auth client sends 0 as ID
Timo Sirainen [Sun, 20 May 2018 18:32:12 +0000 (21:32 +0300)] 
auth: Fix assert-crash if auth client sends 0 as ID

This could be triggered by anyone having (local) write access to the auth
socket.

7 years agolib-index: Remove #if'ed out code
Timo Sirainen [Sun, 20 May 2018 22:30:36 +0000 (01:30 +0300)] 
lib-index: Remove #if'ed out code

Originally added by 0b2d4626c6fb4e40bc81c56d8227191f3c7e1ea3. Possibly
accidentally.

7 years agolib: Fix ioloop-poll and ioloop-select to work with io_add_istream()
Timo Sirainen [Sun, 20 May 2018 22:42:27 +0000 (01:42 +0300)] 
lib: Fix ioloop-poll and ioloop-select to work with io_add_istream()

7 years agoexample-config: Add log_debug and log_core_filter
Timo Sirainen [Thu, 26 Apr 2018 18:35:15 +0000 (21:35 +0300)] 
example-config: Add log_debug and log_core_filter

7 years agolib-master: Add improved log filter parsing
Timo Sirainen [Mon, 16 Apr 2018 12:00:27 +0000 (15:00 +0300)] 
lib-master: Add improved log filter parsing

It now supports parenthesis to perform ANDs within a query. For example:
"(ruleA1 ruleA2) ruleB (ruleC1 ruleC2 ruleC3)" has 3 ORed rules.

Rules can contain:

 - event:<name>
 - source:<filename>[:<line number>]
 - field:<key>=<value> can be used multiple times
 - cat[egory]:<value> can be used multiple times

For example:

event:http_request_finished (cat:error cat:storage)

This matches either the "http_request_finished" named event, or
alternatively any error event that belongs to "storage" category.

7 years agolib: Event filter - Source line number 0 now means "any"
Timo Sirainen [Thu, 26 Apr 2018 18:29:23 +0000 (21:29 +0300)] 
lib: Event filter - Source line number 0 now means "any"

7 years agolib: Event filter - Support wildcards in event names
Timo Sirainen [Thu, 26 Apr 2018 18:21:40 +0000 (21:21 +0300)] 
lib: Event filter - Support wildcards in event names

This allows for example log_debug=event:*

7 years agolib: event_add_str() - Ignore calls when value is NULL
Timo Sirainen [Sun, 29 Apr 2018 09:17:45 +0000 (12:17 +0300)] 
lib: event_add_str() - Ignore calls when value is NULL

Alternative could be to assert-crash instead. But perhaps this makes it
easier to use and avoids unnecessary assert-crashes?

7 years agodoveadm: Add mailbox cache compress
Timo Sirainen [Sun, 29 Apr 2018 10:45:05 +0000 (13:45 +0300)] 
doveadm: Add mailbox cache compress

7 years agolib-index: Add mail_cache_compress_forced()
Timo Sirainen [Sun, 29 Apr 2018 10:44:59 +0000 (13:44 +0300)] 
lib-index: Add mail_cache_compress_forced()

7 years agolib-iostream-ssl: Use default CA locations with client context
Aki Tuomi [Tue, 15 Mar 2016 07:21:49 +0000 (09:21 +0200)] 
lib-iostream-ssl: Use default CA locations with client context

If no CA settings are provided, fall back to default CA
settings from openssl library.

7 years agolib-index: fsck: Fix small log offsets to file's correct header size
Timo Sirainen [Sun, 20 May 2018 12:56:51 +0000 (15:56 +0300)] 
lib-index: fsck: Fix small log offsets to file's correct header size

Use the file's actual current header size, not
MAIL_TRANSACTION_LOG_HEADER_MIN_SIZE, which is nowadays smaller. This
resulted in unnecessary errors like:

Corrupted transaction log file ...: Invalid min_file_offset: ..., min_file_offset (24) < hdr_size (40)

7 years agolib-index: fsck: Don't change log_file_tail_offset=0
Timo Sirainen [Sun, 20 May 2018 12:55:03 +0000 (15:55 +0300)] 
lib-index: fsck: Don't change log_file_tail_offset=0

7 years agolib: bits - macros to simplify expressions when using -Wstrict-bool
Phil Carmody [Fri, 11 May 2018 06:19:21 +0000 (09:19 +0300)] 
lib: bits - macros to simplify expressions when using -Wstrict-bool

To be strict-bool compliant, your expressions need to be a bit verbose,
these might simplify things.

There are presently over 400 instances matching HAS_NO_BITS(), and nearly
1300 instances matching HAS_ANY_BITS(), so it's a very common pattern.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib: Fix potential crashes when writing to log fails with EAGAIN
Timo Sirainen [Fri, 18 May 2018 09:47:02 +0000 (12:47 +0300)] 
lib: Fix potential crashes when writing to log fails with EAGAIN

The ioloop may nowadays call ioloop context switch callbacks. Since log
writing can happen just about anywhere, the callbacks may be confused
and cause crashes or other weird behavior.

Even if the callbacks aren't called, all the extra code in ioloop can cause
potential problems. Especially any error logging in it wouldn't work properly
since it would just recurse back. So replace the ioloop code with just setting
the log fd to be blocking until the write succeeds.

This commit also removes comments about writes to a blocking terminal fd
causing EAGAINs. This seems unlikely. Probably I was just somehow
confused when originally seeing it and writing the code. If it actually
does happen now, it's still not breaking anything, but it could get into
a busy-loop of write()s constantly returning EAGAIN until they succeed.

7 years agoauth: Fix passwd-file logging on missing passwd-file
Aki Tuomi [Tue, 15 May 2018 11:32:41 +0000 (14:32 +0300)] 
auth: Fix passwd-file logging on missing passwd-file

This reduces log clutter in production systems that use per-domain
password files by logging the missing file information only
when auth_verbose=yes.

Broken in daabad64d90d6008215e234287255a56312e7b72

7 years agolib: Linux, OSX, etc: Avoid race conditions showing \xAB chars in ps title
Timo Sirainen [Fri, 18 May 2018 14:29:09 +0000 (17:29 +0300)] 
lib: Linux, OSX, etc: Avoid race conditions showing \xAB chars in ps title

With bad luck "ps" reads the process title when it hasn't been fully
written. Since the trailing NULs are written last and the previous code kept
the ps title otherwise filled with \xAB chars, this could have caused ps
to sometimes show the process title filled with \xAB chars (visible as '?')

7 years ago*-login: Fix non-global ssl=no configuration
Timo Sirainen [Fri, 18 May 2018 14:04:36 +0000 (17:04 +0300)] 
*-login: Fix non-global ssl=no configuration

For example local 127.0.0.2 { ssl=no } wasn't working.

7 years agolib-http: client: Drop the ioloop switch callback before freeing the global client...
Stephan Bosch [Fri, 18 May 2018 13:56:15 +0000 (15:56 +0200)] 
lib-http: client: Drop the ioloop switch callback before freeing the global client context.

This removes the possibility of recursion when the client context object somehow
triggers an ioloop switch (e.g., when debug logging starts blocking at that
inopportune moment).

7 years agolib-smtp: client: Fix assertion panic occurring when DATA dot stream cannot be finish...
Stephan Bosch [Fri, 18 May 2018 08:24:46 +0000 (10:24 +0200)] 
lib-smtp: client: Fix assertion panic occurring when DATA dot stream cannot be finished immediately.

If o_stream_finish() returns 0, o_stream_send_istream() would be called again
later which causes the panic. Instead, it should only call o_stream_finish() or
o_stream_flush() again to finish the last bit of the output.

Panic was:

Panic: file ostream.c: line 394 (o_stream_send_istream): assertion failed: (!_outstream->finished)

7 years agocassandra: Fix consistency=quorum to work
Timo Sirainen [Thu, 17 May 2018 13:29:28 +0000 (16:29 +0300)] 
cassandra: Fix consistency=quorum to work

Previously it could have been used by setting "consistency=", but this was
an accident.

7 years agolib-master: postlogin: Don't unreference already closed login-connection
Timo Sirainen [Thu, 17 May 2018 15:35:04 +0000 (18:35 +0300)] 
lib-master: postlogin: Don't unreference already closed login-connection

If the login-connection was already closed, this caused too many
unreferences.

Fixes:
Panic: file master-login.c: line 544 (master_login_conn_unref): assertion failed: (conn->clients == NULL)

7 years agosystemd: Indicate where changes should be made
Aki Tuomi [Tue, 24 Apr 2018 08:46:21 +0000 (11:46 +0300)] 
systemd: Indicate where changes should be made

7 years agosystemd: Increase file descriptors by default
Aki Tuomi [Tue, 24 Apr 2018 08:45:36 +0000 (11:45 +0300)] 
systemd: Increase file descriptors by default

7 years agosystemd: Allow writing to home by default
Aki Tuomi [Tue, 24 Apr 2018 08:45:07 +0000 (11:45 +0300)] 
systemd: Allow writing to home by default

7 years agosystemd: Remove NoNewPrivileges and CAP_BOUNDING_SET
Aki Tuomi [Tue, 24 Apr 2018 08:44:33 +0000 (11:44 +0300)] 
systemd: Remove NoNewPrivileges and CAP_BOUNDING_SET

These break sieve by preventing SUID binary as
sendmail_path.

7 years agofs-posix: Strip trailing "/" from filenames
Timo Sirainen [Tue, 15 May 2018 14:50:27 +0000 (17:50 +0300)] 
fs-posix: Strip trailing "/" from filenames

This is mainly because "doveadm fs delete -R" adds it to indicate to the
fs-driver that the whole directory is wanted to be deleted. This change
fixes fs-posix to work with NFS, where otherwise unlink("symlink-to-dir/")
fails with ENOTDIR. Without NFS the same call succeeds.

7 years agodoveadm force-resync: Add -f parameter to fsck index while opening it
Timo Sirainen [Mon, 14 May 2018 18:33:53 +0000 (21:33 +0300)] 
doveadm force-resync: Add -f parameter to fsck index while opening it

This probably should be done by default, but for now keep it optional
just in case there are any bugs in the fsck implementation.