2022-06-13 13:28:22 +0300 Aki Tuomi (9b53102964) NEWS: Add news for 2.3.19.1 M NEWS 2022-06-13 09:56:13 +0300 Timo Sirainen (a04e1b9abf) doveadm deduplicate: Allocate memory properly for keys in hash table This caused wrong mails to be deleted somewhat randomly. Broken by 320844f50cd669b602d30210e2e5216f65d2050f M src/doveadm/doveadm-mail-deduplicate.c 2022-05-24 15:52:26 +0300 Timo Sirainen (38b7195efe) lib-compression: istream-decompress - Copy parent stream name This is needed, because istream-decompress doesn't actually use the parent stream as the istream parent. M src/lib-compression/istream-decompress.c 2022-05-18 11:31:44 +0300 Timo Sirainen (8a8380a410) auth: Fix assert-crash in iterating multiple userdbs Broken by 501e17ba6b448ba3c88338596e0e8f99f0693f79 Fixes: Panic: file userdb-blocking.c: line 125 (userdb_blocking_iter_next): assertion failed: (ctx->conn != NULL) M src/auth/auth-master-connection.c 2022-05-04 15:47:03 +0300 Aki Tuomi (b3ad6004dc) NEWS: Update date for 2.3.19 news M NEWS 2022-05-03 00:27:47 +0300 Timo Sirainen (f539a7e18c) fts: Fix optimizing searches in virtual mailboxes without up-to-date indexes This could have caused header searches in virtual mailboxes to not return all results when fts_enforced!=yes Broken by 9705b81fb51b5bdeaba12932a390ced2cc9dcad7 M src/plugins/fts/fts-storage.c 2022-04-26 09:30:10 +0300 Aki Tuomi (e55db06e1a) NEWS: Add news for 2.3.19 M NEWS 2022-02-01 19:29:46 +0100 Timo Sirainen (1f1e770332) NEWS: Update news for 2.3.18 - final fixups M NEWS 2022-01-12 11:34:02 +0200 Aki Tuomi (4ab62982e3) NEWS: Update news for 2.3.18 M NEWS 2022-04-25 10:43:45 +0300 Aki Tuomi (f28361b357) lib-lua: dlua-dovecot-http - Support more settings with HTTP client M src/lib-lua/dlua-dovecot-http.c 2022-04-25 14:27:12 +0300 Aki Tuomi (c6dd084a6d) lib-http: Rename max_auto_retry_delay to max_auto_retry_delay_secs M src/lib-http/http-client-request.c M src/lib-http/http-client.c M src/lib-http/http-client.h 2022-04-26 09:35:15 +0300 Aki Tuomi (f3bfa1d5ab) configure: Update version M configure.ac 2022-04-19 11:42:05 +0300 Timo Sirainen (1c6c3c320d) auth: auth_worker_call() - Return void instead of the connection The return value is no longer necessary, and it most likely would just be used wrong. M src/auth/auth-worker-server.c M src/auth/auth-worker-server.h 2022-04-19 11:40:52 +0300 Timo Sirainen (94577c4450) auth: Fix crash when user iteration request is queued auth_worker_call() returns NULL when the request couldn't be handled immediately, which would result in NULL pointer dereference later on. M src/auth/userdb-blocking.c 2022-04-19 11:39:35 +0300 Timo Sirainen (f89c9e587e) auth: Add connection parameter to auth_worker_callback_t M src/auth/auth-worker-server.c M src/auth/auth-worker-server.h M src/auth/passdb-blocking.c M src/auth/passdb-cache.c M src/auth/userdb-blocking.c 2022-04-14 13:46:59 +0200 Timo Sirainen (865fb4f3c1) doveadm: Fix hang when flushing a corked print-ostream This could have happened at least with doveadm sync/backup command, i.e. causing replication to hang until timeout is reached: Error: write() failed: Timed out after 60 seconds M src/doveadm/doveadm-print-server.c 2022-04-08 15:59:59 +0300 Timo Sirainen (0dd36a73e4) lib-index: Always write tail offset the same as head offset The mail_index_write() must not be called unless this is safe to do. This prevents unnecessarily reading through dovecot.index.log between tail..head offsets, which can be expensive due to modseq calculation. M src/lib-index/mail-index-write.c 2022-04-08 15:10:53 +0300 Timo Sirainen (aa7d67e6d6) lib-index: Optimize modseq scanning by using the modseq header in index View is very commonly set to start reading new changes since dovecot.index was last written. When reading the newer records in dovecot.index.log, the modseq of each change is needed to be known. However, the initial modseq calculation was usually done inefficiently by reading the whole dovecot.index.log from the beginning of the file. This change prevents that by using instead the "modseq" header in dovecot.index to get the initial modseq. M src/lib-index/mail-index-map-read.c M src/lib-index/mail-index-modseq.c M src/lib-index/mail-index-modseq.h M src/lib-index/mail-index-private.h M src/lib-index/mail-transaction-log-modseq.c 2022-04-08 13:42:55 +0300 Timo Sirainen (40e2a21f83) lib-index: Handle 0-sized dovecot.index.log record properly The previous behavior was to just silently ignore it and have the next write to the transaction log silently truncate away the trailing garbage. Now if the log file isn't locked the issue is still ignored, since it's possible that this is just a race condition. But if the log is locked, it's handled as corruption. M src/lib-index/mail-transaction-log-file.c 2022-04-12 10:12:11 +0300 Aki Tuomi (36cbfb8e2b) lib: test-event-flatten - Use __FILE__ to get correct expected filename Fixes out of tree buids Broken in 4f752d381c8e19dd07d1e593996d02294668c8b6 M src/lib/test-event-flatten.c 2022-03-01 10:01:06 +0200 Aki Tuomi (5c2f3d0b85) auth: db-oauth2 - Fix off by one in oauth2 variable handling Broken in 9b670175445a75987a713ff899d1a945255b0b5b M src/auth/db-oauth2.c 2022-03-21 11:03:03 +0200 Timo Sirainen (dc40c6dbcf) dsync: Properly terminate escape_chars when escaping mailbox names Broken by 596c5a52e7e554571285e90063712cb0d37b34eb M src/doveadm/dsync/dsync-brain-mailbox-tree.c 2022-03-02 09:39:30 -0500 Timo Sirainen (9e7503d439) dsync: Fix hierarchical mailbox name parts individually For example with filesystem-based mailbox formats it's not allowed to create "box/../child" mailbox. With previous code dsync just gave up and created the mailbox name based on its GUID. This is now improved to instead try to insert '_' character after each hierarchy separator so the newly fixed mailbox name is "box/_../child". M src/doveadm/dsync/dsync-brain-mailbox-tree.c 2022-03-01 08:37:57 -0500 Timo Sirainen (801aae4bd5) dsync: Escape and unescape mailbox names as needed This should fix various issues with syncing local and remote mailbox names. It especially avoids changing the escape character to alt_char. M src/doveadm/dsync/dsync-brain-mailbox-tree.c M src/doveadm/dsync/dsync-mailbox-tree.c M src/doveadm/dsync/test-dsync-mailbox-tree-sync.c 2022-03-01 11:51:04 -0500 Timo Sirainen (cfd1b0687f) dsync: Track whether escape character was added just for dsync Will be used by the following commit M src/doveadm/doveadm-dsync.c M src/doveadm/dsync/dsync-brain.c M src/doveadm/dsync/dsync-brain.h 2022-03-01 08:36:55 -0500 Timo Sirainen (60ae30dd9e) dsync: Add clarifying comment about mailbox_log_record.maibox_guid contents M src/doveadm/dsync/dsync-mailbox-tree-fill.c 2022-03-01 08:06:14 -0500 Timo Sirainen (3864ecbfc7) dsync: Add escape_char to dsync-mailbox-tree This will be used by the following changes. M src/doveadm/dsync/dsync-brain-mailbox-tree.c M src/doveadm/dsync/dsync-brain-private.h M src/doveadm/dsync/dsync-ibc-pipe.c M src/doveadm/dsync/dsync-ibc-private.h M src/doveadm/dsync/dsync-ibc-stream.c M src/doveadm/dsync/dsync-ibc.c M src/doveadm/dsync/dsync-ibc.h M src/doveadm/dsync/dsync-mailbox-tree-private.h M src/doveadm/dsync/dsync-mailbox-tree.c M src/doveadm/dsync/dsync-mailbox-tree.h M src/doveadm/dsync/test-dsync-mailbox-tree-sync.c 2022-03-18 09:41:37 +0200 Aki Tuomi (f95da1fa2f) lib-test: test-subprocess - Free subprocess before forking Otherwise it'll leak memory. Broken in 34bdfdcbc7e3b374a219732329b6ce6d84a7666e M src/lib-test/test-subprocess.c 2021-10-25 12:23:56 +0100 Siavash Tavakoli (25ae16cb40) lib-lua: Add a minimal interface to lib-http Adds the ability to - Creating http clients - Creating http requests - Adding arbitrary headers and payload to the http request - Submitting the request to remote server and getting the response M src/lib-lua/Makefile.am A src/lib-lua/dlua-dovecot-http.c M src/lib-lua/dlua-dovecot.c M src/lib-lua/dlua-script-private.h 2022-03-14 10:18:58 +0200 Aki Tuomi (e5ae6b26e9) doveadm-who: Do not parse numbers as IP addresses Fixes doveadm kick as well. Broken in 381daab1e3b56a0bc94d2191cf62beba0df51af9 M src/doveadm/doveadm-who.c 2022-03-01 12:06:20 +0100 Markus Valentin (6026905b7a) lib: test-seqset-builder - Add missing seqset_builder_deinit() Fixes leaking memory when running tests. M src/lib/test-seq-set-builder.c 2022-03-01 13:49:39 +0100 Markus Valentin (4540884c46) imapc: imapc_transaction_save_rollback() - Fix NULL-check for ctx->src_mbox Assert that unfinished context implies that ctx->src_mbox is non-NULL. Also check for ctx->src_mbox being non-NULL before deinitializing it. M src/lib-storage/index/imapc/imapc-save.c 2022-02-28 13:15:06 +0100 Markus Valentin (e5a07bd1c4) imapc: imapc_mailbox_msgmap_update() - Set new_message_r In case a message has not yet been keep the reply till syncing and do not discard it right away. M src/lib-storage/index/imapc/imapc-mailbox.c 2022-02-24 15:31:39 +0100 Markus Valentin (f5fc15b1b1) imapc: Delay fetching state after untagged exists reply M src/lib-storage/index/imapc/imapc-mailbox.c M src/lib-storage/index/imapc/imapc-storage.h M src/lib-storage/index/imapc/imapc-sync.c 2021-12-16 09:11:55 +0100 Markus Valentin (173cc696f8) imapc: imapc_copy() - Make sure capabilities are known before copying M src/lib-storage/index/imapc/imapc-save.c 2021-11-11 16:17:35 +0100 Markus Valentin (09bfbb4cb1) imapc: Implement rollback for failed copies M src/lib-storage/index/imapc/imapc-save.c M src/lib-storage/index/imapc/imapc-storage.c M src/lib-storage/index/imapc/imapc-storage.h 2021-11-11 18:31:54 +0100 Markus Valentin (95baaaf454) imapc: imapc_save_copyuid() deduplicate code M src/lib-storage/index/imapc/imapc-save.c 2021-11-11 16:18:09 +0100 Markus Valentin (1e888011d0) imapc: Enable bulk copying if remote backend has UIDPLUS capability M src/lib-storage/index/imapc/imapc-save.c 2021-11-11 14:52:54 +0100 Markus Valentin (79b5dc6024) imapc: Implement bulk copying for imapc M src/lib-storage/index/imapc/imapc-save.c M src/lib-storage/index/imapc/imapc-storage.c M src/lib-storage/index/imapc/imapc-storage.h 2021-11-11 16:10:53 +0100 Markus Valentin (d8ac772071) imapc: Extract imapc_copy_simple() from imapc_copy() Keep the old one by one copying functionality as simple call. This will be used if the remote backend does not have the UIDPLUS capability. M src/lib-storage/index/imapc/imapc-save.c 2022-01-12 15:09:16 +0100 Markus Valentin (dd9923ed99) lib-storage: index_save_context_free() - Add assertion on non-NULL ctx->dest_mail M src/lib-storage/index/index-storage.c 2021-12-08 17:17:56 +0100 Markus Valentin (ed093cb058) lib: Add seq-set-builder and tests for it M src/lib/Makefile.am A src/lib/seq-set-builder.c A src/lib/seq-set-builder.h M src/lib/test-lib.inc A src/lib/test-seq-set-builder.c 2022-02-10 17:37:59 +0100 Marco Bettini (0b8d22e109) lib-storage: imapc_mailbox_close() - Remove unprocessed untagged_fetch_contexts M src/lib-storage/index/imapc/imapc-storage.c 2022-02-10 16:26:10 +0100 Marco Bettini (589f8b1eba) lib-storage: Remove trainling spaces M src/lib-storage/index/imapc/imapc-mailbox.c M src/lib-storage/index/imapc/imapc-sync.c 2022-02-02 16:58:24 +0100 Markus Valentin (6b7a40bd5d) imapc: imapc_sync_handle_untagged_fetches() - Commit after adding the untagged fetch messages The absence of the commit could have caused issues when imapc_sync_finish() was not called as it left mbox->delayed_sync_trans initialized but mbox->delayed_sync_view was NULL. Broken by 55a8c2d294bb2f764209c7ce455d258b2b7506f5 M src/lib-storage/index/imapc/imapc-sync.c 2022-01-18 09:46:32 +0100 Markus Valentin (4b517a91b4) imapc: Start to handle new untagged fetch messages in imapc_sync() M src/lib-storage/index/imapc/imapc-mailbox.c 2022-01-18 09:22:24 +0100 Markus Valentin (6d505f1b39) imapc: Add imapc_sync_handle_untagged_fetches() M src/lib-storage/index/imapc/imapc-mailbox.c M src/lib-storage/index/imapc/imapc-storage.c M src/lib-storage/index/imapc/imapc-storage.h M src/lib-storage/index/imapc/imapc-sync.c 2022-01-17 15:41:25 +0100 Markus Valentin (aa26f7a231) imapc: imapc_untagged_fetch_handle() - Change return type to bool When calling imapc_untagged_fetch_handle() also retrieve new_message_r from it which allows imapc_mailbox_msgmap_update() to determine if the message just handled was already in index or not. M src/lib-storage/index/imapc/imapc-mailbox.c 2022-01-27 08:06:16 +0100 Markus Valentin (235f491ffe) imapc: imapc_untagged_fetch_update_flags() - Reduce indentation M src/lib-storage/index/imapc/imapc-mailbox.c 2022-01-27 07:56:32 +0100 Markus Valentin (ea5eb228c7) imapc: Split off imapc_untagged_fetch_update_flags() for handling flag updates M src/lib-storage/index/imapc/imapc-mailbox.c 2022-01-17 15:00:41 +0100 Markus Valentin (4656356f1e) imapc: Introduce imapc_untagged_fetch_ctx M src/lib-storage/index/imapc/imapc-mailbox.c M src/lib-storage/index/imapc/imapc-storage.h 2022-01-17 13:57:56 +0100 Markus Valentin (332c4ef1a4) imapc: Decouple imapc_untagged_fetch parsing and handling M src/lib-storage/index/imapc/imapc-mailbox.c 2022-03-09 02:30:12 +0100 Stephan Bosch (a987d6b01f) submission-login: Add workaround for SMTP backend that is not Dovecot. Adds workaround called "exotic-backend". M src/submission-login/client-authenticate.c M src/submission-login/submission-login-settings.c M src/submission-login/submission-login-settings.h M src/submission/submission-settings.c 2022-03-02 15:40:16 +0200 Aki Tuomi (f703acd4a2) auth: auth-cache - Always use translated_username as cache key This fixes auth cache when passdb/userdb changes the user field. M src/auth/auth-cache.c 2022-03-02 14:57:20 +0200 Aki Tuomi (020f8d5cff) auth: Set translated_user to requested_login_user in master login Fixes caching issues with master logins. M src/auth/auth-request-fields.c 2021-07-06 14:02:41 +0300 Aki Tuomi (2e5b63175d) auth: Include cache hit/miss information in passdb/userdb lookup end events M src/auth/auth-request.c M src/auth/auth-request.h M src/auth/passdb-cache.c 2022-02-28 17:12:32 +0100 Marco Bettini (9a355e8aa7) fts: Parse mail header before checking whether to index it Fixes an issue where mime parts Content-type wasn't properly set, causing binary mime parts to be fed to the indexes. Broken in ddb85f3533842aa7c4e943c10bbd3dcb745c2eae M src/plugins/fts/fts-build-mail.c 2022-02-18 18:31:43 +0200 Timo Sirainen (1133504c52) dsync: Log reason why mailbox is synced with debug logging M src/doveadm/dsync/dsync-brain-mailbox.c M src/doveadm/dsync/dsync-brain-mails.c M src/doveadm/dsync/dsync-brain-private.h 2022-02-21 23:07:11 +0100 Timo Sirainen (8bc0825d97) dsync: If modseqs aren't permanent, assume HIGHESTMODSEQ=0 Otherwise the HIGHESTMODSEQ is just whatever happens to be in the in-memory view of the index, which most likely isn't the true HIGHESTMODSEQ. Using 0 makes it clear that the HIGHESTMODSEQ isn't valid and can't be used. M src/doveadm/dsync/dsync-brain-mailbox.c M src/doveadm/dsync/dsync-mailbox-import.c 2022-02-12 15:07:39 +0100 Stephan Bosch (9da4834ad0) submission-login: submission-proxy - Do not include initial response in AUTH command if it is too long. M src/submission-login/client.h M src/submission-login/submission-proxy.c 2022-02-21 21:36:55 +0100 Stephan Bosch (9a16de7aad) submission-login: submission-proxy - Rename local variable in proxy_send_login(). M src/submission-login/submission-proxy.c 2022-02-21 21:32:45 +0100 Stephan Bosch (7a79eba26e) lib-smtp: smtp-client - Move SMTP_BASE_LINE_LENGTH_LIMIT definition to smtp-common.h. M src/lib-smtp/smtp-client-private.h M src/lib-smtp/smtp-common.h 2022-02-21 21:29:23 +0100 Stephan Bosch (10b0d57967) lib-smtp: smtp-client-connection - Rename SMTP_CLIENT_BASE_LINE_LENGTH_LIMIT to SMTP_BASE_LINE_LENGTH_LIMIT. M src/lib-smtp/smtp-client-connection.c M src/lib-smtp/smtp-client-private.h 2022-02-23 14:21:02 +0100 Stephan Bosch (84fe9d12fc) lib-smtp: smtp-client-connection - Fix typo in comment. M src/lib-smtp/smtp-client-connection.c 2022-02-22 14:14:20 +0100 Timo Sirainen (d5d8b69aa7) director: Fix crashes caused by changing host tag Fixes: Panic: file director.c: line 1175 (director_move_user): assertion failed: (user->host->tag == host->tag) Panic: file director-request.c: line 303 (director_request_continue_real): assertion failed: (user->host->tag == mail_tag) M src/director/mail-host.c 2022-02-22 14:10:02 +0100 Timo Sirainen (44b7eda458) director: Prevent loops where directors keep changing host tags M src/director/director-connection.c 2022-02-21 12:47:29 +0100 Timo Sirainen (7a64ec1ef8) lib: If log prefix update can't be sent to log, exit with FATAL_LOGERROR M src/lib/failures.c 2022-02-21 12:39:02 +0100 Timo Sirainen (1bf3963714) lib: Fix losing log prefix or IP change when log process is busy The fd for writing to log process is non-blocking. When sending options to log process, it was done with write_full(), which stopped whenever EAGAIN was returned. This error was simply ignored, and the logging code thought that the prefix was successfully changed (or the IP was sent). This mainly caused a problem when processes were reused and log process was busy. The prefix update could have failed, and the following logging would be using the previous session's log prefix, i.e. log lines could have been logged for the wrong user/session. Broken by 9372e48b702a3af5705785e08fbf47b0e37f2047 M src/lib/failures.c 2022-02-06 14:20:08 +0100 Timo Sirainen (3e8befe6b5) dict: Fix potential timeout leak at deinit The deinit code could still trigger proctitle refresh. M src/dict/main.c 2022-02-22 11:23:33 +0100 Timo Sirainen (17118d5970) dict: Make sure proctitle refresh timeout goes to the main ioloop In some situations it could have gone to dict_wait() ioloop, causing timeout leaks or crashes. M src/dict/main.c 2021-10-25 15:43:00 +0300 Timo Sirainen (974e970889) lib-storage: Don't use cached message_parts while message is being parsed Finish the parsing instead. Otherwise there can be some confusion about parsed_bodystructure* fields, which indicate that data->parts have the bodystructure info while in reality data->parts came from cached fields and they have no bodystructure info. M src/lib-storage/index/index-mail.c 2021-10-25 12:22:06 +0300 Timo Sirainen (6b6d61e9d1) lib-storage: Reset bodystructure parsing state when reseting message_parts Fixes: Panic: file message-part-data.c: line 28 (message_part_data_is_plain_7bit): assertion failed: (data != NULL) M src/lib-storage/index/index-mail-headers.c M src/lib-storage/index/index-mail.c M src/lib-storage/index/index-mail.h M src/lib-storage/test-mail.c 2022-02-09 23:12:19 +0200 Timo Sirainen (d31af56e9a) dict-sql: Fix assert-crash if trying to rollback an open set/inc transaction Fixes: Panic: file dict-sql.c: line 911 (sql_dict_transaction_free): assertion failed: (!array_is_created(&ctx->prev_set)) M src/lib-dict-backend/dict-sql.c 2022-02-04 04:30:48 +0200 Martti Rannanjärvi (b743c13533) anvil: connect_limit_deinit() - Free ident_pid_hash elements M src/anvil/connect-limit.c 2022-02-11 09:17:58 +0100 Marco Bettini (feebfa572a) indexer: indexer_client_status_callback() - Fix accessing freed memory Broken by a9683d7b3 M src/indexer/indexer-client.c 2022-02-07 16:04:41 +0100 Marco Bettini (e65b925b86) indexer: Fix memory leak on indexer timeout M src/indexer/indexer-client.c 2022-02-04 01:28:45 +0200 Martti Rannanjärvi (ff258ecea5) stats: stats_metrics_remove_dynamic() - Free the removed metric M src/stats/stats-metrics.c 2022-02-04 01:32:18 +0200 Martti Rannanjärvi (8437a9224f) stats: stats_metric_alloc() - Fix indentation on p_new() call M src/stats/stats-metrics.c 2022-01-31 12:42:46 +0200 Martti Rannanjärvi (c5ef0ce4b7) replication: aggregator - Free replicator_connection content M src/replication/aggregator/replicator-connection.c 2022-02-01 14:22:31 +0100 Marco Bettini (12a751615b) mail-crypt: Fix for mail being wrongly storing encrypted via LMTP If 1st recipient has mail_crypt_save_version=2, and 2nd recipient has mail_crypt_save_version=0, the mail for 2nd recipient is wrongly stored encrypted. Same happens if 2nd recipient has mail_crypt disabled M src/plugins/mail-crypt/mail-crypt-plugin.c 2020-03-31 13:51:09 +0300 Timo Sirainen (a707e6907c) mail-crypt: Remove "plugin disabled" texts from errors The plugin isn't just disabled, the user initialization fails entirely. M src/plugins/mail-crypt/mail-crypt-plugin.c 2020-03-31 13:49:28 +0300 Timo Sirainen (4514e72dd7) mail-crypt: Fix crash when plugin is already initialized, but not used for another user Fixes: Panic: Module context mail_crypt_user_module missing M src/plugins/mail-crypt/mail-crypt-plugin.c 2021-04-29 21:09:01 +0300 Timo Sirainen (41e439f993) doveadm deduplicate: Simplify code by using doveadm_mail_iter_deinit_sync() M src/doveadm/doveadm-mail-deduplicate.c 2021-04-29 21:05:40 +0300 Timo Sirainen (d60ca6eaac) doveadm deduplicate: Optimize by deduplicating in a single transaction M src/doveadm/doveadm-mail-deduplicate.c 2022-02-14 13:50:02 +0200 Aki Tuomi (70a924bd84) pop3: Fix empty command handling If empty command is given, error out instead of trying to create event. This fixes a crash caused by d2ab26be6038bd53b13a3ff18c403d6c192c1d91. M src/pop3/pop3-client.c 2022-02-02 17:01:49 +0200 sergey.kitov (6b66c7694e) lib-master: Fix deinit memory leak with process_shutdown_filter M src/lib-master/master-service.c 2021-12-17 09:27:07 +0100 Marco Bettini (3b05ece496) plugins/fts: Allow plugins to carry state across calls during search session M src/plugins/fts/fts-api.h M src/plugins/fts/fts-search.c M src/plugins/fts/fts-storage.h 2022-01-26 16:09:29 +0200 Timo Sirainen (d6f90fc69e) auth: ldap: Drop partially saved results before retrying request Fixes "LDAP search returned multiple entries" happening after reconnects. M src/auth/db-ldap.c 2022-01-26 16:03:27 +0200 Timo Sirainen (c870c58f3f) auth: ldap: If any requests were lost, reconnect to LDAP server M src/auth/db-ldap.c 2022-01-26 16:00:45 +0200 Timo Sirainen (30325b92b7) auth: ldap: If LDAP connection appears to be hanging, abort all old requests Retrying the reconnect might fix them, but since this situation isn't supposed to happen in the first place, it's safer to just remove them entirely to guarantee that it's not trying to keep retrying them for a long time. M src/auth/db-ldap.c 2022-01-26 14:46:55 +0200 Timo Sirainen (6360d26c8a) auth: ldap: Reconnect to server if receiving unknown msgid It's unclear why this happens. Is it a bug on server or client side? Either way, this situation doesn't now fix itself automatically, so reconnecting should help. M src/auth/db-ldap.c 2022-01-26 14:43:01 +0200 Timo Sirainen (88d55b93ba) auth: ldap: Stop re-sending request after 3 disconnect+reconnects This prevents retrying the same LDAP request forever in situations where the request causes LDAP server to become disconnected. This might fix some real issues, but it was mainly implemented because testing the following commit caused infinite looping. M src/auth/db-ldap.c M src/auth/db-ldap.h 2022-02-01 14:57:16 +0100 Timo Sirainen (342c872791) lmtp: proxy - Add per-connection counter to session_id This way connections to two different backends don't try to use the same session_id. Add 'P' letter before the counter to clarify that it's the proxy connection counter. M src/lmtp/lmtp-proxy.c 2022-02-01 14:40:48 +0100 Timo Sirainen (84ebee8902) lmtp: Simplify/clarify per-recipient session ID The session ID is the transaction ID followed by an increasing recipient count (number of RCPT commands) in the SMTP transaction. Clarify this by adding 'R' letter before the counter. Also don't add the counter suffix at all for the first recipient, since most transactions only have a single recipient. M src/lmtp/lmtp-recipient.c 2022-02-01 14:35:05 +0100 Timo Sirainen (edf91ac779) lib-smtp: server-transaction - Simplify/clarify transaction ID The transaction ID is the session ID followed by an increasing transaction count (number of MAIL commands) in the SMTP server connection. Clarify this by adding 'T' letter before the counter. Also don't add the counter suffix at all for the first session, since most sessions only have a single transaction. M src/lib-smtp/smtp-server-transaction.c 2022-02-01 14:29:43 +0100 Timo Sirainen (f26b7d3c13) lib-smtp, lmtp: Add brackets to in logging This makes it clearer where the session-id stops. It's also similar to how it is in mail_log_prefix. M src/lib-smtp/smtp-server-transaction.c M src/lmtp/lmtp-proxy.c 2022-02-01 15:03:15 +0100 Timo Sirainen (7a168bb5b5) lmtp: proxy - Use recipient-specific session-id when logging the result Instead of transaction ID, which is shared between recipients. M src/lmtp/lmtp-proxy.c 2022-02-01 16:00:36 +0100 Timo Sirainen (d107539524) lmtp: struct lmtp_recipient - Change all strings to const M src/lmtp/lmtp-recipient.h 2022-01-27 21:40:25 +0100 Markus Valentin (9e151e0fd9) lib-storage: LAYOUT=index: Fix accessing freed memory when deleting \Noselect parents Broken by f5328d6f7e4a8e460c736fa0336f5766aa58abda M src/lib-storage/list/mailbox-list-index-backend.c 2022-01-28 10:54:53 +0100 Markus Valentin (dc5e01c2b2) lib-http: http_server_resource_create() - Remove unnecessary pool allocation Fixes leaking the memory pool created in stats_http_resource_add() M src/lib-http/http-server-resource.c 2022-01-26 04:00:32 +0100 Stephan Bosch (4a4a4cf02b) lib-smtp: test-smtp-client-errors - Add test for succesful authentication with large initial response. M src/lib-smtp/test-smtp-client-errors.c 2022-01-26 03:58:49 +0100 Stephan Bosch (3de3cd5987) lib-smtp: smtp-client-connection - Fix authentication with multi-roundtrip SASL mechanisms. Before, it would fail with an unexpected reply error. M src/lib-smtp/smtp-client-connection.c M src/lib-smtp/smtp-client-private.h 2022-01-24 01:39:19 +0100 Stephan Bosch (1a09d82bee) lib-smtp: test-smtp-client-errors - Add test for successful authentication. M src/lib-smtp/test-smtp-client-errors.c 2022-01-24 01:41:15 +0100 Stephan Bosch (20d406b91c) lib-smtp: test-smtp-client-errors - Rename "authentication failed" test to "authentication". M src/lib-smtp/test-smtp-client-errors.c 2022-01-28 03:14:16 +0100 Stephan Bosch (5ad9c03dc4) lib-smtp: smtp-client - Fix maximum line length to include CRLF. M src/lib-smtp/smtp-client-private.h 2022-01-21 01:08:31 +0100 Stephan Bosch (c8671f74ee) lib-smtp: smtp-client-connection - Do not include initial response in AUTH command if it is too long. M src/lib-smtp/smtp-client-connection.c M src/lib-smtp/smtp-client-private.h 2022-01-21 02:26:18 +0100 Stephan Bosch (02e43414e0) lib-smtp: smtp-client-connection - Move auth cleanup to separate function. M src/lib-smtp/smtp-client-connection.c 2022-01-28 03:17:59 +0100 Stephan Bosch (76810027a5) lib-sasl: dsasl-client - Make dsasl_client_free(&NULL) a no-op. M src/lib-sasl/dsasl-client.c M src/lib-smtp/smtp-client-connection.c M src/login-common/client-common-auth.c M src/login-common/client-common.c 2022-01-21 02:28:23 +0100 Stephan Bosch (94c8febccc) lib-smtp: smtp-client-connection - Reformat comment. M src/lib-smtp/smtp-client-connection.c 2022-01-26 19:28:33 +0100 Timo Sirainen (3e0a147292) indexer: Fix memory leak - worker_requests were never freed Broken by 141766b24f885259508ae39f2e18811018373bc7 M src/indexer/indexer.c M src/indexer/worker-connection.c M src/indexer/worker-connection.h 2022-01-25 23:31:34 +0100 Timo Sirainen (8e0763ac32) indexer: Fix memory leak - session IDs were never freed Broken by a8dcd4e2332c73087e9b148d34259230a77edb28 M src/indexer/indexer-queue.c 2021-12-01 12:21:48 +0200 Timo Sirainen (7b96f6cbf5) lib-storage: Fix search query that only contains SEARCH_MAILBOX_GUID Fixes assert-crash in virtual mailbox: Panic: file virtual-search.c: line 77 (virtual_search_get_records): assertion failed: (result != 0) M src/lib-storage/index/index-search-private.h M src/lib-storage/index/index-search.c 2021-12-16 11:49:24 +0200 sergey.kitov (a97162ccc6) lib-master: Add process_shutdown_filter setting M src/lib-master/master-service-private.h M src/lib-master/master-service-settings.c M src/lib-master/master-service-settings.h M src/lib-master/master-service.c M src/lib-master/master-service.h 2021-12-16 11:44:38 +0200 sergey.kitov (14f8d9c734) lib-master: Refactor parsing event filters from settings. M src/lib-master/master-service-settings.c 2021-12-16 11:38:53 +0200 sergey.kitov (623a7b2be8) lib-master: Remove check for client->filter == NULL before event_filter_match(). M src/lib-master/stats-client.c 2021-12-16 11:38:08 +0200 sergey.kitov (8e99dae094) lib: Add check for NULL to event_filter_match(). M src/lib/event-filter.c 2021-12-15 15:19:04 +0200 sergey.kitov (181f1456d6) lib-master: Whitespace cleanup. M src/lib-master/master-service-private.h M src/lib-master/master-service.c M src/lib-master/master-service.h 2021-12-01 13:35:12 +0200 sergey.kitov (1425e94b93) lib-storage: Emit event with process stat in mail_user_deinit(). M src/lib-storage/mail-user.c M src/lib-storage/mail-user.h 2021-12-07 16:58:43 +0200 sergey.kitov (d8c4013cdc) lib: Add event_add_int_non_zero() M src/lib/lib-event.c M src/lib/lib-event.h 2021-12-01 13:34:22 +0200 sergey.kitov (0ba13e8e70) lib: Add functionality for acquiring process stat. M src/lib/Makefile.am A src/lib/process-stat.c A src/lib/process-stat.h 2021-12-21 10:47:54 +0200 sergey.kitov (3a25648a1d) lib: add timeval_to_usecs() M src/lib/time-util.h 2021-12-20 16:17:54 +0200 sergey.kitov (578c5f4b8c) lib: Whitespace cleanup M src/lib/lib-event.c 2022-01-14 08:07:50 +0100 Markus Valentin (1e0870724b) lib-storage: mailbox-list: index_list_rename_mailbox() - Support NO-NOSELECT When NO-NOSELECT is configured delete parent mailboxes which are not selectable or existant when renaming child mailboxes. M src/lib-storage/list/mailbox-list-index-backend.c 2022-01-14 08:04:09 +0100 Markus Valentin (964fe86c5c) lib-storage: mailbox-list: index_list_delete_mailbox() - Support NO-NOSELECT When NO-NOSELECT is configured delete parent mailboxes which are not selectable or not existant when deleting child mailboxes. M src/lib-storage/list/mailbox-list-index-backend.c 2022-01-21 16:31:04 +0200 Timo Sirainen (77239a25c5) doveadm fetch/search: Use DOVEADM_MAIL_ITER_FLAG_STOP_WITH_CLIENT These commands only write output to the client, so it's safe to stop them if the client disconnects. M src/doveadm/doveadm-mail-fetch.c M src/doveadm/doveadm-mail-search.c 2022-01-21 16:29:48 +0200 Timo Sirainen (4eb82acbc3) doveadm: doveadm_mail_iter_init() - Add DOVEADM_MAIL_ITER_FLAG_STOP_WITH_CLIENT When this flag is used, the iteration is stopped if print ostream has reported an error, i.e. doveadm-client has disconnected. M src/doveadm/doveadm-mail-iter.c M src/doveadm/doveadm-mail-iter.h 2022-01-21 16:24:39 +0200 Timo Sirainen (2b2cdb719b) doveadm: doveadm_mail_iter_init() - Change bool parameter to flags M src/doveadm/doveadm-mail-altmove.c M src/doveadm/doveadm-mail-copymove.c M src/doveadm/doveadm-mail-deduplicate.c M src/doveadm/doveadm-mail-expunge.c M src/doveadm/doveadm-mail-fetch.c M src/doveadm/doveadm-mail-flags.c M src/doveadm/doveadm-mail-import.c M src/doveadm/doveadm-mail-iter.c M src/doveadm/doveadm-mail-iter.h M src/doveadm/doveadm-mail-mailbox-cache.c M src/doveadm/doveadm-mail-rebuild.c M src/doveadm/doveadm-mail-search.c 2022-01-20 14:16:51 +0100 Timo Sirainen (aacaf65d7f) doveadm-server: Fix hang when flushing print output and client disconnects M src/doveadm/doveadm-print-server.c 2022-01-20 14:13:48 +0100 Timo Sirainen (8f34eb952d) lib: ostream-multiplex - Call flush callbacks also when stream has failed It may be important for the flush callbacks to know when ostream has been closed. This is a partial fix to prevent doveadm-server hanging when it's printing lots of output and doveadm client disconnects. M src/lib/ostream-multiplex.c 2022-01-20 13:34:50 +0100 Timo Sirainen (d902430e43) doveadm: Fix assert-crash when proxying causes print buffer to be flushed Fixes: Panic: file ioloop.c: line 865 (io_loop_destroy): assertion failed: (ioloop == current_ioloop) M src/doveadm/doveadm-print-server.c 2021-12-22 12:12:51 +0100 Markus Valentin (d02a022d73) imapc: Fix doveadm copy with imapc When copying to a mailbox with imapc it does not sync the destination mailbox when opening. This created "Error: Syncing mailbox '$mailboxname' failed: Internal error occurred." Prevent this error by checking for the MAILBOX_FLAG_SAVEONLY flag which is used by doveadm to create the destination mailbox. If that flag is set ignore that there was no initial fetching done. M src/lib-storage/index/imapc/imapc-mail-fetch.c M src/lib-storage/index/imapc/imapc-sync.c 2022-01-21 12:12:52 +0200 Martti Rannanjärvi (2088e0917e) configure.ac: Set dovecot version to 2.3.100.devel This helps with version comparisons. M configure.ac 2022-01-14 04:02:09 +0100 Stephan Bosch (bcdc6ef0ec) submission: submission-backend-relay - Make sure QUIT command yields 221 when relay connection is closed normally. Before, it would sometimes erroneously treat the closing connection as a "connection lost" 421 situation. M src/submission/submission-backend-relay.c 2022-01-14 04:01:29 +0100 Stephan Bosch (9f05ce1758) submission: submission-backend-relay - Fix segfault in QUIT command client-side destruction. M src/submission/submission-backend-relay.c 2020-11-09 02:29:04 +0100 Stephan Bosch (a53380c353) lib-smtp: smtp-server-cmd-rset - Stop processing pipeline until RSET is complete. A subsequent MAIL command could get reset in the middle otherwise. Before, it only blocked input until a reply was submitted, but the transaction isn't reset until the RSET command is complete (just before actually sending the reply) which can cause issues when the subsequent MAIL command is already being processed. M src/lib-smtp/smtp-server-cmd-rset.c 2020-11-09 00:02:51 +0100 Stephan Bosch (5a7616f93b) lib-smtp: smtp-server-cmd-helo - Stop processing pipeline until HELO/EHLO is complete. A subsequent MAIL command could get reset in the middle otherwise. Before, it only blocked input until a reply was submitted, but the transaction isn't reset until the EHLO/HELO command is complete (just before actually sending the reply) which can cause issues when the subsequent MAIL command is already being processed. M src/lib-smtp/smtp-server-cmd-helo.c 2020-11-08 03:58:06 +0100 Stephan Bosch (5aeca06ad6) lib-smtp: smtp-server-command - Add smtp_server_command_pipeline_block/unblock(). M src/lib-smtp/smtp-server-command.c M src/lib-smtp/smtp-server-connection.c M src/lib-smtp/smtp-server-private.h M src/lib-smtp/smtp-server.h 2022-01-10 03:54:13 +0100 Stephan Bosch (d79841aa34) lib-smtp: smtp-client-transaction - Plug the command pipeline while transaction is pending. This prevents commands submitted after creating the transaction from being exectuted out-of-order before the transaction's MAIL command. M src/lib-smtp/smtp-client-transaction.c 2022-01-10 03:53:41 +0100 Stephan Bosch (ffbf4efea2) lib-smtp: smtp-client-transaction - Add smtp_client_command_mail_submit_after(). M src/lib-smtp/smtp-client-command.c M src/lib-smtp/smtp-client-command.h 2022-01-10 01:18:56 +0100 Stephan Bosch (2ccec52a52) lib-smtp: smtp-client-transaction - Prevent recursion for smtp_client_transaction_fail*(). M src/lib-smtp/smtp-client-transaction.c 2022-01-11 02:05:26 +0100 Stephan Bosch (c40e19df16) lib-smtp: Reformat smtp-server-cmd-quit.c. M src/lib-smtp/smtp-server-cmd-quit.c 2022-01-20 12:42:57 +0200 Timo Sirainen (6f703021eb) lib-storage: Don't delay setting mail event's log prefix This caused crashes if the mail event was kept referenced and used for logging after struct mail was already freed. With the delayed mail event creation the log prefix shouldn't be much of a performance problem, so just set the prefix immediately. Partially reverts bc68e1c368db746557829f67556f3c72943b7956. M src/lib-storage/mail.c 2022-01-19 15:07:58 +0100 Timo Sirainen (6b6465700f) configure: Update version to 2.3.devel M configure.ac 2021-11-30 12:47:52 +0200 Aki Tuomi (51bb266887) NEWS: Add news for 2.3.17.1 M NEWS 2021-09-28 12:40:29 +0300 Aki Tuomi (3330f8f631) NEWS: Add news for 2.3.17 M NEWS 2022-01-10 19:46:12 +0200 Timo Sirainen (26c5c2aa2b) lib-storage: Remove reason_code=mailbox:search Continues the slow per-mail event removals started in f3c568e3cbc113920bc029e07e56619589c6a26d. Reverts 87cd6570a14b3f572fc6000f710df409371a4bcb M src/lib-storage/index/index-search.c 2021-12-13 12:54:19 +0100 Stephan Bosch (c043787771) lmtp: lmtp-proxy - Add session ID to backend connection error replies. M src/lmtp/lmtp-proxy.c 2021-12-13 04:08:32 +0100 Stephan Bosch (b29d0df2ef) submssion: submission-backend-relay - Avoid logging two errors about a connection problem. Earlier commit changed lib-smtp to consistently log an error for connection problems, which causes a second error to occur for submission relay backend. This is undesirable. M src/submission/submission-backend-relay.c 2021-12-07 01:51:45 +0100 Stephan Bosch (08d650cb81) lmtp: lmtp-proxy - Add lmtp_verbose_replies setting. It causes the proxy to return errors with full details in replies to the LMTP client. M src/lmtp/lmtp-proxy.c M src/lmtp/lmtp-settings.c M src/lmtp/lmtp-settings.h 2021-12-27 11:35:05 +0100 Stephan Bosch (a0cd85f004) lmtp: lmtp-proxy - Split off lmtp_proxy_handle_connection_error(). M src/lmtp/lmtp-proxy.c 2022-01-04 21:20:22 +0100 Stephan Bosch (1d88bdfdf8) lmtp: lmtp-proxy - Change proxy connection failure message make more sense. M src/lmtp/lmtp-proxy.c 2021-12-07 01:58:32 +0100 Stephan Bosch (11b6ccdfce) lib-smtp: smtp-client - Add verbose_user_errors setting. It returns the detailed administrator errors as user error in the reply returned to the calling application. M src/lib-smtp/smtp-client-connection.c M src/lib-smtp/smtp-client.c M src/lib-smtp/smtp-client.h 2021-12-07 01:51:18 +0100 Stephan Bosch (40d49a038b) lib-smtp: smtp-client-connection - Log administrator connection failures at a single place. M src/lib-smtp/smtp-client-command.c M src/lib-smtp/smtp-client-connection.c M src/lib-smtp/smtp-client-private.h 2021-12-23 00:59:45 +0100 Stephan Bosch (f436df8709) lib-smtp: smtp-client-connection - Consistently log an error for connection failures. M src/lib-smtp/smtp-client-connection.c M src/lib-smtp/test-smtp-client-errors.c 2021-12-07 02:44:58 +0100 Stephan Bosch (5ef51c52ef) lib-smtp: smtp-client-connection - Add definition for repeatedly used connection error. M src/lib-smtp/smtp-client-connection.c 2021-12-27 11:24:36 +0100 Stephan Bosch (06f838091b) lmtp: Reformat lmtp-proxy.c. M src/lmtp/lmtp-proxy.c 2021-12-07 01:23:13 +0100 Stephan Bosch (2e82fdb706) lib-smtp: Reformat smtp-client-connection.c. M src/lib-smtp/smtp-client-connection.c 2022-01-05 01:27:48 +0000 Stephan Bosch (3575639fc4) lib-compression: ostream-zlib - Fix signed vs unsigned comparison. M src/lib-compression/ostream-zlib.c 2022-01-05 01:25:34 +0000 Stephan Bosch (5108d7bddd) lib: test-event-flatten - Fix format string specifier for usec time M src/lib/test-event-flatten.c 2021-12-28 09:37:42 +0200 Timo Sirainen (f3c568e3cb) lib-storage: Remove most reason_code=mail:* Event reasons create events internally. This is rather expensive if it's done for operations that access all emails in a large folder, e.g. SORT. The per-mail reason_codes also didn't seem to be hugely helpful, so best to just remove them. Some of the mail:* reasons were left where they are causing mail stream to be opened anyway. In these cases the extra CPU used by event reasons is relatively little. Reverts ce517f8323fa4a60b230f29712b207139badb3f0 M src/lib-storage/index/index-mail.c M src/lib-storage/mail.c 2021-12-20 11:05:39 +0200 Timo Sirainen (ac4d66e25e) maildir: maildir_filename_base_hash() - Disable ubsan integer wrapping checks M src/lib-storage/index/maildir/maildir-filename.c 2021-12-09 18:06:11 +0100 Timo Sirainen (ac7bcc31c9) lib-fts: Reuse textcat handle between sessions textcat initialization is rather CPU intensive. Its configuration is normally always the same between sessions, so we can keep the latest textcat handle cached. M src/lib-fts/fts-language.c 2021-11-29 17:05:18 +0100 Timo Sirainen (fd7248b707) lib-storage: Remove index_mail_data.seq The seq already exists in struct mail, so this unnecessarily duplicated it. M src/lib-storage/index/index-mail-headers.c M src/lib-storage/index/index-mail.c M src/lib-storage/index/index-mail.h 2021-11-29 16:21:29 +0100 Timo Sirainen (767b689cfb) lib-storage: Minor optimization - Use mail_index_lookup_full() to avoid two index lookups mail_index_is_expunged() was already internally doing the full lookup. M src/lib-storage/index/index-mail.c 2021-11-29 16:16:30 +0100 Timo Sirainen (526a0f5b18) lib-index: mail_index_lookup_full() - Add expunged_r parameter M src/lib-index/mail-index-modseq.c M src/lib-index/mail-index-view.c M src/lib-index/mail-index.h 2021-11-29 13:26:25 +0100 Timo Sirainen (bc68e1c368) lib-storage: Optimize setting mail event log prefix This was much more important before mail event creation was delayed. In one installation the t_strdup_printf() call itself took about 4% of the total CPU usage. Now that mail events are delayed, this is likely much less of an issue. Still, this is easy enough of an optimization that might as well do it. M src/lib-storage/mail.c 2021-11-29 15:46:04 +0100 Timo Sirainen (165be3edb6) lib-storage: Delay creating mail event until mail_event() is called Mails can be accessed a lot. The event handling code takes up a lot of CPU, but most of the time the created event wasn't actually used for anything. M src/lib-storage/index/index-mail.c M src/lib-storage/mail-storage-private.h M src/lib-storage/mail-storage.h M src/lib-storage/mail.c 2021-11-29 15:43:29 +0100 Timo Sirainen (a24e4a14f9) lib-storage: Make sure mail event is created before accessing streams or metadata This is in preparation for the next commit which delays the mail event creation. The event duration behaves better if the event is created before any potentially slow access is done. M src/lib-storage/mail-storage-private.h M src/lib-storage/mail.c 2021-11-29 15:36:58 +0100 Timo Sirainen (58eef6713e) lib-storage: Move struct mail.event to mail_private M src/lib-storage/index/index-mail.c M src/lib-storage/mail-storage-private.h M src/lib-storage/mail-storage.h M src/lib-storage/mail.c 2021-11-29 15:32:28 +0100 Timo Sirainen (b0596718ab) lib-lda, lib-storage: Use mail_event() M src/lib-lda/mail-send.c M src/lib-storage/mail.c 2021-11-29 15:31:17 +0100 Timo Sirainen (4b3775baf0) lib-storage: Add mail_event() M src/lib-storage/mail-storage.h M src/lib-storage/mail.c 2021-11-29 18:39:22 +0100 Timo Sirainen (13fd3c3256) lib-storage: Add and use mail_metadata_access_start() M src/lib-storage/index/maildir/maildir-mail.c M src/lib-storage/index/raw/raw-mail.c M src/lib-storage/mail-storage-private.h M src/lib-storage/mail.c 2021-11-29 18:32:09 +0100 Timo Sirainen (988a575c35) lib-storage: Add and use mail_stream_access_start() This replaces setting mail_stream_accessed directly. M src/lib-storage/index/dbox-multi/mdbox-mail.c M src/lib-storage/index/dbox-single/sdbox-mail.c M src/lib-storage/index/imapc/imapc-mail-fetch.c M src/lib-storage/index/imapc/imapc-save.c M src/lib-storage/index/index-mail.c M src/lib-storage/index/maildir/maildir-mail.c M src/lib-storage/index/mbox/mbox-mail.c M src/lib-storage/index/pop3c/pop3c-mail.c M src/lib-storage/index/raw/raw-mail.c M src/lib-storage/mail-storage-private.h M src/lib-storage/mail.c 2021-11-29 18:35:31 +0100 Timo Sirainen (e06ee029f6) lib-storage: raw: get_stream() - Add missing lookup_abort and mail_stream_accessed handling M src/lib-storage/index/raw/raw-mail.c 2021-11-29 18:34:43 +0100 Timo Sirainen (2f2e3b3d37) pop3c: Add missing lookup_abort and mail_stream_accessed handling M src/lib-storage/index/pop3c/pop3c-mail.c 2021-11-29 20:44:05 +0100 Timo Sirainen (5b97f3af04) maildir: get_stream() - Add missing lookup_abort and mail_stream_accessed handling M src/lib-storage/index/maildir/maildir-mail.c 2021-11-29 18:24:30 +0100 Timo Sirainen (d7b8c40971) lib-storage: Rename mail.mail_stream_opened to mail_stream_accessed It is set to TRUE even if the mail stream couldn't successfully be opened, so this describes it better. Also it's now consistent with mail_metadata_accessed. M src/lib-storage/index/dbox-multi/mdbox-mail.c M src/lib-storage/index/dbox-single/sdbox-mail.c M src/lib-storage/index/imapc/imapc-mail-fetch.c M src/lib-storage/index/index-mail.c M src/lib-storage/index/index-mailbox-size.c M src/lib-storage/index/index-sort.c M src/lib-storage/index/mbox/mbox-mail.c M src/lib-storage/mail-storage.h 2021-12-03 10:44:10 +0200 Timo Sirainen (74b94e02e5) lib-index: Remove mail_cache_lookup_finished event This event was using too much CPU with commands that accessed lots of mails (e.g. IMAP SORT). It also wasn't especially useful. Reverts 0d252dccb3013fea4d9a28bd5fafb5ea6e847d0e M src/lib-index/mail-cache-lookup.c 2021-12-02 11:35:20 +0200 Timo Sirainen (1fb3dda9ac) lib-index: Use ATTR_COLD for error/corruption handling functions This could reduce CPU usage due to better branch prediction. M src/lib-index/mail-cache-private.h M src/lib-index/mail-cache.h M src/lib-index/mail-index-private.h M src/lib-index/mail-index-strmap.h M src/lib-index/mail-index-sync-private.h M src/lib-index/mail-index.h M src/lib-index/mail-transaction-log-private.h M src/lib-index/mail-transaction-log.h 2021-11-23 15:00:02 +0100 Timo Sirainen (4a74574d39) lib: pool_alloconly_destroy() optimization - Don't clear the last block before free The block is going to be freed, so there's no need to clear it. (The clearing still happens if clean_frees=TRUE.) M src/lib/mempool-alloconly.c 2021-11-23 14:59:28 +0100 Timo Sirainen (40666e3bca) lib: pool_alloconly_destroy() - Deduplicate code M src/lib/mempool-alloconly.c 2021-11-23 14:58:39 +0100 Timo Sirainen (7c9ee911cf) lib: Split off pool_alloconly_free_block() M src/lib/mempool-alloconly.c 2021-11-23 14:56:10 +0100 Timo Sirainen (333bd2e628) lib: Split off pool_alloconly_free_blocks_until_last() M src/lib/mempool-alloconly.c 2021-11-23 15:17:49 +0200 Timo Sirainen (0bcc6897de) lib: Minor optimization - Avoid zeroing a newly created empty event field M src/lib/lib-event.c 2021-11-22 17:36:21 +0100 Timo Sirainen (9fc6965de1) lib: Remove copy of event_passthrough from struct event There was no need for it. This saves some memory and CPU. This change now prevents modifications to the event_passthrough, but nothing was doing it before either. M src/lib/lib-event-private.h M src/lib/lib-event.c 2021-11-22 17:23:28 +0100 Timo Sirainen (a2ea3df64f) lib: Grow initial event pool size to 1024 bytes The old 64 bytes size wasn't enough to allocate even the struct event itself. M src/lib/lib-event.c 2021-12-15 09:19:40 +0100 Karl Fleischmann (793cae8549) login-common: Explicitly null client auth fields on proxy pool unref Explicitly setting `client_id` and `forward_fields` to null in the client may reveal use-after-free issues when trying to access these fields on a client proxy. M src/login-common/client-common.c 2021-12-10 11:04:06 +0100 Karl Fleischmann (7ad1a92aa5) login-common: Use base index for aliases Define a base index for aliases in the login variable table. Assign values via offset of that base index. This allows adding more values later without updating any subsequent index. M src/login-common/client-common.c 2021-12-10 11:32:37 +0100 Marco Bettini (ddb85f3533) fts: Add headers filters M src/plugins/fts/fts-api-private.h M src/plugins/fts/fts-api.c M src/plugins/fts/fts-build-mail.c 2021-12-10 11:30:08 +0100 Marco Bettini (24b66ca063) fts: fts-build-mail - Remove stray line M src/plugins/fts/fts-build-mail.c 2020-11-10 00:11:15 +0100 Stephan Bosch (a92209788d) auth: mech-scram - Amend comments. M src/auth/mech-scram.c 2020-11-10 00:11:11 +0100 Stephan Bosch (49b5780c29) auth: mech-scram - Fix handling of authzid. The gs2-header field was not recreated correctly for the final verification. Fixed by storing the complete gs2-header value instead. M src/auth/mech-scram.c 2020-11-10 00:11:07 +0100 Stephan Bosch (a164ea3786) auth: mech-scram - Properly size temporary string buffers. M src/auth/mech-scram.c 2020-11-10 00:11:03 +0100 Stephan Bosch (1ee7d0d807) auth: mech-scram - Restructure message parsing in parse_scram_client_first(). M src/auth/mech-scram.c 2020-11-10 00:10:57 +0100 Stephan Bosch (6678648cfb) auth: Reformat mech-scram.c. M src/auth/mech-scram.c 2021-08-20 17:43:09 +0300 Timo Sirainen (15f25bf7ad) lib-storage: Return reason string in mailbox_vfuncs.list_index_has_changed() The callers can use it to log why the list index had changed. M src/lib-storage/index/index-storage.h M src/lib-storage/index/index-sync.c M src/lib-storage/index/maildir/maildir-sync-index.c M src/lib-storage/index/maildir/maildir-sync.h M src/lib-storage/index/mbox/mbox-sync-list-index.c M src/lib-storage/index/mbox/mbox-sync-private.h M src/lib-storage/list/mailbox-list-index-status.c M src/lib-storage/list/mailbox-list-index.c M src/lib-storage/mail-storage-private.h M src/plugins/virtual/virtual-storage.c 2021-08-20 19:09:17 +0300 Timo Sirainen (e13768d2ee) lib-storage: Don't call mailbox_vfuncs.list_index_has_changed() in data stack frame This will be required by the next change. M src/lib-storage/list/mailbox-list-index-iter.c M src/lib-storage/list/mailbox-list-index-status.c M src/lib-storage/list/mailbox-list-index.c 2021-08-20 17:26:42 +0300 Timo Sirainen (6fb3e493e2) lib-storage: mailbox_list_index_view_open() - Log a debug line why index isn't up-to-date M src/lib-storage/list/mailbox-list-index.c 2021-08-20 17:20:01 +0300 Timo Sirainen (49d2d1d9ba) lib-storage: mailbox_list_index_status() - Return failure reason string Log a debug line if mailbox list index couldn't be used to get the wanted status information. M src/lib-storage/list/mailbox-list-index-backend.c M src/lib-storage/list/mailbox-list-index-notify.c M src/lib-storage/list/mailbox-list-index-status.c M src/lib-storage/list/mailbox-list-index.h M src/lib-storage/list/mailbox-list-notify-tree.c 2021-12-06 11:54:16 +0100 Marco Bettini (7751299dee) auth: userdb-ldap - Avoid early dereferencing userdb_ldap_iterate_callback() is still invoked after dereferencing auth_request in userdb_ldap_iterate_deinit(). Normally this happens only on teardown, but it may happens also in case of auth disconnecting from auth-worker during iteration. (which shouldn't happen unless the auth process crashes) M src/auth/userdb-ldap.c 2021-12-09 17:31:04 +0100 Timo Sirainen (2302fcd607) var-expand-crypt: Remove dead code It's correct that dcrypt library shouldn't be deinitialized at plugin deinit. M src/plugins/var-expand-crypt/var-expand-crypt-plugin.c 2021-12-03 17:23:35 +0200 Timo Sirainen (82be40f65c) login-common: Add more fields to proxy_session_finished Added disconnect_side, disconnect_reason, idle_secs, bytes_in, bytes_out. M src/login-common/login-proxy.c 2021-12-03 17:54:37 +0200 Timo Sirainen (da379cfc29) login-common: Split off proxy disconnection prefix to LOGIN_PROXY_KILL_PREFIX M src/login-common/login-proxy.c 2021-12-03 17:47:50 +0200 Timo Sirainen (d36139fc22) login-common: login_proxy_free_*() - Rename reason to log_msg This better describes it, since it's the full log message. M src/login-common/login-proxy.c 2021-12-01 14:46:04 +0200 Timo Sirainen (203147d0fc) dsync: Fix -I max-size to actually be the max-size rather than min-size The -I max-size parameter was supposed to be used to skip mails that are larger than max-size. Instead, it skipped mails that were smaller. M src/doveadm/dsync/dsync-mailbox-import.c 2021-11-09 13:42:24 +0100 Timo Sirainen (34f2fdeed5) man: Add missing parameters to doveadm-sync M doc/man/doveadm-sync.1.in 2021-11-30 18:02:14 +0200 Timo Sirainen (e6a5cb57d1) dsync: Remove -D parameter that disables syncing mailbox renames It hasn't been necessary for a long time, and its behavior seems to be broken. M src/doveadm/doveadm-dsync.c M src/doveadm/dsync/dsync-brain-mailbox-tree.c M src/doveadm/dsync/dsync-brain-private.h M src/doveadm/dsync/dsync-brain.c M src/doveadm/dsync/dsync-brain.h M src/doveadm/dsync/dsync-ibc-stream.c 2021-11-09 13:41:37 +0100 Timo Sirainen (96f9651c98) dsync: Add back various missing parameters Also add them to the usage string. Broken by 5676c510bfa9217df05e9b7cb000ae3554d66f22 M src/doveadm/doveadm-dsync.c 2021-09-22 14:50:50 -0600 Michael M Slusarz (2beae65898) fts: Don't overwrite INUSE error if indexing times out M src/plugins/fts/fts-indexer.c M src/plugins/fts/fts-storage.c 2021-11-11 12:31:49 +0200 Aki Tuomi (61d9023523) lib-storage/index: If mail stream was already opened, do not count it as slow vsize access imapc storage driver will open the mail stream in some circumstances during search, so do not consider this as slow vsize. M src/lib-storage/index/index-mailbox-size.c 2021-11-16 15:08:47 +0200 Aki Tuomi (73475e1ea6) lib-storage: Split off index_mailbox_vsize_finish_bg() Simplifies next commit M src/lib-storage/index/index-mailbox-size.c 2021-08-10 12:22:08 +0300 Timo Sirainen (1ee84ba065) lib-index: Fix storing cache fields' last_used with 64bit big endian CPUs M src/lib-index/mail-cache-fields.c 2019-01-17 12:13:38 +0200 Timo Sirainen (616684a8fe) maildir: Fix crash at error handling At this point dest_mail is already NULL. Mainly could happen when running out of disk space. M src/lib-storage/index/maildir/maildir-save.c 2021-11-30 09:51:25 +0000 Siavash Tavakoli (ea41bf7db1) login-proxy: Don't send proxying start event for reconnects Send the event only for the beginning of proxying and add the reconnect counts as a field for _established and _finished events. M src/login-common/login-proxy.c 2021-11-26 14:45:47 +0100 Marco Bettini (2f7254a6af) lib: str_parse_intmax() - Replace signed expression with UNSIGNED_MINUS() Found by code analysis tool M src/lib/strnum.c 2021-11-26 15:48:04 +0100 Marco Bettini (5297d4862f) lib: switch i_rand_limit() - Replace signed expression with UNSIGNED_MINUS() Found by code analysis tool M src/lib/rand.c 2021-11-26 14:15:07 +0100 Marco Bettini (4a3ef239b4) lib: buffer_truncate_rshift_bits() - Replace signed expression with an unsigned equivalent Found by code analysis tool M src/lib/buffer.c 2021-11-29 15:05:29 +0100 Marco Bettini (668bdc6838) lib: bits_rotXYY() - Replace signed expression with UNSIGNED_MINUS() macro for unsigned 2's complement Found by code analysis tool M src/lib/bits.h M src/lib/test-bits.c 2021-11-29 15:00:41 +0100 Marco Bettini (bf9c2cb8b5) bits_is_power_of_two() Replace signed expression with __builtin_popcountl() Found by code analysis tool M src/lib/bits.h M src/lib/test-bits.c 2021-11-29 14:58:33 +0100 Marco Bettini (f7cbaac8ff) lib: test-bits.c - Removing stray spaces at end of lines M src/lib/test-bits.c 2021-01-15 17:43:19 +0100 Fabrice Bellet (9211e803f2) raw-storage: copy the envelope sender instead of referencing it M src/lib-storage/index/raw/raw-storage.c 2019-10-14 16:43:57 +0300 Timo Sirainen (4a58d467b6) lib-fs: Add test-fs utility for testing fs drivers It performs random read/write/delete/iter operations. M src/util/Makefile.am A src/util/test-fs.c 2021-06-18 15:19:48 +0300 Timo Sirainen (051d39ee45) replicator: doveadm replicator replicate -f didn't always start full sync The full sync happened only if the dsync queue was already full. If it wasn't, dsync was called too early before user->force_full_sync was set. M src/replication/replicator/replicator-brain.c 2021-07-28 11:52:01 +0300 Timo Sirainen (d0c28bba8b) replicator: Move replicator_brain_timeout(() M src/replication/replicator/replicator-brain.c 2021-04-19 18:48:09 +0200 Timo Sirainen (21880fac08) lib-storage: Optimize behavior when building THREAD tree with empty cache Although it's possible that Date, Subject or received-date isn't actually needed for all mails, it's much more efficient behavior to add all of these to cache at the same time if they're not there already. Otherwise the same mail could be opened and parsed up to 3 times. M src/lib-storage/index/index-thread.c 2020-04-02 11:06:36 +0300 Timo Sirainen (8abebfe9a4) dsync: Improve checking if source and destination are the same location Prefer checking using the first -n parameter's namespace. Next try prefix="" if it's created and last fallback to inbox=yes namespace. M src/doveadm/doveadm-dsync.c 2021-11-22 18:17:52 +0200 Timo Sirainen (27e371af06) dsync: Improve bad namespace configuration related error messages M src/doveadm/doveadm-dsync.c 2021-11-24 16:01:08 +0100 Marco Bettini (5519de5749) submission: smtp_server_command_execute() Remove check for null pointer confusing coverity M src/lib-smtp/smtp-server-command.c 2021-11-22 16:04:11 +0000 Siavash Tavakoli (c36969fee5) imapc: Do not include the root node in list if it's the namespace prefix Otherwise namespace prefix is added to the mailbox tree as a separate node. Fixes duplicated shared namespace root in mailbox list. M src/lib-storage/index/imapc/imapc-list.c 2021-11-23 15:56:45 +0100 Marco Bettini (5cf012bad9) acl: acl_mailbox_exists() - Add missing error handling Set mailbox storage error to "internal error" when acl_object_get_my_rights() fails (as per contract). M src/plugins/acl/acl-mailbox.c 2021-11-23 16:03:07 +0100 Marco Bettini (a672d83152) lib-storage: fail_mailbox_exists() - Return not found as a success instead of an error GETMETADATA sometimes responds with “NO [SERVERBUG] BUG: Unknown internal error returned”, instead of “NO Mailbox doesn't exist”, depending on the actual configuration. This can happen with the shared namespace. M src/lib-storage/fail-mailbox.c 2021-11-23 17:55:43 +0200 Martti Rannanjärvi (13ed86bbf3) login-common: Default director_username_hash to %Lu like everywhere else This setting has many places where the default is set, and this syncs it with the others. M src/login-common/login-settings.c 2021-11-12 11:16:47 +0100 Stephan Bosch (d36d2c595a) lib-storage: mail-duplicate - Fix segfault occurring when user has no configured home directory Occurred only when a duplicate DB transaction was created. M src/lib-storage/mail-duplicate.c 2021-11-12 10:43:16 +0100 Stephan Bosch (98f709deac) lib-storage: mail-duplicate - Fix panic occurring when user has no configured home directory. Panic was: Panic: file imem.c: line 65 (i_strconcat): assertion failed: (str1 != NULL) M src/lib-storage/mail-duplicate.c 2021-11-11 09:57:07 +0200 sergey.kitov (476990fffa) stats: Whitespace cleanup. M src/stats/stats-metrics.c 2021-11-09 14:12:18 +0200 sergey.kitov (e41cd77f96) doveadm: Fix processing of group-by parameter of doveadm stats add. M src/doveadm/doveadm-stats.c 2020-09-25 03:48:09 +0200 Stephan Bosch (6341cfc57a) lib-smtp: smtp-client-transaction - Always drop MAIL/RCPT state data before calling callbacks. This prevents problems with callbacks destroying the transaction, the connection, or commands involved in the transaction. This at least fixes a segmentation fault occurring in the submission service when STARTTLS fails during login. M src/lib-smtp/smtp-client-transaction.c 2021-11-08 23:29:35 +0100 Stephan Bosch (0037fb7bad) lib-smtp: smtp-client-transaction - Make smtp_client_transaction_rcpt_fail_reply(NULL, reply) a no-op. M src/lib-smtp/smtp-client-transaction.c 2020-09-25 03:31:07 +0200 Stephan Bosch (30f0154b78) lib-smtp: smtp-client-transaction - Make smtp_client_transaction_rcpt_abort(NULL) a no-op. M src/lib-smtp/smtp-client-transaction.c 2020-09-25 03:29:53 +0200 Stephan Bosch (53b3b9f55b) lib-smtp: smtp-client-transaction - Make smtp_client_transaction_rcpt_replied(NULL) a no-op. M src/lib-smtp/smtp-client-transaction.c 2020-09-25 03:27:39 +0200 Stephan Bosch (f4c5ab773a) lib-smtp: smtp-client-transaction - Assert that smtp_client_transaction_rcpt_approved/denied() has non-NULL parameter. M src/lib-smtp/smtp-client-transaction.c 2020-09-25 03:24:29 +0200 Stephan Bosch (5e68870131) lib-smtp: smtp-client-transaction - Make smtp_client_transaction_rcpt_free(NULL) a no-op. M src/lib-smtp/smtp-client-transaction.c 2020-09-25 03:22:45 +0200 Stephan Bosch (da73aac321) lib-smtp: smtp-client-transaction - Make smtp_client_transaction_mail_fail_reply(NULL, reply) a no-op. M src/lib-smtp/smtp-client-transaction.c 2020-09-25 03:21:06 +0200 Stephan Bosch (86debae8fe) lib-smtp: smtp-client-transaction - Make smtp_client_transaction_mail_abort(NULL) a no-op. M src/lib-smtp/smtp-client-transaction.c 2020-09-25 03:18:56 +0200 Stephan Bosch (8f2751f53d) lib-smtp: smtp-client-transaction - Make smtp_client_transaction_mail_replied(NULL, reply) a no-op. M src/lib-smtp/smtp-client-transaction.c 2020-09-25 03:17:57 +0200 Stephan Bosch (02079622d1) lib-smtp: smtp-client-transaction - Make smtp_client_transaction_mail_free(NULL) a no-op. M src/lib-smtp/smtp-client-transaction.c 2020-09-25 02:45:27 +0200 Stephan Bosch (c588b55541) lib-smtp: smtp-client-command - Drop callback before call in smtp_client_command_input_reply(). M src/lib-smtp/smtp-client-command.c 2020-09-25 02:38:54 +0200 Stephan Bosch (34e5a418c1) lib-smtp: smtp-client-command - Make smtp_client_command_fail_reply(NULL, reply) a no-op. M src/lib-smtp/smtp-client-command.c 2020-09-25 02:33:33 +0200 Stephan Bosch (ed211d21b0) lib-smtp: smtp-client-command - Make smtp_client_command_abort(NULL) a no-op. M src/lib-smtp/smtp-client-command.c 2020-09-25 03:00:31 +0200 Stephan Bosch (15c98d994b) lib-smtp: Reformat smtp-client-transaction.c. M src/lib-smtp/smtp-client-transaction.c 2020-09-25 03:14:16 +0200 Stephan Bosch (ec3cdb2168) lib-smtp: Reformat smtp-client-command.c. M src/lib-smtp/smtp-client-command.c 2021-10-28 09:19:37 +0200 Marco Bettini (1863b1c535) lib-fts: Don't index inline base64 encoded content M src/lib-fts/fts-tokenizer-generic.c M src/lib-fts/test-fts-tokenizer.c 2021-11-14 23:27:00 +0100 Stephan Bosch (771ebaf961) lib-smtp: smtp-server-command - Emit smtp_server_command_started event a little later. This way cmd_*args fields are available for the event. M src/lib-smtp/smtp-server-command.c 2021-10-27 00:48:28 +0200 Stephan Bosch (6687627b15) lib-smtp: smtp-server-command - Add cmd_args and cmd_human_args fields. This mirrors the identically named fields for the imap service. For SMTP, though, cmd_human_args == cmd_args. M src/lib-smtp/smtp-server-command.c 2021-07-19 11:53:41 +0200 Stephan Bosch (f0e2299322) lib-http: http-client-connection - Fix crash in http_client_connection_server_close(). The conn->peer member is only not NULL when the connection is associated with a peer object. If it is not, http_client_connection_server_close() will crash. Fixed by doing the peer->client operations only when there is an associated peer. M src/lib-http/http-client-connection.c 2020-06-27 17:55:58 +0200 Stephan Bosch (9032716e00) lib-http: Reformat http-client-connection.c. M src/lib-http/http-client-connection.c 2021-10-29 11:42:40 +0300 sergey.kitov (f572de72f4) lib: Add unit tests for named events only optimization. M src/lib/event-filter-private.h M src/lib/event-filter.c M src/lib/test-event-filter.c 2021-10-29 14:06:39 +0300 sergey.kitov (5a69a67fb8) lib: Fix event filtering for unnamed events with optional event name For example event filter "event=ev_name OR field1=value1" wouldn't previously match if the event didn't have any name, even if it did have field1=value1. M src/lib/event-filter-parser.y M src/lib/event-filter.c 2021-10-22 12:09:24 +0300 sergey.kitov (f01aec1f96) lib-master: Whitespace cleanup. M src/lib-master/master-service.c 2021-11-09 14:37:07 +0200 Aki Tuomi (f083562f92) auth: passdb-cache - Preserve cached fields when verifying password with worker M src/auth/passdb-cache.c 2021-11-05 17:11:49 +0100 Stephan Bosch (533ef6c62d) lib-smtp: smtp-server-command - Hold a command reference while sending replies. Fixes segfault at smtp-server-reply.c:652. M src/lib-smtp/smtp-server-command.c 2021-11-05 16:53:48 +0100 Stephan Bosch (2275fc4d51) lib-smtp: smtp-server-command - Split off smtp_server_command_send_more_replies(). M src/lib-smtp/smtp-server-command.c 2021-11-05 16:46:15 +0100 Stephan Bosch (9ae95cb884) lib-smtp: smtp-server-command - Split off smtp_server_command_send_replies(). M src/lib-smtp/smtp-server-command.c M src/lib-smtp/smtp-server-connection.c M src/lib-smtp/smtp-server-private.h 2021-11-08 14:36:57 +0200 sergey.kitov (083570cb73) plugins/fts: Fix memory leak when searching mail in virtual folder with fts. M src/plugins/fts/fts-storage.c 2021-11-08 14:04:07 +0200 Aki Tuomi (5afea22757) configure: Fix version macros to work with devel version M configure.ac 2021-11-08 15:24:30 +0200 Aki Tuomi (318f566fc4) SECURITY.md: Add initial security policy A SECURITY.md 2021-10-26 16:59:29 +0300 Timo Sirainen (e188435026) lib-fts: Fix address tokenizer to handle large input properly Previously it could have used excessive amounts of memory if the input didn't contain separator characters. The fix changes a bit how the address-tokenizer works: Previously large email addresses were saved as truncated tokens. Now they're skipped entirely by the address tokenizer. Similarly when searching long email addresses they're no longer searched as truncated tokens, but instead simply fed to the parent tokenizer which (likely) searches them in smaller pieces. Note that this also sometimes changes the order in which tokens are returned, e.g. "foo", "example", "foo@example.com", "com" instead of returning "com" before the email address. This isn't ideal, but fixing it seems annoyingly complicated and practically it doesn't matter right now. M src/lib-fts/fts-tokenizer-address.c M src/lib-fts/test-fts-tokenizer.c 2021-10-26 16:34:25 +0300 Timo Sirainen (2af8437d1d) lib-fts: Implement support for parent tokenizer "streaming" By default parent tokenizer is further tokenizing the token strings returned by child tokenizer. When streaming is enabled, the parent tokenizers are instead tokenizing a stream of data sent by the child tokenizer. This effectively makes the parent tokenizer return the same tokens as if the child tokenizer didn't exist (assuming child tokenizer feeds the parent all the same input). Arguably this should be the only way tokenizers work, but at least for now lets keep both ways. M src/lib-fts/fts-tokenizer-private.h M src/lib-fts/fts-tokenizer.c 2021-10-26 12:33:50 +0300 Timo Sirainen (782d806db2) lib-fts: fts-tokenizer - Add comments explaning how it works M src/lib-fts/fts-tokenizer.c 2021-10-26 11:52:22 +0300 Timo Sirainen (2e91a13fe9) lib-fts: test-fts-tokenizer - Add more uniqueness to the long email address This helps at least with debugging problems. M src/lib-fts/test-fts-tokenizer.c 2021-09-14 18:21:09 +0200 Timo Sirainen (31c24137c2) lib: DOVECOT_PREREQ() - Add micro version Nowadays APIs can change between micro versions as well. M src/lib/macros.h 2021-09-14 18:23:41 +0200 Timo Sirainen (cb5968f451) lib: DOVECOT_PREREQ() - Remove surrounding if checks The DOVECOT_VERSION_* macros are expected to always exist. M src/lib/macros.h 2021-09-14 18:21:03 +0200 Timo Sirainen (d199125cc5) configure: Add DOVECOT_VERSION_MICRO M configure.ac 2021-11-02 16:06:55 +0200 Timo Sirainen (e95f985635) lib: Fix building with --disable-asserts The #endif location was wrong. M src/lib/macros.h 2021-01-27 02:20:53 +0100 Stephan Bosch (17efe7a404) submission-login: Implicitly login using EXTERNAL mechanism upon MAIL if enabled. This is a workaround for TLS clients that present a valid client certificate, yet don't authenticate explicitly. This is enabled by setting: submission_client_workarounds = implicit-auth-external M src/submission-login/client-authenticate.c M src/submission-login/client-authenticate.h M src/submission-login/client.c M src/submission-login/submission-login-settings.c M src/submission-login/submission-login-settings.h M src/submission/main.c M src/submission/submission-client.c M src/submission/submission-client.h M src/submission/submission-settings.c 2021-10-14 12:47:23 +0200 Stephan Bosch (1236352801) submission-login: client-authenticate - Split off cmd_auth_set_master_data_prefix(). M src/submission-login/client-authenticate.c 2021-01-27 13:51:03 +0100 Stephan Bosch (14b6f813e0) login-common: sasl-server - Add support for implicit login. M src/login-common/client-common-auth.c M src/login-common/sasl-server.c M src/login-common/sasl-server.h 2021-01-27 13:43:23 +0100 Stephan Bosch (d4321dd910) login-common: sasl-server - Turn private argument of sasl_server_auth_begin() into flag. M src/login-common/client-common-auth.c M src/login-common/client-common.h M src/login-common/sasl-server.c M src/login-common/sasl-server.h 2021-01-27 13:39:23 +0100 Stephan Bosch (d5588935bf) lib-master: master-auth - Add support for MAIL_AUTH_REQUEST_FLAG_IMPLICIT flag. It signals that this login is implicit; no command reply is expected. This is going to be used by the Submission service to implicitly login a user using the EXTERNAL SASL mechanism when the first MAIL command is issued. In that case sending a reply for the implicit AUTH command would break the protocol and this new flag is used to signal the post-login submission service to not send an initial reply. M src/lib-master/master-auth.h 2021-01-27 13:40:43 +0100 Stephan Bosch (a0eeeb6c76) lib-smtp: smtp-server - Add support for suppressing the inital greeting reply. M src/lib-smtp/smtp-server-connection.c M src/lib-smtp/smtp-server.c M src/lib-smtp/smtp-server.h 2021-01-27 02:22:10 +0100 Stephan Bosch (eef32e87e4) lib-smtp: smtp-server - Make default command functions public. M src/lib-smtp/smtp-server-private.h M src/lib-smtp/smtp-server.h 2021-01-27 02:21:50 +0100 Stephan Bosch (6b380d6072) lib-smtp: smtp-server-command - Allow overriding commands. M src/lib-smtp/smtp-server-command.c M src/lib-smtp/smtp-server.h 2021-10-30 00:43:55 +0200 Stephan Bosch (73b1ed4e82) submission-login: client - Explicitly set SMTP server command and auth line limits. This way, it will always use the same limits as all other login services. M src/submission-login/client.c 2021-10-29 20:41:42 +0200 Stephan Bosch (056aeb0748) lib-smtp: smtp-command-parser - Make parser suitable for input stream with small buffer. M src/lib-smtp/smtp-command-parser.c M src/lib-smtp/test-smtp-server-errors.c 2021-10-29 23:44:01 +0200 Stephan Bosch (d982aaadf1) lib-smtp: smtp-command - Use size_t for command line limits. M src/lib-smtp/smtp-command-parser.c M src/lib-smtp/smtp-command.h 2021-10-29 19:37:16 +0200 Stephan Bosch (12eb20fc0d) lib-smtp: test-smtp-server-errors - Add tests for very long AUTH response lines. M src/lib-smtp/test-smtp-server-errors.c 2021-10-29 19:36:18 +0200 Stephan Bosch (eb22a35feb) lib-smtp: test-smtp-command-parser - Add test for very long AUTH response line. M src/lib-smtp/test-smtp-command-parser.c 2021-10-29 23:52:05 +0200 Stephan Bosch (e0fa1375e2) lib-smtp: Reformat smtp-command-parser.c. M src/lib-smtp/smtp-command-parser.c 2021-10-29 23:47:57 +0200 Stephan Bosch (f47cc80a24) lib-smtp: Reformat smtp-command-parser.h. M src/lib-smtp/smtp-command-parser.h 2021-11-01 08:33:49 -0400 Timo Sirainen (6fff8d5819) master: Use MASTER_SERVICE_FLAG_DISABLE_SSL_SET This prevents startup failures if ssl_ca has a large number of certificates. Broken by 36ff43f1a9aff8594d08f791e77ea13390fd569f M src/master/main.c 2021-11-01 08:33:14 -0400 Timo Sirainen (ca2237e067) lib-master: Add MASTER_SERVICE_FLAG_DISABLE_SSL_SET M src/lib-master/master-service-settings.c M src/lib-master/master-service.h 2021-10-27 12:06:10 +0200 Timo Sirainen (7fc901f370) lib-ssl-iostream: Fix assert-crash when OpenSSL returns syscall error without errno Incomplete fix in f41874b3dec541478a85275698a91f089f537df2 Fixes: Panic: file istream-openssl.c: line 51 (i_stream_ssl_read_real): assertion failed: (errno != 0) M src/lib-ssl-iostream/iostream-openssl.c 2021-10-14 18:31:19 +0300 Timo Sirainen (84d3bc8e21) lib-storage: Improve mailbox_vfuncs.search_next_update_seq() comment M src/lib-storage/mail-storage-private.h 2019-08-08 15:35:03 -0600 Michael M Slusarz (d1e1e346a8) example-config: Remove outdated object-storage conf.d file D doc/example-config/conf.d/11-object-storage.conf 2021-10-28 17:07:39 +0200 Timo Sirainen (0407978a8f) dsync: Add back missing -T parameter Broken by 5676c510bfa9217df05e9b7cb000ae3554d66f22 M src/doveadm/doveadm-dsync.c 2021-09-16 11:24:31 +0300 sergey.kitov (9705b81fb5) fts: Keep track of every backend mailbox fts index status for virtual folders. M src/plugins/fts/fts-search.c M src/plugins/fts/fts-storage.c M src/plugins/fts/fts-storage.h 2021-10-22 12:07:17 +0300 sergey.kitov (392d79bbd2) fts: Whitespace cleanup. M src/plugins/fts/fts-storage.c 2021-10-14 17:33:30 +0300 Timo Sirainen (356b36fc52) lib-storage: Move search matching into mailbox_vfuncs.search_next_match_mail() M src/lib-storage/fail-mailbox.c M src/lib-storage/index/dbox-multi/mdbox-deleted-storage.c M src/lib-storage/index/dbox-multi/mdbox-storage.c M src/lib-storage/index/dbox-single/sdbox-storage.c M src/lib-storage/index/imapc/imapc-storage.c M src/lib-storage/index/index-search.c M src/lib-storage/index/index-storage.h M src/lib-storage/index/maildir/maildir-storage.c M src/lib-storage/index/mbox/mbox-storage.c M src/lib-storage/index/pop3c/pop3c-storage.c M src/lib-storage/index/raw/raw-storage.c M src/lib-storage/mail-storage-private.h M src/plugins/virtual/virtual-storage.c 2021-01-08 11:21:20 +0200 Timo Sirainen (547c07bdd3) lib: Use data stack frame with IO switch and destroy callbacks M src/lib/ioloop.c 2021-01-08 11:28:26 +0200 Timo Sirainen (0a9123d94c) lib: Use data stack frame with IO context activate/deactive callbacks These were running outside the regular ioloop data stack frames, so if the callback used any data stack it kept increasing memory usage. This fixes excessive memory usage with old_stats plugin when used with long-running imap sessions. The memory got filled with UPDATE-SESSION commands. M src/lib/ioloop.c 2021-09-29 00:04:29 +0300 Timo Sirainen (2cea75b7f5) lib-storage: When search parses message headers, deinitialize the parsing properly index_mail_parse_header() was being called only for the actual headers. This prevented it from being called with hdr=NULL to indicate that the parsing is finished and should be deinitialized. Move the index_mail_parse_header() to be called earlier so it's called also with hdr=NULL. Not deinitilizing the parsing could have caused assert-crashes later on in some situations. Fixes: Panic: file index-mail-headers.c: line 667 (index_mail_get_raw_headers): assertion failed: (mail->mail.mail.lookup_abort >= MAIL_LOOKUP_ABORT_NOT_IN_CACHE) Panic: file ../../../src/lib/array.h: line 244 (array_idx_i): assertion failed: (idx < array->buffer->used / array->element_size) Panic: file index-mail.c: line 1203 (index_mail_parse_body_finish): assertion failed: (!success) M src/lib-storage/index/index-search.c 2021-10-21 15:45:56 +0200 Marco Bettini (be55b9a4e0) doveadm: Route help/usage messages on stderr rather than stdout. M src/doveadm/doveadm.c 2021-09-30 16:19:58 +0100 Siavash Tavakoli (dbf7ed69c3) login-common: Add proxying events - proxy_session_started: Emitted before connecting to remote - proxy_session_established: Emitted after connection to remote is established and user is successfully logged in to the backend. - proxy_session_finished: Emitted when proxying has ended. Either successfully or with error. M src/login-common/client-common-auth.c M src/login-common/login-proxy.c 2021-09-30 12:49:31 +0100 Siavash Tavakoli (32e57666dc) login-common: Change login proxy message to include IP address Will be in format " ()". Host part is optional and not added if proxy target is an IP address. M src/login-common/client-common-auth.c 2021-10-05 11:33:06 +0100 Siavash Tavakoli (313b96cd9a) login-proxy: Add source_port to proxy event after connection is established M src/login-common/login-proxy.c 2021-10-05 15:17:50 +0100 Siavash Tavakoli (ac4089115b) login-common: Add more fields to login proxy event Adds - source_ip - dest_ip - dest_port - dest_host - master_user M src/login-common/login-proxy.c 2021-10-07 22:52:47 +0100 Siavash Tavakoli (574ad02a47) login-common: Start proxying after client fields are set Allows adding more event fields in login_proxy_new(). M src/login-common/client-common-auth.c 2021-09-30 12:48:09 +0100 Siavash Tavakoli (e202252702) login-proxy: Add login_proxy_get_ip_str() Returns proxy IP address as string. M src/login-common/login-proxy.c M src/login-common/login-proxy.h 2021-10-07 10:29:04 +0100 Siavash Tavakoli (9ed1cdecee) client-common: Add service field to client event M src/login-common/client-common.c 2021-10-13 14:49:43 +0300 Marco Bettini (351b424a37) imap: list_send_status() - Fixes LIST-EXTENDED doesn't return STATUS for all folders Sending LIST .. RETURN (SUBSCRIBED STATUS (...)) did not return STATUS for folders that are not subscribed when they have a child folder that is subscribed as mandated by IMAP RFC M src/imap/cmd-list.c 2021-10-13 11:45:05 +0300 Timo Sirainen (b3f32368aa) lib-index: Add mail_index_alloc_cache_find() M src/lib-index/mail-index-alloc-cache.c M src/lib-index/mail-index-alloc-cache.h 2021-10-07 18:11:00 +0300 Timo Sirainen (55338455ae) maildir: Fix crash when closing a mailbox that isn't open This could have happened at least with virtual plugin. M src/lib-storage/index/maildir/maildir-storage.c 2021-10-08 16:32:09 +0300 Timo Sirainen (2555d374c0) master: test-auth-client - Check that authorization ID is as expected M src/master/test-auth-client.c 2021-10-07 20:18:21 +0300 Timo Sirainen (b314a81a69) master: test-auth-client - Fix authenid check to be assert It can never be NULL at this point. M src/master/test-auth-client.c 2021-10-07 19:59:52 +0300 Timo Sirainen (859529c802) lib-dict: dict-lua - Throw Lua error if dict key is invalid or username is missing This prevents assert-crashes in the C code. M src/lib-dict/dict-iter-lua.c M src/lib-dict/dict-lua.c M src/lib-dict/dict-lua.h M src/lib-dict/dict-txn-lua.c 2021-10-07 19:54:41 +0300 Timo Sirainen (e26cebc652) lib-dict: dict_lookup_async() - Add missing assert to check for key prefix and username M src/lib-dict/dict.c 2021-10-07 19:42:41 +0300 Timo Sirainen (5ed33ba11b) lib-master: Prevent read buffer overflow with invalid haproxy header size This could have happened only for connections from haproxy_trusted_networks, so it's unlikely to cause any real security issues. M src/lib-master/master-service-haproxy.c 2021-10-07 19:36:17 +0300 Timo Sirainen (1ed470aa2d) lib-dcrypt: dcrypt_openssl_decrypt_point_password_v1() - Fix crash if pbkdf2 generation fails M src/lib-dcrypt/dcrypt-openssl.c 2021-10-06 15:38:55 +0300 Timo Sirainen (1e12cf4be0) imap: Fix handling client initialization error It should send "OK Logged in" + BYE, not PREAUTH. Broken by 714ff4342e39e309ff184905cd2f714def6177a3 M src/imap/main.c 2021-10-08 16:02:04 +0300 Timo Sirainen (5a26f6160b) imap: Move client_add_input() content to calling functions M src/imap/main.c 2021-10-08 15:57:50 +0300 Timo Sirainen (8f5d8d9e13) imap: Move IMAPLOGINTAG environment handling It can only happen with stdio clients when they don't have CLIENT_INPUT, so it makes more sense to exist in the calling function. M src/imap/main.c 2021-10-06 15:43:09 +0300 Timo Sirainen (29471bf743) imap-login: proxy: Don't forward untagged BYE responses to the client It will just cause confusion, especially when connections are retried. It could end up looking like: x login user pass * BYE Internal error occurred. Refer to server log for more information. * BYE Internal error occurred. Refer to server log for more information. * BYE Internal error occurred. Refer to server log for more information. * BYE Internal error occurred. Refer to server log for more information. x NO [UNAVAILABLE] Account is temporarily unavailable. M src/imap-login/imap-proxy.c 2021-10-08 15:53:21 +0300 Timo Sirainen (f4da884f67) lib-storage: mail_storage_service_lookup() - Fix memory leak when returning -2 This was also visible as event leaks. M src/lib-storage/mail-storage-service.c 2021-09-28 20:46:54 +0300 Timo Sirainen (f29786350e) lib-index: Fix potential crash with debug logging when looking up cache M src/lib-index/mail-cache-lookup.c 2021-09-28 20:45:47 +0300 Timo Sirainen (a016ac6a3e) lib-index: mail_cache_lookup_iter_next() - Add a warning comment about re-reading fields M src/lib-index/mail-cache-private.h 2021-10-07 15:52:28 +0200 Marco Bettini (08656f3aad) mail-crypt: mail_crypt_load_global_private_key() - Drop unnecessary NULL check M src/plugins/mail-crypt/mail-crypt-global-key.c 2021-09-28 18:13:12 +0300 Timo Sirainen (b4217b8d36) lib, global: i_stream_create_chain() - Add max_buffer_size This makes sure that the istream size can't grow too large and waste memory. Previously the istream max_buffer_size was dynamically changed to be the smallest seen max_buffer_size in chained istreams. This mostly worked, but sometimes the istream-chain's max_buffer_size was requested before even the first istream was added to it. Having an explicit max_buffer_size avoids all the problems of it being dynamic, and there's not really any need for it anyway. M src/imap/cmd-append.c M src/lib-http/test-http-client-errors.c M src/lib-smtp/smtp-server-cmd-data.c M src/lib-storage/index/pop3c/pop3c-client.c M src/lib/istream-chain.c M src/lib/istream-chain.h M src/lib/test-istream-chain.c 2021-10-07 14:52:12 +0300 Timo Sirainen (2aa531b4a4) virtual: Fix assert-crash when backend mbox mailbox is deleted while virtual mailbox is open The code wrongly thought that metadata lookup couldn't fail because it was already successfully looked up. But the backend storage could still try to refresh the mailbox to verify whether it still exists or not, and fail if it was deleted. This seems to have affected only the mbox mailbox format. Broken by 710346bcb884b464c8ed128870fdc1999c13dfd3 M src/plugins/virtual/virtual-sync.c 2021-10-05 02:03:00 +0300 Timo Sirainen (5050000f5d) lib: istream-concat - Add a comment about explicit snapshot function M src/lib/istream-concat.c 2021-10-05 01:39:50 +0300 Timo Sirainen (e830aca4ef) lib: test-istream-concat - Unref child istreams immediately This doesn't currently make a difference, since istream-concat keeps them internally referenced. In case this changes and snapshot handling isn't fixed similarly to istream-chain, the unit test should now fail. M src/lib/test-istream-concat.c 2021-10-04 18:25:40 +0300 Timo Sirainen (9507dcba9f) lib: istream-concat - Fix snapshot handling when combining two istreams Snapshotting wasn't handled correctly when two (or more) istreams' contents were combined into the same buffer. M src/lib/istream-concat.c M src/lib/test-istream-concat.c 2021-10-05 00:55:57 +0300 Timo Sirainen (4614c27f68) lib: istream-chain - Optimize snapshot handling M src/lib/istream-chain.c 2021-10-05 01:32:22 +0300 Timo Sirainen (539a052672) lib: istream-chain - Fix snapshot handling when link istream is destroyed M src/lib/istream-chain.c M src/lib/istream-private.h M src/lib/istream.c M src/lib/test-istream-chain.c 2021-10-04 18:17:49 +0300 Timo Sirainen (504c0e6424) lib: istream-chain - Fix snapshot handling when combining two istreams Snapshotting wasn't handled correctly when two (or more) istreams' contents were combined into the same buffer. M src/lib/istream-chain.c M src/lib/test-istream-chain.c 2021-10-05 01:00:38 +0300 Timo Sirainen (39642d6b49) lib: Add i_stream_memarea_detach() M src/lib/istream-private.h M src/lib/istream.c 2021-10-04 17:41:27 +0300 Timo Sirainen (67324622b6) lib: test-istream-chain - Use more unique strings for testing DEBUG checks don't work well if the input repeats the same character. M src/lib/test-istream-chain.c 2019-09-15 00:08:57 +0300 Timo Sirainen (43d7f354c4) lib: istream-seekable - Fix crash after write to temp file failed Fixes: Panic: file istream-seekable.c: line 230 (read_from_buffer): assertion failed: (*ret_r > 0) M src/lib/istream-seekable.c 2019-09-15 00:06:58 +0300 Timo Sirainen (66fc9ffd4c) lib: istream-seekable - Don't double-close temp file fd on errors Closing the fd_input stream already auto-closes the fd. M src/lib/istream-seekable.c 2019-09-14 23:53:35 +0300 Timo Sirainen (eb15b02121) lib: istream-seekable - Fix crash if writing to temp file fails M src/lib/istream-seekable.c M src/lib/test-istream-seekable.c 2021-09-29 13:13:53 +0300 Timo Sirainen (7f752d77be) lib: i_stream_try_alloc() - Add sanity check asserts M src/lib/istream.c 2021-10-06 17:37:40 +0300 Timo Sirainen (baf3e985c0) lib-imap-client: test-imapc-client - Increase connect timeout for most tests The 500ms timeout could have been too short when running with valgrind on an overloaded system. Increase it to 5 seconds, but keep 500ms for the tests that expect a timeout. M src/lib-imap-client/test-imapc-client.c 2021-10-06 05:03:08 -0400 Marco Bettini (313ce3e709) lib-master: master_login_auth_callback() - Add assert to guard for both errormsg and auth_args being NULL M src/lib-master/master-login.c 2021-10-07 03:55:59 +0300 Timo Sirainen (e7754572e6) auth: db-passwd-file - Fix using paths with %% escaped characters but no %variables full_key might not have been NULL, causing var_expand() to read past the array and possibly crash. M src/auth/db-passwd-file.c 2021-10-07 03:46:29 +0300 Timo Sirainen (687bc05ad0) lib: t_get_bytes_available() - Move code inside DEBUG to avoid dead code warning M src/lib/data-stack.c 2021-10-07 03:44:46 +0300 Timo Sirainen (6e02a7ba64) lib-index: mail_index_sync_init_expunge_handlers() - Simplify and remove dead code M src/lib-index/mail-index-sync-ext.c 2021-10-07 03:37:29 +0300 Timo Sirainen (1bf116c7a6) lib-index: test-mail-index-write - Fix initializing map.hdr_copy_buf M src/lib-index/test-mail-index-write.c 2021-10-07 03:29:09 +0300 Timo Sirainen (a08c2213af) lib-settings: test-settings-parser - Check settings_parser_check() return value M src/lib-settings/test-settings-parser.c 2021-10-07 03:28:56 +0300 Timo Sirainen (a3b12700a6) auth: Make sure auth_request_import() doesn't unexpectedly fail M src/auth/auth-master-connection.c 2021-10-07 03:10:28 +0300 Timo Sirainen (4327b55f45) lib: Change i_unreached() to be a function This allows overriding the function in a Coverity model, so it can understand that i_unreached() is intended to be unreachable code. M src/lib/failures.c M src/lib/failures.h M src/lib/macros.h 2021-10-07 02:32:26 +0300 Timo Sirainen (44bd159679) lib: base64 - Add asserts to check max_line_len is in valid range M src/lib/base64.c 2021-10-04 13:32:51 +0200 Timo Sirainen (1f0fad9044) ipc: Disable connecting to stats This avoids reconnect errors if stats process crashes. M src/ipc/main.c 2021-10-01 01:44:35 +0300 Timo Sirainen (dec257fb78) master: Use relative path for stats_writer_socket_path for chrooted services This allows login process to reconnect to stats-writer if it gets disconnected. M src/master/service-process.c 2021-10-01 01:42:43 +0300 Timo Sirainen (f08703dae8) stats: Add login/stats-writer socket M src/stats/stats-settings.c 2021-10-04 02:58:15 +0200 Stephan Bosch (53b018722b) lmtp: lmtp-proxy - Use the per-recipient session ID for the "Saved" message. M src/lmtp/lmtp-proxy.c 2021-10-04 02:57:25 +0200 Stephan Bosch (0daefe8937) lmtp: Move session_id field to generic recipient struct. M src/lmtp/lmtp-commands.c M src/lmtp/lmtp-local.c M src/lmtp/lmtp-recipient.c M src/lmtp/lmtp-recipient.h 2021-10-02 00:21:40 +0200 Stephan Bosch (47c7166b91) lmtp: lmtp-proxy - Forward session ID towards backend. M src/lmtp/lmtp-proxy.c 2021-10-02 00:21:06 +0200 Stephan Bosch (e67d8cdb88) lmtp: lmtp-local - Always add RCPT index to session ID for delivery. Even when it is 1. M src/lmtp/lmtp-local.c 2021-10-02 00:36:09 +0200 Stephan Bosch (c8423c354b) lib-smtp: smtp-server-transaction - Base transaction ID on connection session ID. Composed as ":". M src/lib-smtp/smtp-server-private.h M src/lib-smtp/smtp-server-transaction.c 2021-10-02 00:32:05 +0200 Stephan Bosch (e6451151f5) lib-smtp: smtp-server-connection - Manage session ID for the connection. M src/lib-smtp/smtp-server-connection.c M src/lib-smtp/smtp-server-private.h 2021-10-02 00:29:29 +0200 Stephan Bosch (8fb86c24be) lib-smtp: smtp-server-cmd-xclient - Parse XCLIENT SESSION field. M src/lib-smtp/smtp-server-cmd-xclient.c M src/lib-smtp/smtp-server-reply.c M src/submission-login/client.c 2021-10-02 00:16:22 +0200 Stephan Bosch (8c6d07276b) lib-smtp: smtp-client-connection - Send new SESSION field with XCLIENT command. M src/lib-smtp/smtp-client-connection.c 2021-10-04 02:02:21 +0200 Stephan Bosch (2d4587d13a) lib-smtp: smtp-client - Use smtp_proxy_data_merge() to copy proxy data in smtp_client_init(). M src/lib-smtp/smtp-client.c 2021-10-02 00:15:07 +0200 Stephan Bosch (b1497466f2) lib-smtp: smtp-common - Add SESSION field to proxy data. M src/lib-smtp/smtp-common.c M src/lib-smtp/smtp-common.h 2021-10-02 00:25:50 +0200 Stephan Bosch (66d9b71ad4) lib: connection - Add debug message for when property label (peer address) changes. M src/lib/connection.c 2021-10-02 00:26:28 +0200 Stephan Bosch (4a84440f53) lib: connection - Make connection_update_properties() public. M src/lib/connection.c M src/lib/connection.h 2021-10-02 00:24:35 +0200 Stephan Bosch (44819f897c) lib: connection - Drop useless newlines. M src/lib/connection.c 2019-02-21 18:50:10 +0200 Aki Tuomi (1b13ee113b) lib-program-client: test-program-client-local - Use dd instead of head `head -c n` is only guaranteed to print n bytes, but it may consume more. FreeBSD's implementation of head(1) uses buffered stdio, which did just that. `dd` consumes exactly the specified number of bytes. M src/lib-program-client/test-program-client-local.c 2021-08-10 13:38:39 +0200 Timo Sirainen (1489e6378c) login-proxy: Fix potential memory leak if backend login fails It also needs an abnormal way of destroying the client for the leak to happen. For example if the login process is being killed. M src/login-common/client-common.c 2021-04-19 17:36:02 +0200 Stephan Bosch (350600f984) lib-test: fuzzer - Disable error handling for output stream towards program. Fixes: Panic: output stream is missing error handling M src/lib-test/fuzzer.c 2021-04-19 17:34:58 +0200 Stephan Bosch (b41e7198ad) lib-test: fuzzer - Provide names for fuzzer streams. M src/lib-test/fuzzer.c 2021-04-18 12:33:01 +0200 Stephan Bosch (860e5e3a83) lib-smtp: smtp-server-cmd-helo - Fix crash occurring upon pipelined EHLO with invalid domain. Failed to check for NULL in domain value for a pipelined EHLO/HELO command. M src/lib-smtp/smtp-server-cmd-helo.c 2021-10-06 13:20:12 +0300 Timo Sirainen (2e06ce6c98) lib: Fix data_stack_get_alloc_size() and data_stack_get_used_size() It only worked correctly if data stack hadn't been grown. This resulted in wrong numbers in the data_stack_grow event. M src/lib/data-stack.c 2021-10-01 15:08:45 +0300 Timo Sirainen (bdf4474ed8) virtual: Fix leaking mailboxes if virtual mailbox can't be opened Fixes also a crash at deinit: Panic: file mail-user.c: line 232 (mail_user_deinit): assertion failed: ((*user)->refcount == 1) M src/plugins/virtual/virtual-storage.c 2021-10-04 17:25:05 +0300 Timo Sirainen (79ebaf7b14) mdbox: Avoid calling container_of() with a NULL pointer M src/lib-storage/index/dbox-multi/mdbox-save.c 2021-10-04 15:20:17 +0300 Timo Sirainen (6275be1981) sdbox: Avoid calling container_of() with a NULL pointer M src/lib-storage/index/dbox-single/sdbox-save.c 2021-10-04 14:42:54 +0300 Timo Sirainen (a037ede37f) lib: buffer_free() - Check for buf==NULL before using container_of() Helps with static analyzer complaints. M src/lib/buffer.c 2021-10-04 14:42:14 +0300 Timo Sirainen (ecaaa728c7) lib: lib-event - Assert-crash if attempting to use NULL passthrough event Fixes also complaints from static analyzer. M src/lib/lib-event.c 2021-10-04 14:22:22 +0300 Timo Sirainen (bb5048cda0) lib: container_of() - Don't check for NULL after all Adding the explicit NULL checks for container_of() caused caused static analyzers to think that NULL could be returned at any time. This caused unnecessary warnings in various places. Reverts b178d0792b6335277f7fa831fd7e5403105abd04 M src/lib/macros.h 2021-10-04 14:35:03 +0300 Timo Sirainen (5de8349891) lib: macros.h - Fix #endif position M src/lib/macros.h 2021-09-24 16:36:41 +0300 Timo Sirainen (6baff5b2d4) lib-index: Add more mail_index_ext_name_is_valid() asserts M src/lib-index/mail-index-map.c M src/lib-index/mail-index-sync-ext.c 2021-09-24 16:35:39 +0300 Timo Sirainen (f81779845a) lib-index: Handle invalid extension header names without assert-crashing Fixes: Panic: mail_index_ext_register(...): Invalid name M src/lib-index/mail-index-map.c 2021-09-24 16:27:40 +0300 Timo Sirainen (05e570be12) lib-index: Add and use mail_index_ext_name_is_valid() Use it in mail_index_ext_register() instead of the more relaxed str_sanitize() check. M src/lib-index/mail-index-private.h M src/lib-index/mail-index.c 2021-09-24 16:32:26 +0300 Timo Sirainen (4896364107) lib-index: Remove unused mail_index_sync_ext_init() It doesn't look like this was ever used for anything. The initial commit used only mail_index_sync_ext_init_new(). M src/lib-index/mail-index-sync-ext.c M src/lib-index/mail-index-sync-private.h 2021-07-29 11:37:23 +0300 Timo Sirainen (d7dc02bbb0) zlib: Handle empty zlib_save_level the same as if it doesn't exist M src/plugins/zlib/zlib-plugin.c 2021-07-29 11:29:37 +0300 Timo Sirainen (42457ff2eb) zlib: Fix crash when zlib_save_level is set, but zlib_save is unset M src/plugins/zlib/zlib-plugin.c 2021-10-04 11:14:04 +0100 Siavash Tavakoli (4cd6999dd5) driver-pgsql: Fix error leak M src/lib-sql/driver-pgsql.c 2021-10-04 12:37:11 +0200 Timo Sirainen (1e56bbb41b) lib-compression: ostream-zlib - Fix non-blocking gz header write Broken by 373dc6a93da1f6a0ad0c80dbb72566c2b3a295f2 M src/lib-compression/ostream-zlib.c 2021-08-03 20:38:13 +0300 Timo Sirainen (1efd4a1765) lib-storage: mailbox_get_expunge*() - Fix assert-crash on index corruption This happened in the very unlikely situation that indexes became corrupted between two mail_transaction_log_view_set() calls. Fixes: Panic: file mailbox-get.c: line 112 (mailbox_get_expunges_init): assertion failed: (ret != 0) M src/lib-storage/mailbox-get.c 2021-10-01 15:21:38 +0300 Timo Sirainen (088783cdaa) lib: str_hash() - Ignore integer wrapping with ubsan ATTR_NO_SANITIZE_INTEGER was already set for other hash functions, but forgotten for this one. Fixes e.g.: Error: hash.c:529:16: runtime error: unsigned integer overflow: 4294967200 + 115 cannot be represented in type ‘unsigned int’ M src/lib/hash.c 2021-09-28 00:51:03 +0200 Stephan Bosch (3c05dcfa58) lib: ostream-wrapper - Make sure o_stream_finish() has stream_errno != 0 when -1 is to be returned. Fixes: Panic: file ostream.c: line 209 (o_stream_flush): assertion failed: (stream->stream_errno != 0) M src/lib/ostream-wrapper.c 2021-10-01 10:42:16 +0100 Siavash Tavakoli (a1729a72e8) driver-cassandra: Fix prepared statement pool leak M src/lib-sql/driver-cassandra.c 2021-09-30 18:42:08 +0300 sergey.kitov (ebd5223c8d) stats: Remove metric from stats dump, when removing dynamically. M src/stats/stats-metrics.c 2020-09-23 23:35:53 +0200 Stephan Bosch (d16a69f7e2) lib-ssl-iostream: istream-openssl - Remove assert() in i_stream_ssl_read(). M src/lib-ssl-iostream/istream-openssl.c 2020-09-23 23:35:30 +0200 Stephan Bosch (50b7231aab) lib-ssl-iostream: iostream-openssl - Allow plain_input buffer to remain filled in openssl_iostream_bio_input(). M src/lib-ssl-iostream/iostream-openssl.c 2020-09-23 22:02:41 +0200 Stephan Bosch (b4d477a50b) lib-ssl-iostream: iostream-openssl - Use o_stream_uncork_flush() to uncork the plain output. This flushes the stream after uncorking it, fixing I/O hang with nested SSL layers. M src/lib-ssl-iostream/iostream-openssl.c 2021-09-30 00:17:47 +0200 Stephan Bosch (f42c0637ac) lib-ssl-iostream: iostream-openssl - Return immediately from openssl_iostream_bio_output() upon error. M src/lib-ssl-iostream/iostream-openssl.c 2020-09-23 23:58:12 +0200 Stephan Bosch (3200480ecf) lib-ssl-iostream: iostream-openssl - Move error handling out of openssl_iostream_bio_output(). Makes the next commit clearer. M src/lib-ssl-iostream/iostream-openssl.c 2021-04-16 13:55:06 +0200 Stephan Bosch (aa8a39557b) lib-ssl-iostream: test-iostream-ssl - Make finishing the ssl streams more robust. Fixes: Panic: file ostream.c: line 59 (o_stream_close_full): assertion failed: (stream->real_stream->error_handling_disabled) M src/lib-ssl-iostream/test-iostream-ssl.c 2021-04-16 18:18:07 +0200 Stephan Bosch (2816a2525b) lib-ssl-iostream: test-iostream-ssl - Properly mark client endpoints. M src/lib-ssl-iostream/test-iostream-ssl.c 2021-04-16 18:21:01 +0200 Stephan Bosch (7738cb723b) lib-ssl-iostream: test-iostream-ssl - Move small_packets_flush_callback(). M src/lib-ssl-iostream/test-iostream-ssl.c 2021-04-16 18:19:55 +0200 Stephan Bosch (3e53f67a65) lib-ssl-iostream: test-iostream-ssl - Move bufsize_flush_callback(). M src/lib-ssl-iostream/test-iostream-ssl.c 2021-04-16 14:52:34 +0200 Stephan Bosch (0f4a532bd1) lib-ssl-iostream: ostream-openssl - Call SSL_shutdown() once stream is finished and buffer is empty. M src/lib-ssl-iostream/ostream-openssl.c 2021-04-16 12:31:13 +0200 Stephan Bosch (46970690e9) lib: istream - Remove try_alloc_limit. M src/lib/istream-private.h M src/lib/istream.c 2021-04-16 12:27:48 +0200 Stephan Bosch (b44c5504ff) lib-ssl-iostream - iostream-openssl - Use i_stream_read_limited(). M src/lib-ssl-iostream/iostream-openssl.c 2021-04-16 12:25:43 +0200 Stephan Bosch (377f1cbe88) lib: istream - Add i_stream_read_limited(). M src/lib/istream-private.h M src/lib/istream.c M src/lib/istream.h 2020-09-27 15:19:05 +0200 Stephan Bosch (00df102e56) lib-ssl-iostream: istream-openssl - Simplify i_stream_ssl_read(). Avoid using a stack buffer. Just fill the stream to the maximum buffer size. M src/lib-ssl-iostream/istream-openssl.c 2021-04-16 18:08:50 +0200 Stephan Bosch (b4a2da442d) lib-ssl-iostream: iostream-openssl - Add OPENSSL_IOSTREAM_SYNC_TYPE_NONE. This is useful for calling openssl_iostream_handle_error() while avoiding processing more I/O. M src/lib-ssl-iostream/iostream-openssl.c M src/lib-ssl-iostream/iostream-openssl.h 2021-09-24 19:16:43 +0300 Timo Sirainen (8a9d1aa7b6) lib-ssl-iostream: Fix error handling if parent iostream fails Expand out and remove openssl_iostream_more(). It could have returned errors to two different locations depending on whether the failure came from SSL handshake or parent iostream. M src/lib-ssl-iostream/iostream-openssl.c M src/lib-ssl-iostream/iostream-openssl.h M src/lib-ssl-iostream/istream-openssl.c M src/lib-ssl-iostream/ostream-openssl.c 2021-09-24 19:15:22 +0300 Timo Sirainen (75a6da0a1e) lib-ssl-iostream: ostream-ssl - Add ssl_io helper variable M src/lib-ssl-iostream/ostream-openssl.c 2021-09-24 18:59:29 +0300 Timo Sirainen (6289334552) lib: o_stream_copy_error_from_parent() - Assert-crash if source stream_errno is 0 This can help debug situations where error is missing. M src/lib/ostream.c 2021-09-24 18:59:21 +0300 Timo Sirainen (8f22f0ab6e) global: Call o_stream_copy_error_from_parent() only on errors M src/lib-http/http-transfer-chunked.c M src/lib-mail/ostream-dot.c 2021-09-24 18:58:02 +0300 Timo Sirainen (373dc6a93d) lib-compression: ostream-zlib - Fix sending partial gz header to parent ostream This practically wouldn't happen. M src/lib-compression/ostream-zlib.c 2021-09-30 15:38:23 +0200 Timo Sirainen (1545fadb3d) lib-http: test-http-client-errors - Revert previous retry changes The real bug is found now, so the previous fix attempt isn't useful. Reverts ed1264368a5435c3080871380156978a8951fe26 M src/lib-http/test-http-client-errors.c 2021-09-30 15:32:24 +0200 Timo Sirainen (37f4f27114) lib-http: test-http-client-errors - Reset USR1 notification signal between tests The "connection refused" test already set the signal as being received, which caused the "connection refused backoff" test to randomly fail since it thought the signal was immediately received. M src/lib-http/test-http-client-errors.c 2021-09-25 00:48:12 +0200 Stephan Bosch (ddb173aa3d) lib: istream-concat - Prevent inheriting SIZE_MAX max buffer size from parent streams. Only when all parent streams have SIZE_MAX for max buffer size, the concat stream will follow suit. M src/lib/istream-concat.c 2021-09-27 20:35:19 +0300 Timo Sirainen (f5c1baf2cd) lib-storage: Add mailbox_list.disable_rebuild_on_corruption If set, don't try to rebuild the mailbox list index even if corruption is detected. M src/lib-storage/list/mailbox-list-index.c M src/lib-storage/mailbox-list-private.h 2021-09-24 17:59:06 +0300 Timo Sirainen (462d9b6ea6) lib-dcrypt: Fix istream-decrypt snapshotting This is mostly copy&pasted from istream-header-filter. M src/lib-dcrypt/istream-decrypt.c M src/lib-dcrypt/test-stream.c 2021-09-23 18:02:17 -0600 Michael M Slusarz (9bf48f34bf) lib-storage: hide mail_cache_min_mail_count setting M src/lib-storage/mail-storage-settings.c 2021-09-26 01:16:53 +0300 Timo Sirainen (ccb0579b3b) master: Avoid leaking master client fds to forked processes M src/master/master-client.c 2021-09-29 14:58:22 +0300 sergey.kitov (231105a825) stats: Improve error message for doveadm stats add. M src/stats/client-reader.c 2021-09-29 14:57:34 +0300 sergey.kitov (22bc379024) stats: Check if metric already exists when adding dynamically. M src/stats/stats-metrics.c 2021-09-28 15:35:05 +0300 Timo Sirainen (1ad80be9a6) driver-pglsqlpool: Implement sql_get_flags() reliably Try to use one of the already connected databases. If none were found, create a new database. M src/lib-sql/driver-sqlpool.c 2021-09-28 15:32:56 +0300 Timo Sirainen (a55f18c67f) driver-pgsql: Implement sql_get_flags() reliably Some of the flags aren't known until server is connected to, so wait for the connect to finish if necessary before returning the flags. M src/lib-sql/driver-pgsql.c 2021-09-28 15:33:47 +0300 Timo Sirainen (a90663e588) driver-sqlpool: Implement sql_wait() M src/lib-sql/driver-sqlpool.c 2021-09-27 11:59:09 +0100 Siavash Tavakoli (8146312f9c) driver-cassandra: Add wait() implementation M src/lib-sql/driver-cassandra.c 2021-09-27 11:58:21 +0100 Siavash Tavakoli (8981a97398) driver-pgsql: Add wait() implementation M src/lib-sql/driver-pgsql.c 2021-09-27 11:48:34 +0100 Siavash Tavakoli (beca893733) dict-sql: Add "sql_dict_wait()" implementation lib-sql now has sql_wait(). M src/lib-dict-backend/dict-sql.c 2021-09-27 11:46:07 +0100 Siavash Tavakoli (3e717dd730) lib-sql: Add "wait" vfunc To be used in backends that support async operations. On deinit dicts should wait for results and then exit. M src/lib-sql/sql-api-private.h M src/lib-sql/sql-api.c M src/lib-sql/sql-api.h 2021-09-27 19:43:54 +0100 Siavash Tavakoli (d5bf78e2da) driver-pgsql: Keep a list of pending query results To be used in wait() to determine if there are pending operations. M src/lib-sql/driver-pgsql.c 2021-09-22 20:57:06 +0300 Timo Sirainen (a660f544ea) dict: Wait for all dicts to finish pending operations at shutdown This also changes the dict process to exit cleanly instead of early via lib_exit(). M src/dict/dict-init-cache.c M src/dict/dict-init-cache.h M src/dict/main.c 2019-07-11 12:05:37 +0300 Timo Sirainen (d571a13586) dict: Unref dict connection immediately when connection is destroyed The delayed unrefing is needed when calling from dict command callbacks to avoid calling dict_deinit() too early. But the connection's destroy() vfunc can't be called directly from dict command callbacks, so there's no need to add further delays. Especially when this happens at deinit where there is no possibility of calling the delayed callback anymore. M src/dict/dict-connection.c 2021-09-27 11:42:07 +0100 Siavash Tavakoli (60f20b00b9) driver-pgsql: Fix escaped blob prefix Escaped strings must be prefixed with double backslash. M src/lib-sql/driver-pgsql.c 2021-09-27 11:35:38 +0100 Siavash Tavakoli (103a99d531) driver-pgsql: Fix assert-crash when using binary fields array_idx_modifiable() changed behavior in 1d4e5de8414ed93d1c810b30a91ad83d6d954861 and doesn't allocate space anymore. Fixes: Panic: file array.c: line 10 (array_idx_modifiable_i): assertion failed: (idx < array->buffer->used / array->element_size) M src/lib-sql/driver-pgsql.c 2021-09-29 18:04:37 +0200 Timo Sirainen (f318731eac) doveadm mail batch: Fix run() return value on errors The function always returned 0, even when there was an error. This practically doesn't fix anything, but makes it work the way it was intended. It also makes scan-build happier. Broken by fd4360e30b695e596a5081a6080152188a12852a M src/doveadm/doveadm-mail-batch.c 2021-09-22 19:34:32 +0300 Timo Sirainen (d10bc56592) mdbox: Add assert to help static analyzers mdbox_sync_begin() can return 0 with sync_ctx=NULL, but not with the parameters given here. M src/lib-storage/index/dbox-multi/mdbox-save.c 2021-09-22 19:02:24 +0300 Timo Sirainen (67c96d89f3) lib-smtp: smtp_client_transaction_get_state_name() - Fix return value Only the "new" state was returned correctly, while everything else was wrong. This didn't really cause problems, because it was used only by imaptest. M src/lib-smtp/smtp-client-transaction.c M src/lib-smtp/smtp-client-transaction.h 2021-09-22 18:46:39 +0300 Timo Sirainen (37ab021b41) lib: Ignore COMPILE_ERROR_IF_TRUE() with --enable-static-checker M src/lib/macros.h 2021-09-28 01:24:24 +0300 Timo Sirainen (b178d0792b) lib: container_of() - Always return NULL if input pointer is NULL M src/lib/macros.h 2021-09-22 18:40:11 +0300 Timo Sirainen (71d3f9a4c0) lib: container_of() - Avoid uintptr_t Using uintptr_t confused Coverity, but char* works fine. M src/lib/macros.h 2021-09-29 00:21:17 +0300 Timo Sirainen (e47c4a3ff7) indexer: Abort requests if indexer-worker disconnects unexpectedly M src/indexer/worker-connection.c 2021-04-19 21:43:17 +0300 Timo Sirainen (1e14dd0f49) lib-storage: Add reason_code=mail:header_fields M src/lib-storage/index/index-mail-headers.c 2021-04-19 21:38:35 +0300 Timo Sirainen (034597d2fe) lib-storage: Add more specific mail:* reason_codes in when prefetching Added: * mail:attachment_keywords * mail:date * mail:snippet * mail:mime_parts * mail:imap_envelope * mail:imap_bodystructure M src/lib-storage/index/index-mail.c M src/lib-storage/index/index-mail.h 2021-03-11 23:38:01 +0200 Timo Sirainen (88c2ee58f1) fts: Add reason_code=fts:index and fts:lookup Note that fts:index won't be used for email opening events, because the emails are already opened by the indexer precache searching code due to wanted_fields. M src/plugins/fts/fts-search.c M src/plugins/fts/fts-storage.c 2021-09-09 16:45:23 +0300 Timo Sirainen (1279e1bd00) lib-storage: Add reason_code=mailbox:* Added: * mailbox:create * mailbox:update * mailbox:delete * mailbox:rename * mailbox:subscribe * mailbox:unsubscribe * mailbox:attributes_changed M src/lib-storage/mail-storage.c 2021-03-17 15:15:00 +0200 Timo Sirainen (87cd6570a1) lib-storage: Add reason_code=mailbox:search M src/lib-storage/index/index-search.c 2021-03-17 14:49:24 +0200 Timo Sirainen (858da66efb) lib-storage: Add reason_code=mailbox:thread This is split into a few different locations in the code. M src/lib-storage/index/index-thread-finish.c M src/lib-storage/index/index-thread.c 2021-03-17 17:48:57 +0200 Timo Sirainen (eedf4a3f22) lib-storage: Add reason_code=mailbox:vsize* * mailbox:vsize - mailbox vsize is asked * mailbox:vsize_update - mailbox vsize is updated (append/expunge) M src/lib-storage/index/index-mailbox-size.c 2021-03-17 17:48:33 +0200 Timo Sirainen (d4b3fcee59) lib-storage: Add reason_code=mailbox:sort M src/lib-storage/index/index-sort.c 2021-03-11 19:43:22 +0200 Timo Sirainen (ce517f8323) lib-storage: Add reason_code=mail:* * mail:virtual_size * mail:physical_size * mail:snippet * mail:prefetch * mail:mime_parts * mail:date * mail:received_date * mail:save_date * mail:storage_id * mail:pop3_uidl * mail:pop3_order * mail:guid * mail:refcount * mail:refcount_id M src/lib-storage/index/index-mail.c M src/lib-storage/mail.c 2021-03-11 19:07:10 +0200 Timo Sirainen (962efef5f7) lib-storage: Remove mailbox_set_reason() Event reason_codes should be used instead. Keep the "Mailbox opened" debug message mainly because it's often used in CI tests. M src/lib-storage/mail-storage-private.h M src/lib-storage/mail-storage.c M src/lib-storage/mail-storage.h 2021-03-11 19:06:00 +0200 Timo Sirainen (f1db5fbfb3) global: Remove mailbox_set_reason() calls These ones that are left are all rather unnecessary. M src/lib-imap-storage/imap-metadata.c M src/lib-imap-storage/imap-msgpart-url.c M src/lib-imap-urlauth/imap-urlauth-backend.c M src/lib-lda/mail-deliver.c M src/lib-storage/mail-storage.c M src/lmtp/lmtp-local.c M src/plugins/quota/quota-status.c M src/plugins/virtual/virtual-storage.c 2021-03-17 17:40:46 +0200 Timo Sirainen (d2ab26be60) pop3: Add reason_code=pop3:cmd_ to events M src/pop3/pop3-client.c 2021-03-11 19:04:36 +0200 Timo Sirainen (641d0bd3bd) pop3: Replace mailbox_set_reason() with reason_code=pop3:initialize M src/pop3/main.c M src/pop3/pop3-client.c 2021-03-11 17:29:59 +0200 Timo Sirainen (bf1b124e0d) virtual: Replace mailbox_set_reason() with reason_code=virtual:config_read M src/plugins/virtual/virtual-config.c 2021-03-11 17:27:54 +0200 Timo Sirainen (d31e44e66c) trash: Replace mailbox_set_reason() with reason_code=trash:clean M src/plugins/trash/trash-plugin.c 2021-03-09 16:49:12 +0200 Timo Sirainen (459f9eeeac) quota: Replace mailbox_set_reason() with reason_code=quota:recalculate and quota:count M src/plugins/quota/quota-count.c M src/plugins/quota/quota-dict.c M src/plugins/quota/quota-maildir.c 2021-03-11 17:22:31 +0200 Timo Sirainen (b0d8db1bb3) pop3-migration: Replace mailbox_set_reason() with reason_code=pop3_migration:uidl_sync M src/plugins/pop3-migration/pop3-migration-plugin.c 2021-03-11 17:03:49 +0200 Timo Sirainen (d2af1066c4) lazy_expunge: Replace mailbox_set_reason() with reason_code=lazy_expunge:expunge M src/plugins/lazy-expunge/lazy-expunge-plugin.c 2021-03-17 18:23:11 +0200 Timo Sirainen (bc85909b45) lazy-expunge: Split off lazy_expunge_mail_expunge_move() M src/plugins/lazy-expunge/lazy-expunge-plugin.c 2021-03-11 16:56:32 +0200 Timo Sirainen (2ec30d083b) lib-storage: Replace mailbox_set_reason() with reason_code=storage:autoexpunge and storage:mailbox_list_rebuild M src/lib-storage/list/mail-storage-list-index-rebuild.c M src/lib-storage/mail-autoexpunge.c 2021-03-11 16:53:35 +0200 Timo Sirainen (a20d06d4b3) mdbox: Replace mailbox_set_reason() with reason_code=mdbox:rebuild M src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c 2021-03-16 19:02:06 +0200 Timo Sirainen (1a30dc1b43) mdbox: Split off mdbox_storage_rebuild_scan_prepare() M src/lib-storage/index/dbox-multi/mdbox-storage-rebuild.c 2021-03-11 15:46:11 +0200 Timo Sirainen (e3dc046996) indexer: Replace mailbox_set_reason() with reason_code=indexer:index_mailbox M src/indexer/master-connection.c 2021-03-17 17:28:03 +0200 Timo Sirainen (bb1df67719) imap: Add reason_code=imap:fetch_* The main reason for these is to allow understanding why mails are being opened. The possibilities: * imap:fetch_body * imap:fetch_header * imap:fetch_header_fields * imap:fetch_bodystructure * imap:fetch_size M src/imap/cmd-fetch.c M src/imap/imap-fetch-body.c M src/imap/imap-fetch.h 2021-03-11 15:44:47 +0200 Timo Sirainen (b41063291e) imap: Remove mailbox_set_reason() calls They are now unnecessary because of the new reason_code field. M src/imap/cmd-create.c M src/imap/cmd-delete.c M src/imap/cmd-getmetadata.c M src/imap/cmd-notify.c M src/imap/cmd-rename.c M src/imap/cmd-resetkey.c M src/imap/cmd-select.c M src/imap/cmd-setmetadata.c M src/imap/cmd-subscribe.c M src/imap/imap-commands-util.c M src/imap/imap-notify.c M src/imap/imap-state.c M src/imap/imap-status.c 2021-03-11 15:44:10 +0200 Timo Sirainen (61685f7b7a) imap: Add reason_code=imap:unhibernate for events during unhibernation. M src/imap/imap-master-client.c 2021-03-11 15:39:09 +0200 Timo Sirainen (4eb305cccc) imap: Add reason_code=imap:notify_update for events during NOTIFY updates M src/imap/imap-notify.c 2021-03-09 16:37:18 +0200 Timo Sirainen (ad5ef653eb) imap: Add and use client_command_context.global_event This way all the (potentially large) IMAP command parameters won't be included in all the events. This change might be reverted in the future if the performance worries go away. The global event also contains reason_code=imap:cmd_ field. M src/imap/cmd-append.c M src/imap/cmd-create.c M src/imap/cmd-delete.c M src/imap/cmd-getmetadata.c M src/imap/cmd-rename.c M src/imap/cmd-resetkey.c M src/imap/cmd-select.c M src/imap/cmd-setmetadata.c M src/imap/cmd-status.c M src/imap/cmd-subscribe.c M src/imap/imap-client.c M src/imap/imap-client.h M src/imap/imap-commands-util.c M src/imap/imap-commands.c 2021-03-11 15:26:56 +0200 Timo Sirainen (cfc7b74425) doveadm: Remove mailbox_set_reason() calls They are now unnecessary because of the new reason_code field. M src/doveadm/doveadm-mail-copymove.c M src/doveadm/doveadm-mail-import.c M src/doveadm/doveadm-mail-index.c M src/doveadm/doveadm-mail-iter.c M src/doveadm/doveadm-mail-mailbox-metadata.c M src/doveadm/doveadm-mail-mailbox-status.c M src/doveadm/doveadm-mail-mailbox.c M src/doveadm/doveadm-mail-save.c M src/doveadm/doveadm-mail.c 2021-03-11 15:26:09 +0200 Timo Sirainen (fd4360e30b) doveadm: Add reason_code=doveadm:cmd_ to events M src/doveadm/doveadm-mail-batch.c M src/doveadm/doveadm-mail.c 2021-04-20 00:05:23 +0300 Timo Sirainen (82f0d7bf81) dsync: ioloop context shouldn't deactivate after ioloop has run Normally that is wanted, but dsync reuses the same ioloop as the parent doveadm connection, so after the inner io_loop_run() it's still running in the doveadm connection's io callback. Without this all the global events will be popped out, and the following global event change commit will cause crashes. M src/doveadm/doveadm-dsync.c 2021-04-20 00:28:02 +0300 Timo Sirainen (a9ffa98ac7) doveadm copy: Don't permanently activate source user's ioloop M src/doveadm/doveadm-mail-copymove.c 2021-04-20 00:24:39 +0300 Timo Sirainen (23c1983be1) doveadm import: Don't permanently activate source user's ioloop After the source user is initialized, the original user's ioloop should be activated back. M src/doveadm/doveadm-mail-import.c 2021-03-17 18:48:37 +0200 Timo Sirainen (19779828ea) submission: Add reason_code=submission:cmd_ M src/submission-login/client.c M src/submission/main.c 2021-03-17 18:48:24 +0200 Timo Sirainen (ebd660c594) lmtp: Add reason_code=lmtp:cmd_ M src/lmtp/main.c 2021-03-17 18:44:09 +0200 Timo Sirainen (750f14dae0) lib-smtp: Add reason_code=:cmd_* This requires caller to set smtp_server_settings.reason_code_module. For now only cmd_mail, cmd_rcpt and cmd_data are implemented. The other commands are likely not very useful. M src/lib-smtp/smtp-server-cmd-data.c M src/lib-smtp/smtp-server-cmd-mail.c M src/lib-smtp/smtp-server-cmd-rcpt.c M src/lib-smtp/smtp-server-connection.c M src/lib-smtp/smtp-server-private.h M src/lib-smtp/smtp-server.c M src/lib-smtp/smtp-server.h 2021-04-22 20:27:45 +0300 Timo Sirainen (7b6e14ce5e) lib-http: http-client-request - Preserve global events' reason_code in request events Since HTTP requests are asynchronous, it's possible that the global events go away before the HTTP request is finished. This way the reason_code will be preserved in http_request_finished event. M src/lib-http/http-client-request.c 2021-03-11 17:54:18 +0200 Timo Sirainen (fbcb1dafbf) lib: Add event_reason_code() for building reason codes easily M src/lib/lib-event.c M src/lib/lib-event.h M src/lib/test-lib-event.c M src/lib/test-lib.inc 2021-03-09 16:45:20 +0200 Timo Sirainen (c0a3b73732) lib: Add event_reason_begin/end() API This can be used to easily add reason_code to all events being emitted within the begin..end calls. The reasons can also be nested. For example: reason = event_reason_begin("reason1"); // ... reason2 = event_reason_begin("reason2"); // .. event_reason_end(&reason2); event_reason_end(&reason); This results in having reason_code=["reason1", "reason2"] for all events emitted while reason2 exists. M src/lib/lib-event.c M src/lib/lib-event.h 2021-04-21 16:55:57 +0300 Timo Sirainen (2bba7f1f34) lib: event_pop_global() - Assert-crash if trying to pop ioloop context's global root event This makes it easier to debug bugs. M src/lib/ioloop-private.h M src/lib/ioloop.c M src/lib/lib-event.c 2021-03-11 02:19:37 +0200 Timo Sirainen (c633d08bf2) lib: Push/pop global event stack automatically when ioloop contexts are switched M src/lib/ioloop-private.h M src/lib/ioloop.c M src/lib/lib-event.h M src/lib/test-ioloop.c 2021-04-21 17:11:54 +0300 Timo Sirainen (75285a3169) lib-storage: mail_storage_service_next*() - On failure don't leave user's io context activated M src/lib-storage/mail-storage-service.c 2021-03-11 02:18:55 +0200 Timo Sirainen (340e961cfe) lib-storage: Remove global event stack tracking This will be implemented by ioloop contexts directly in the next commit. M src/lib-storage/mail-storage-service.c 2021-03-09 16:33:15 +0200 Timo Sirainen (c822238604) lib: Fix global events to actually work Also add comments to clarify how exactly it works. M src/lib/event-filter.c M src/lib/lib-event.c M src/lib/lib-event.h M src/lib/test-event-filter.c 2021-04-20 00:08:57 +0300 Timo Sirainen (16fca42dec) lib: event_push_global() - Assert that event is not NULL M src/lib/lib-event.c 2021-09-09 13:46:24 +0300 Timo Sirainen (e2995d85c2) lib-master: Fix sending events recursively The event sending itself may recursively trigger more events (e.g. data_stack_grow). The previous BEGINs must have been flushed by that time or the recursive events might be pointing to event IDs that haven't even been sent to the stats process yet. Fixes: stats: Error: Client sent invalid input for UPDATE: Unknown event ID M src/lib-master/stats-client.c 2021-03-09 16:29:49 +0200 Timo Sirainen (9d93a24824) lib-master, stats: Send global events to stats process M src/lib-master/stats-client.c M src/lib-master/test-event-stats.c M src/stats/client-writer.c M src/stats/test-client-writer.c 2021-03-19 13:13:45 +0200 Timo Sirainen (0a57bd650e) stats: Support group_by for string lists M src/stats/stats-metrics.c 2021-01-27 13:10:07 +0200 Aki Tuomi (5f8775fc40) stats: Support exporting event string lists M src/stats/event-exporter-fmt-json.c M src/stats/event-exporter-fmt-tab-text.c 2021-03-19 13:02:54 +0200 Timo Sirainen (775ddf19ed) stats: Split off stats_metric_get_sub_metric() M src/stats/stats-metrics.c 2021-03-19 13:05:35 +0200 Timo Sirainen (a1623b5e44) stats: Rename stats_metric_get_sub_metric() to stats_metric_find_sub_metric() M src/stats/stats-metrics.c 2021-03-19 12:59:53 +0200 Timo Sirainen (81d50807bf) stats: Split off stats_metric_group_by_value_label() M src/stats/stats-metrics.c 2021-03-19 12:52:13 +0200 Timo Sirainen (add670d598) stats: stats_metric_group_by_*() - Add _r suffix to returned value parameter M src/stats/stats-metrics.c 2020-12-15 09:17:57 +0200 Aki Tuomi (4f752d381c) lib: lib-event - Add support for string lists Provide API to create string lists. These are particularly useful if you need to provide list of causes for an event, such as why some mail was opened. M src/lib/Makefile.am M src/lib/event-filter.c M src/lib/lib-event.c M src/lib/lib-event.h M src/lib/test-event-filter.c M src/lib/test-event-flatten.c A src/lib/test-lib-event.c M src/lib/test-lib.inc M src/stats/event-exporter-fmt-json.c M src/stats/event-exporter-fmt-tab-text.c M src/stats/stats-metrics.c 2021-08-23 17:21:58 +0300 Timo Sirainen (9a4d33f893) lib: test-event-filter - Improve "override parent fields" test M src/lib/test-event-filter.c 2021-08-23 17:15:47 +0300 Timo Sirainen (e670cb1468) lib: test-event-filter - Fix parent/child events to actually be parent/child M src/lib/test-event-filter.c 2021-03-16 19:22:25 +0200 Timo Sirainen (1411aaf4a4) lib: Split off event_import_arg() M src/lib/lib-event.c 2021-03-16 19:19:43 +0200 Timo Sirainen (bb602382b9) lib: Split off event_import_field() M src/lib/lib-event.c 2021-09-24 18:21:29 +0300 Timo Sirainen (a12796fd66) lib-index: Allow ignoring index corruption checks with --enable-devel-checks If DEBUG_IGNORE_INDEX_CORRUPTION environment is set, don't check if index contains internal corruption. This is useful for CI tests that intentionally test corrupted indexes. M src/lib-index/mail-index-sync-update.c 2021-09-28 00:28:35 +0100 Siavash Tavakoli (c92afe67a1) lib-http: http-server: Add request events Adds http_server_request_started and http_server_request_finished. M src/lib-http/http-server-connection.c M src/lib-http/http-server-private.h M src/lib-http/http-server-request.c 2021-08-26 13:13:55 +0100 Siavash Tavakoli (12229f5e61) lib-http: http-server-request - Add request_id and status_code fields to event M src/lib-http/http-server-request.c M src/lib-http/http-server-response.c 2021-09-28 15:35:21 +0300 sergey.kitov (e8d9838485) stats: Use duplicated metric settings in stats_metrics_add_dynamic(). M src/stats/stats-metrics.c 2021-09-15 14:44:42 +0200 Markus Valentin (b04cb5ea03) imapc: Add MAIL_STORAGE_CLASS_FLAG_SECONDARY_INDEX storage class flag Add SECONDARY_INDEX storage class flag to enable storing shared private indexes in obox user root bundle. M src/lib-storage/index/imapc/imapc-storage.c 2021-09-24 17:33:38 +0300 Timo Sirainen (e399436c15) lib-storage: mail_get_binary_stream() - Add comment about having to unref returned istream M src/lib-storage/mail-storage.h 2021-09-22 15:58:55 +0300 Timo Sirainen (1ce928c75f) lib: test-cpu-limit - Remove dead code No longer needed after 6d902507c24fca4f64e3e9bf7d79ae5a48281cd8 M src/lib/test-cpu-limit.c 2021-09-27 11:49:05 +0300 Timo Sirainen (0a70b02bbb) lib: test-strfuncs - Avoid testing p_strndup() with overlong max_chars parameter This ended up in memchr() call with n=SIZE_MAX-1, which sometimes doesn't work right with old glibc versions. Fixes: Panic: Trying to allocate 18446744073709551615 bytes M src/lib/test-strfuncs.c 2021-09-08 10:39:36 +0300 Aki Tuomi (211040d836) lib-mail: Add test for empty header value M src/lib-mail/test-message-header-parser.c 2021-09-02 17:10:11 +0300 Aki Tuomi (d0e0b22b6b) lib-mail: Limit header length to 1000 bytes M src/lib-mail/message-header-parser.c M src/lib-mail/test-message-header-parser.c 2021-09-02 17:12:55 +0300 Aki Tuomi (44c43133a4) lib-mail: If message header has no colon, store it as value only If the header is missing :, it is not valid header. Storing it as value only ensures it will be kept by mbox rewrite, but will not be processed as a header. M src/lib-mail/message-header-parser.c M src/lib-mail/test-message-header-parser.c M src/plugins/pop3-migration/pop3-migration-plugin.c 2021-09-02 16:46:19 +0300 Aki Tuomi (ac65213384) lib-mail: test-message-header-parser - Add NAME10, 100, 1000 macros for testing M src/lib-mail/test-message-header-parser.c 2021-09-07 14:37:34 +0300 Aki Tuomi (0009fd1edf) lib: Add i_memspn() and i_memcspn() Binary data safe variants of strspn() and strcspn() M src/lib/strfuncs.c M src/lib/strfuncs.h M src/lib/test-strfuncs.c 2021-09-16 13:32:37 +0200 Timo Sirainen (8af2bd8640) virtual: Log a debug message why backend mailbox has changed M src/plugins/virtual/virtual-sync.c 2021-09-24 10:39:43 +0200 Stephan Bosch (801405d49f) lib-storage: mail-duplicate - Restructure mail_duplicate_read_db_file() to make sure fd is closed. Found by Coverity. M src/lib-storage/mail-duplicate.c 2021-09-24 10:22:28 +0200 Stephan Bosch (99d129cd50) lib-storage: mail-duplicate - Fix segfault occurring upon failure to lock and open DB file. Found by Coverity. M src/lib-storage/mail-duplicate.c 2021-08-18 16:54:00 +0200 Timo Sirainen (26284cf6f7) indexer-worker: Fix event leak on error handling M src/indexer/master-connection.c 2021-07-13 04:15:14 +0200 Stephan Bosch (2d32ee8b54) lib-storage: mail-duplicate - Implement separate error code for deadlock. M src/lib-storage/mail-duplicate.c M src/lib-storage/mail-duplicate.h 2021-09-16 01:49:57 +0200 Stephan Bosch (dcee43b54c) lib-storage: mail-duplicate - Update records from duplicate DB file after acquirement of per-ID lock. The process previously holding the per-ID lock may have updated the DB. M src/lib-storage/mail-duplicate.c 2021-09-17 11:11:21 +0200 Stephan Bosch (a27a97f49d) lib-storage: mail-duplicate - Move acquirement of dotlock for DB file into mail_duplicate_read(). M src/lib-storage/mail-duplicate.c 2021-09-20 11:58:12 +0200 Stephan Bosch (9cb56c3b28) lib-storage: mail-duplicate - Implement per-ID locking. M src/lib-storage/mail-duplicate.c M src/lib-storage/mail-duplicate.h 2021-09-17 11:16:39 +0200 Stephan Bosch (9bd8fff3b0) lib-storage: mail-duplicate - Allow calling mail_duplicate_read() more than once in a transaction. M src/lib-storage/mail-duplicate.c 2021-07-13 23:22:52 +0200 Stephan Bosch (b3d183d81d) lib-storage: mail-duplicate - Record an entry for both checked and marked IDs. Still only write the marked IDs to the file. The in-memory record is needed for the locking introduced in a later commit. M src/lib-storage/mail-duplicate.c 2021-07-13 05:03:02 +0200 Stephan Bosch (711f05f3d1) lib-storage: mail-duplicate - Add debug messages for transaction. M src/lib-storage/mail-duplicate.c 2021-07-13 05:07:39 +0200 Stephan Bosch (4809e7e1cd) lib-storage: mail-duplicate - Add debug messages for database. M src/lib-storage/mail-duplicate.c 2021-07-13 04:40:24 +0200 Stephan Bosch (70af5522c6) lib-storage: mail-duplicate - Add event to transaction object. M src/lib-storage/mail-duplicate.c 2021-07-13 04:53:11 +0200 Stephan Bosch (4fe7f887a6) lib-storage: mail-duplicate - Add event to database object. M src/lib-storage/mail-duplicate.c 2021-06-08 03:51:10 +0200 Stephan Bosch (63553ff976) lib-storage: mail-duplicate - Restructure API to make it transaction-based. M src/lib-storage/mail-duplicate.c M src/lib-storage/mail-duplicate.h 2021-07-13 04:03:42 +0200 Stephan Bosch (f786488b23) lib-storage: mail-duplicate - Change mail_duplicate_check() return type from bool to enum. M src/lib-storage/mail-duplicate.c M src/lib-storage/mail-duplicate.h 2021-09-17 11:04:55 +0200 Stephan Bosch (90400db2d6) lib-storage: Reformat mail-duplicate.c. M src/lib-storage/mail-duplicate.c 2021-08-07 15:43:35 +0200 Stephan Bosch (8bfdede141) lib-storage: mail-user - Add mail_user_get_volatile_dir(). M src/lib-storage/mail-user.c M src/lib-storage/mail-user.h 2021-09-20 02:45:23 +0200 Stephan Bosch (4c1cf82d61) lib: file-lock - Adjust API to allow EDEADLK to be used by application. It always caused a Dovecot panic before when returned from kernel. M src/lib/file-lock.c M src/lib/file-lock.h 2021-09-19 13:09:29 +0200 Stephan Bosch (083439ed73) lib: file-lock - Rework API to make it extensible. M src/doveadm/dsync/dsync-brain.c M src/lib-dict/dict-file.c M src/lib-fs/fs-posix.c M src/lib-index/mail-index-lock.c M src/lib-index/mail-index-strmap.c M src/lib-storage/index/dbox-common/dbox-file.c M src/lib-storage/mail-storage.c M src/lib-storage/mail-user.c M src/lib-storage/mailbox-list.c M src/lib/file-create-locked.c M src/lib/file-create-locked.h M src/lib/file-lock.c M src/lib/file-lock.h M src/lib/test-file-create-locked.c M src/plugins/fts-squat/squat-trie.c M src/plugins/fts-squat/squat-uidlist.c 2021-09-20 02:39:08 +0200 Stephan Bosch (de5e12a160) lib: file-lock - Rename file_{wait,try}_lock_error() to file_{wait,try}_lock(). M src/lib-dict/dict-file.c M src/lib-fs/fs-posix.c M src/lib-index/mail-index-lock.c M src/lib-index/mail-index-strmap.c M src/lib-storage/index/dbox-common/dbox-file.c M src/lib/file-create-locked.c M src/lib/file-lock.c M src/lib/file-lock.h M src/plugins/fts-squat/squat-trie.c M src/plugins/fts-squat/squat-uidlist.c 2021-09-20 02:29:55 +0200 Stephan Bosch (13b9181e32) lib: file-lock - Remove file_{wait,try}_lock(). M src/lib/file-lock.c M src/lib/file-lock.h 2021-09-20 02:26:46 +0200 Stephan Bosch (4dbae0e6c1) global: Avoid use of file_{wait,try}_lock(). Use the file_{wait,try}_lock_error() variants instead. M src/lib-dict/dict-file.c M src/lib-fs/fs-posix.c M src/lib-index/mail-index-lock.c M src/lib-index/mail-index-strmap.c M src/lib-storage/index/dbox-common/dbox-file.c M src/plugins/fts-squat/squat-trie.c M src/plugins/fts-squat/squat-uidlist.c 2021-09-22 17:36:27 +0300 Timo Sirainen (ed1264368a) lib-http: test-http-client-errors - Allow more relaxed timeouts for connect retry tests With max_connect_attempts=3 the connects come at (0ms, 100ms, 300ms). Before the 3rd attempt a timeout at 250ms must have triggered, so there was only 50ms time for it to trigger. This wasn't always enough when running with valgrind on an overloaded system. Solve this by increasing max_connect_attempts=4 so the 4th attempt comes at 700ms, giving the timeout 450ms to trigger. M src/lib-http/test-http-client-errors.c 2021-09-22 12:14:08 +0300 Timo Sirainen (4f605823a4) lib: Add most data_stack_grow event fields before checking if event is wanted This allows using e.g. "event=data_stack_grow and alloc_size > 32768" as an event filter. M src/lib/data-stack.c 2021-09-21 18:27:29 +0300 Timo Sirainen (18e1eaf61e) config: Add data stack frame M src/config/config-request.c 2021-09-21 18:26:53 +0300 Timo Sirainen (9055758361) doveconf: Avoid unnecessary data stack use when writing output M src/config/doveconf.c 2021-09-21 18:21:54 +0300 Timo Sirainen (dab478e5f4) master: Create each service in its own data stack frame M src/master/service.c 2021-09-21 17:52:15 +0300 Timo Sirainen (e873c9aeae) doveadm: Call each run() in its own data stack frame M src/doveadm/doveadm-mail.c 2021-09-21 17:14:44 +0300 Timo Sirainen (7ac69350e3) dsync: Add data stack frames to mailbox loops M src/doveadm/dsync/dsync-brain-mailbox-tree.c 2021-09-21 17:10:56 +0300 Timo Sirainen (1b4f8cf6a2) dsync: Split off dsync_brain_recv_mailbox_tree_add() M src/doveadm/dsync/dsync-brain-mailbox-tree.c 2021-09-21 17:50:32 +0300 Timo Sirainen (d83e4f5fd2) acl: Code cleanup - Remove pointless while-loop M src/plugins/acl/acl-shared-storage.c 2021-09-21 17:03:45 +0300 Timo Sirainen (f78c00f1f3) acl: acllist rebuild - Move data stack frame to caller's loop M src/plugins/acl/acl-backend-vfile-acllist.c 2021-09-21 16:14:12 +0300 Timo Sirainen (e05b6df33a) acl: Add data stack frame when iterating mailboxes Avoids wasting memory when there are a lot of mailboxes. M src/plugins/acl/acl-mailbox-list.c 2021-09-21 17:51:15 +0300 Timo Sirainen (5694b04f70) lib-storage: mail_user_unref() - Add data stack frame The deinit code paths can sometimes eat up quite a lot of data stack. M src/lib-storage/mail-user.c 2021-09-22 12:49:46 +0300 Timo Sirainen (ef84b4e2f6) lib-storage: mailbox_create() - Add data stack frames M src/lib-storage/mail-storage.c 2021-09-22 12:48:18 +0300 Timo Sirainen (0b1dff0b1d) lib-storage: Add data stack frames to [service] user initialization Initialization steps can use a lot of data stack, so try to free it at several checkpoints. M src/lib-storage/mail-storage-service.c 2021-09-21 17:49:34 +0300 Timo Sirainen (1682263f04) lib-storage: Add data stack frame when iterating mailboxes to build GUID cache M src/lib-storage/mailbox-guid-cache.c 2021-09-21 17:48:33 +0300 Timo Sirainen (8c56e2c025) lib-storage: mailbox_verify_*name() - Add data stack frames This function can eat up quite a lot of data stack. M src/lib-storage/mail-storage.c 2021-09-21 17:47:41 +0300 Timo Sirainen (4908b7c139) lib-storage: str_contains_special_use() - Add data stack frame This function is called in a loop by namespace_find_special_use(). M src/lib-storage/mail-storage.c 2021-09-21 16:58:13 +0300 Timo Sirainen (e22519d85d) lib-storage: List index rebuild - Add data stack frames M src/lib-storage/list/mail-storage-list-index-rebuild.c 2021-09-21 16:57:13 +0300 Timo Sirainen (99b9890db0) lib-storage: List index rebuild - Split off mail_storage_list_index_find_indexed_mailbox() M src/lib-storage/list/mail-storage-list-index-rebuild.c 2021-09-21 16:37:13 +0300 Timo Sirainen (8b7438a3f9) lib-storage: Don't use data stack for mailbox list index header update There can be a lot of mailboxes, causing excessive data stack usage. M src/lib-storage/list/mailbox-list-index-sync.c 2021-09-21 16:42:39 +0300 Timo Sirainen (bb75bc110f) lib-index: Don't use data stack for building index header update buffer The header update can be large (e.g. dovecot.list.index with many mailboxes) and grow data stack unnecessarily. M src/lib-index/mail-index-transaction-export.c 2021-09-21 17:51:50 +0300 Timo Sirainen (742053d520) lib: module_dir_deinit() - Call each deinit() in its own data stack frame M src/lib/module-dir.c 2021-09-21 16:15:54 +0300 Timo Sirainen (f13526d432) lib: test-data-stack - Make sure data stack memory usage doesn't leak M src/lib/test-data-stack.c 2021-09-21 13:38:27 +0300 Timo Sirainen (6d902507c2) lib: test-cpu-limit - Remove checking for CPU usage upper limit These tests keep randomly failing on loaded systems. It's more important anyway to check that the minimum CPU usage is high enough than it is to check that CPU usage isn't too high. M src/lib/test-cpu-limit.c 2021-09-17 16:11:12 +0300 Timo Sirainen (ba465f3a04) lib: Optimize str_tabescape() M src/lib/strescape.c 2021-09-17 16:10:12 +0300 Timo Sirainen (bcfc14fae3) lib: Optimize p_strsplit_tabescaped() M src/lib/strescape.c 2021-09-17 16:06:17 +0300 Timo Sirainen (5615fa62db) lib: Optimize t_strsplit_tabescaped() M src/lib/strescape.c 2021-09-17 16:04:00 +0300 Timo Sirainen (09b2f400d2) lib: Optimize t_strsplit_tabescaped_inplace() M src/lib/strescape.c 2021-09-17 16:02:10 +0300 Timo Sirainen (a6b1c0114c) lib: Optimize t_strdup*() Avoid zeroing the allocated data stack memory just before it's going to be filled with the duplicated string anyway. M src/lib/strfuncs.c 2021-03-12 01:41:35 +0200 Timo Sirainen (6345e8f021) lib: Optimize t_str_tabunescape() M src/lib/strescape.c 2021-03-12 01:38:13 +0200 Timo Sirainen (cd63b1eeea) lib: Optimize str_tabunescape() M src/lib/strescape.c 2021-03-12 01:27:30 +0200 Timo Sirainen (ea636c55e4) lib: Optimize str_append_tabescaped() Avoid calling strlen() and replace for-loop with strcspn(). M src/lib/strescape.c 2021-03-12 01:23:04 +0200 Timo Sirainen (1abeccbeca) lib: Optimize str_append_tabescaped_n() M src/lib/strescape.c M src/lib/test-strescape.c 2021-03-12 01:19:38 +0200 Timo Sirainen (de0871dedb) lib: Optimize p_strndup() M src/lib/strfuncs.c M src/lib/test-lib.inc M src/lib/test-strfuncs.c 2021-02-11 02:56:11 +0200 Timo Sirainen (7371c1033e) lib: Optimize buffer_append() and buffer_append_c() M src/lib/buffer.c 2021-02-11 02:44:34 +0200 Timo Sirainen (34d72ca7f2) lib: buffer_create_dynamic_max() - Fix max_size handling Never allocate buffer larger than its max_size, since it's just wasted memory. Also clarify that the allocation can actually go up to max_size+1 because of str_c() NUL byte reservation. M src/lib/buffer.c M src/lib/buffer.h 2021-02-11 02:30:12 +0200 Timo Sirainen (53adac82ea) lib: buffer_append_zero() - Avoid unnecessary memset() M src/lib/buffer.c 2021-02-11 02:21:30 +0200 Timo Sirainen (93499cd0fd) lib: buffer - Add writable_size to simplify checking if buffer needs to be grown M src/lib/buffer.c M src/lib/buffer.h 2021-09-15 14:14:47 +0200 Timo Sirainen (4a2d3e3b30) lib: buffer - Replace casts with container_of() M src/lib/buffer.c 2021-08-12 10:02:55 +0300 Aki Tuomi (c513b9a13d) lib-storage: Add data stack frame for mailbox_copy and mailbox_move M src/lib-storage/mail-storage.c 2021-08-12 09:58:57 +0300 Aki Tuomi (d1ef929697) lib-storage: Add data stack frame for mailbox_rename M src/lib-storage/mail-storage.c 2021-08-12 09:58:41 +0300 Aki Tuomi (0e6e64c6c0) lib-storage: Add data stack frame for mailbox_delete M src/lib-storage/mail-storage.c 2021-09-16 19:32:02 +0300 Timo Sirainen (095089cd8f) acl: acl_backend_vfile_has_acl() - Simplify code M src/plugins/acl/acl-backend-vfile.c 2021-09-16 19:13:09 +0300 Timo Sirainen (4f765652f0) acl: acl_backend_vfile_has_acl() - Open mailbox to check if it exists This is a bit more expensive than the previous behavior, but it's done only when creating or renaming mailboxes which are pretty rare operations. This fixes copying parent ACLs with obox when the parent mailbox doesn't exist in local metacache. M src/plugins/acl/acl-backend-vfile.c M src/plugins/acl/acl-backend-vfile.h 2021-09-16 19:26:07 +0300 Timo Sirainen (3533994fd9) acl: acl_backend_vfile_has_acl() - Avoid unnecessary local ACL file check The local ACL file can't exist if its mailbox doesn't exist. M src/plugins/acl/acl-backend-vfile.c 2021-09-16 19:22:41 +0300 Timo Sirainen (0f8fb686c0) acl: acl_backend_vfile_has_acl() - Check first if global ACL exists Global ACL can be checked more efficiently. If it exists, there's no need anymore to access the local mailbox ro ACL files. M src/plugins/acl/acl-backend-vfile.c 2021-09-16 18:05:04 +0300 Timo Sirainen (f63bda4db5) acl: Consistently determine whether ACL files are in control or mailbox directory Add mail_storage_get_acl_list_path_type() that is used for it. This fixes ACL inheritance with obox. M src/plugins/acl/acl-backend-vfile-acllist.c M src/plugins/acl/acl-backend-vfile.c M src/plugins/acl/acl-backend-vfile.h 2021-09-06 00:49:06 +0100 Siavash Tavakoli (e1cbc8f64d) lib-lua: Add function for restricting global variable definition Add "dovecot.restrict_global_variables()" with a boolean argument to mitigate unintended variable assignments and to prevent unnecessarily populating global namespace. If enabled, variables can only be defined local to the script but global functions are still allowed. M src/lib-lua/dlua-dovecot.c 2021-09-07 15:03:37 +0100 Siavash Tavakoli (460edc6b64) lib-lua: Use rawget to check presence of functions in scripts With the restricted global variables in next commit, checking for undeclared functions results in error. Use rawget to avoid metamethods. M src/lib-lua/dlua-script.c 2021-09-17 12:26:35 +0300 Timo Sirainen (dc21a1d7e8) lib-lua: Build test-dict-lua only with Lua 5.3+ Fixes building with Lua 5.1 M src/lib-lua/Makefile.am 2021-09-14 10:33:50 +0300 Aki Tuomi (85e65dd58a) lib-compression: bench-compress - Ensure we have both istream and ostream constructor After 6e5ae5ef0f0f31acd7bde0db53980a708c81eced we have read-only compression mechanism, that leads to null pointer crash in bench-compress. M src/lib-compression/bench-compression.c 2021-09-16 20:12:13 +0300 Timo Sirainen (4ee8601abb) NEWS: Add news for 2.3.16 M NEWS 2021-09-10 15:52:43 +0300 Timo Sirainen (9e3df2cddd) lib-lua: Add test-dict-lua M src/lib-lua/Makefile.am A src/lib-lua/test-dict-lua.c 2021-09-10 15:47:47 +0300 Timo Sirainen (39f2166fac) dict-lua: Change dict:lookup() to actually return nil if key isn't found It was previously returning an empty table, although the comment said it should have returned nil. M src/lib-dict/dict-lua.c 2021-09-10 12:49:50 +0300 Timo Sirainen (a564b607de) lib-dict: dict-lua - Add set_timestamp() M src/lib-dict/dict-txn-lua.c 2021-09-01 19:33:49 +0300 Timo Sirainen (53eeb81a6d) lib-dict: dict-lua - Add unset() M src/lib-dict/dict-txn-lua.c 2021-09-07 17:00:07 +0300 Timo Sirainen (3740bc1679) indexer: Remove the concept of a "busy" connection All the connections are busy, since they are created for a new request and they are disconnected when the request is done. M src/indexer/indexer.c M src/indexer/worker-connection.c M src/indexer/worker-connection.h M src/indexer/worker-pool.c M src/indexer/worker-pool.h 2021-09-07 16:56:16 +0300 Timo Sirainen (2f8bdc9372) indexer: Handle more requests whenever indexer-worker connection closes Previously this was done only when worker process sent a "request finished" notification. Crashing worker processes could have caused the queue to get stuck until more requests were added to the queue. M src/indexer/indexer.c M src/indexer/worker-connection.c M src/indexer/worker-connection.h M src/indexer/worker-pool.c M src/indexer/worker-pool.h 2021-09-07 16:52:40 +0300 Timo Sirainen (61ca1eb1b8) indexer: Disconnect from worker after each request service_count won't be tracked correctly otherwise. M src/indexer/worker-connection.c 2021-09-07 15:47:23 +0300 Timo Sirainen (9718957b84) indexer: Fix tracking indexer-worker's process_limit After recent changes, the process_limit was too often thought to be 1. M src/indexer/worker-connection.c M src/indexer/worker-connection.h M src/indexer/worker-pool.c 2021-08-31 12:14:15 +0300 Timo Sirainen (4018f44337) indexer: Change status callback to take struct indexer_request parameter M src/indexer/indexer.c M src/indexer/indexer.h M src/indexer/worker-connection.c M src/indexer/worker-connection.h 2021-08-31 12:12:49 +0300 Timo Sirainen (b1c4f2b882) indexer: Don't free worker_connection too early There's no need for the status callback anymore to free the connection. It will be tracked automatically. M src/indexer/indexer.c M src/indexer/worker-connection.c M src/indexer/worker-connection.h M src/indexer/worker-pool.c M src/indexer/worker-pool.h 2021-08-31 12:08:32 +0300 Timo Sirainen (a15eb469aa) indexer: Use a separate indexer_queue_callback_t type for indexer-queue callback M src/indexer/indexer-queue.c M src/indexer/indexer-queue.h 2021-09-14 15:33:50 +0300 sergey.kitov (e7a3c48390) lib: Remove connect_finished_time field from connection event. M src/lib/connection.c 2021-09-10 19:00:09 +0300 Timo Sirainen (da3bc6ea23) lib: ENUM_NEGATE() - Disable runtime sizeof() check with STATIC_CHECKER This is to avoid "Dangerous variable-length array (VLA) declaration" errors with clang 12 scan-build, which happen because scan-build keeps thinking that the enums can become larger than 2147483647. M src/lib/macros.h 2021-08-31 15:44:20 +0300 Aki Tuomi (4826b08c47) doveadm: Flush data to server client asynchronously M src/doveadm/doveadm-print-server.c 2021-07-13 13:32:09 +0200 Markus Valentin (d89e8a5c3c) virtual: Add storage flag for secondary index M src/plugins/virtual/virtual-storage.c 2021-07-13 13:28:43 +0200 Markus Valentin (69ddbe6dd0) lib-storage: Add storage_class_flag for secondary index M src/lib-storage/mail-storage-private.h 2021-09-10 06:47:21 +0200 Bernhard M. Wiedemann (00eba31f19) man: doveadm director flush - The parameter is -F, not -f M doc/man/doveadm-director.1.in 2021-09-08 09:53:12 +0300 Aki Tuomi (30eecd1f82) doveadm: doveadm-stats - Allocate field_types field_types was function local variable that got used outside of function. Change to use datastack allocation instead to keep it valid after leaving function. Broken in e9a46e3a6df2edd6cb68a8fc04a5e8e4564a9d5e M src/doveadm/doveadm-stats.c 2021-08-31 12:48:38 +0300 Aki Tuomi (601b5465dc) lib-storage: Move (un)deleting debug message to mailbox_mark_index_deleted M src/lib-storage/list/mail-storage-list-index-rebuild.c M src/lib-storage/mail-storage.c 2021-08-09 11:56:17 +0300 Aki Tuomi (99efbc7f81) lib-storage: mailbox-list - Detect duplicate GUIDs This is only done for LAYOUT=INDEX. M src/lib-storage/list/mailbox-list-index.c 2021-08-19 17:10:31 +0300 Aki Tuomi (f30403df4b) lib-storage: mailbox-list - Add duplicate pool for duplicate detection M src/lib-storage/list/mailbox-list-index.c 2021-08-16 14:38:47 +0300 Aki Tuomi (196a5ed776) lib-storage: maildir - Use mail_storage_index_list_rebuild M src/lib-storage/index/maildir/maildir-storage.c M src/lib-storage/index/maildir/maildir-sync.c 2021-08-20 11:43:27 +0300 Aki Tuomi (18afa46644) lib-storage: maildir - Allow creating existing folder when rebuilding list index M src/lib-storage/index/maildir/maildir-storage.c 2021-08-09 14:23:13 +0300 Aki Tuomi (a92541c5b9) lib-storage: dbox - Use mailbox_list_index_rebuild M src/lib-storage/index/dbox-multi/mdbox-storage.c M src/lib-storage/index/dbox-multi/mdbox-sync.c M src/lib-storage/index/dbox-single/sdbox-storage.c M src/lib-storage/index/dbox-single/sdbox-sync.c M src/lib-storage/index/index-storage.c 2021-08-09 15:47:28 +0300 Aki Tuomi (451883dbb8) lib-storage: dbox - Allow creating existing folder when rebuilding list index M src/lib-storage/index/dbox-common/dbox-storage.c M src/lib-storage/index/index-storage.c 2021-08-13 14:18:21 +0300 Aki Tuomi (2fc8d7024b) lib-storage: Add list index rebuild code M src/lib-storage/list/Makefile.am A src/lib-storage/list/mail-storage-list-index-rebuild.c M src/lib-storage/mail-storage-private.h 2021-08-27 12:59:59 +0300 Aki Tuomi (5a75724a2e) lib-storage: Populate mailboxes_fs if needed M src/lib-storage/mail-storage.c 2021-08-20 14:30:46 +0300 Aki Tuomi (3855ccbf9a) lib-storage: mailbox-list - Try to get GUID from mailbox path M src/lib-storage/list/mailbox-list-index-status.c 2021-08-13 10:29:59 +0300 Aki Tuomi (a92b1f9316) lib-storage: Add fields to mail_storage needed for list rebuild M src/lib-storage/mail-storage-private.h M src/lib-storage/mail-storage.c 2021-06-30 08:44:33 +0300 Aki Tuomi (36f96c49ca) lib-storage: Fix changing mailbox GUID with LAYOUT=index The old path would generate Mail/mailboxes/mailboxes/ M src/lib-storage/list/mailbox-list-index-backend.c 2021-06-22 15:59:25 +0300 sergey.kitov (c1a57f47a7) doveadm-stats: Add doveadm stats add/remove documentation M doc/man/doveadm-stats.1.in 2021-05-27 11:46:02 +0300 sergey.kitov (bc31da4d84) doveadm: Add 'stats add' and 'stats remove' commands M src/doveadm/Makefile.am M src/doveadm/doveadm-cmd.c M src/doveadm/doveadm-cmd.h M src/doveadm/doveadm-stats.c 2021-06-09 17:23:28 +0300 sergey.kitov (eef75dd719) stats: replace hardcoded value of default exporter_include with macro M src/stats/stats-settings.c M src/stats/stats-settings.h 2021-06-09 17:22:39 +0300 sergey.kitov (e9a46e3a6d) doveadm: Rewrite doveadm stats dump command to allow reuse code in other commands. M src/doveadm/doveadm-stats.c 2021-05-10 16:39:21 +0300 sergey.kitov (57bb3b90cb) lib-master: Accept filter updates from stats by stats-client. M src/lib-master/stats-client.c 2021-04-20 17:07:36 +0300 sergey.kitov (0444b730c2) stats: Implement ipc interface for adding and removing metrics M src/stats/client-reader.c 2021-05-10 16:13:12 +0300 sergey.kitov (adbbd40458) stats: Implement sending filter updates to connected processes. M src/stats/client-writer.c M src/stats/client-writer.h 2021-04-20 17:06:58 +0300 sergey.kitov (a2a79fb376) stats: Add functions for adding or removing metrics M src/stats/stats-metrics.c M src/stats/stats-metrics.h 2021-04-13 11:49:43 +0300 sergey.kitov (50f36bb1d2) stats: Expose stats_metric_setting_parser_info M src/stats/stats-settings.h 2021-04-20 17:06:26 +0300 sergey.kitov (fcacfde02a) lib: Add function removing queries from event_filter M src/lib/event-filter.c M src/lib/event-filter.h 2021-09-02 14:31:36 +0300 Timo Sirainen (a476e16ae3) lib-http: test-http-client-errors - Fix random hangs Wait for subprocesses to be initialized before starting each test. This should fix random hangs with the test. M src/lib-http/test-http-client-errors.c 2021-09-02 15:39:33 +0300 Timo Sirainen (8b883745d6) lib-test: test_subprocess_notify_signal_*() - Add signo parameter This allows using multiple notification signals. M src/lib-http/test-http-client-errors.c M src/lib-test/test-subprocess.c M src/lib-test/test-subprocess.h 2021-08-19 12:50:04 +0200 Timo Sirainen (5280904733) lib-storage: Make sure header parsing is deinitialized after failures This should fix all the possible reasons for: Panic: file index-mail-headers.c: line 198 (index_mail_parse_header_init): assertion failed: (!mail->data.header_parser_initialized) M src/lib-storage/index/index-mail-headers.c M src/lib-storage/index/index-mail.c M src/lib-storage/index/index-mail.h 2021-08-19 12:32:45 +0200 Timo Sirainen (0b6a2fb6c1) lib-storage: Fix potential assert-crash if filter-stream fails If filter-stream isn't read until header (because the parent istream fails), the header parsing isn't deinitialized. If after the failure the headers are attempted to be parsed again, there's an assert-crash. Make sure this won't happen by finishing the filter-istream read, and if that fails then reset the header parsing anyway. Destroying the filter_stream may also change the parent istream offset to change, so this commit adds an extra seek to beginning of the istream when beginning to parse the mail headers. Fixes: Panic: file index-mail-headers.c: line 198 (index_mail_parse_header_init): assertion failed: (!mail->data.header_parser_initialized) M src/lib-storage/index/index-mail-headers.c 2021-08-19 12:29:36 +0200 Timo Sirainen (45df8159fe) lib-storage: Split off index_mail_filter_stream_destroy() M src/lib-storage/index/index-mail-headers.c 2021-08-17 14:33:56 +0200 Markus Valentin (6b7e4d1527) imapc: Fix crashing when copying nonexistent mails Check the msgmap before attempting to copy an mail which may has been expunged already. Fixes: Panic: file mail-storage.c: line 2385 (mailbox_transaction_commit_get_changes): assertion failed: (ret < 0 || seq_range_count(&changes_r->saved_uids) == save_count || array_count(&changes_r->saved_uids) == 0) M src/lib-storage/index/imapc/imapc-save.c 2021-08-18 14:04:53 +0200 Timo Sirainen (8e592661d5) lib-storage: Fix assert-crash in special partial mail parsing failures This happened for example if: - mail_precache() started parsing mail - header was parsed, but mail body parsing failed due to mail size mismatch - vsize parsing doesn't restart header parsing, because header size is already known - body parsing assert-crashes because there is no messsage parser initialized Fixes: Panic: file index-mail.c: line 1290 (index_mail_parse_body): assertion failed: (data->parser_ctx != NULL) M src/lib-storage/index/index-mail.c 2021-08-12 12:42:40 +0300 Aki Tuomi (35f7ff1c41) lib-oauth2: Add unit test for missing exp field M src/lib-oauth2/test-oauth2-jwt.c 2021-08-12 12:40:39 +0300 Aki Tuomi (5bc6fa7571) lib-oauth2: Add unit tests for valid tokens M src/lib-oauth2/test-oauth2-jwt.c 2021-06-08 00:35:13 +0200 s3lph <5564491+s3lph@users.noreply.github.com> (f3bef96857) lib-oauth2-jwt: Remove 'nbf < iat' check, as it's not mandated by RFC7519, and not uncommon to predate the nbf field M src/lib-oauth2/oauth2-jwt.c 2021-08-24 22:58:59 +0200 Timo Sirainen (8a7fa002d2) lib-test: Fix race when subprocess immediately receives signal Signal could be received before test_subprocess_is_child=1 is set, causing the subprocess's signal handler to also attempt to cleanup other subprocesses. This was causing http-test-client-errors unit tests to fail somewhat randomly, especially when running them only with 1 CPU. M src/lib-test/test-subprocess.c 2021-08-24 15:02:44 +0300 Timo Sirainen (07d66366ab) lib: Add test-macros M src/lib/Makefile.am M src/lib/test-lib.inc A src/lib/test-macros.c 2021-08-23 14:21:02 +0300 Timo Sirainen (a4f9219709) lib: Rewrite POINTER_CAST_TO() to avoid new clang warning Fixes: warning: performing pointer subtraction with a null pointer has undefined behavior [-Wnull-pointer-subtraction] M src/lib/macros.h 2021-08-23 14:20:54 +0300 Timo Sirainen (9c4077a843) dbox: Remove unnecessary variable The variable was set and updated, but never read. M src/lib-storage/index/dbox-common/dbox-file.c 2021-08-23 14:20:24 +0300 Timo Sirainen (a11c739b86) lib-dcrypt: Remove unnecessary variable The variable was set and updated, but never read. M src/lib-dcrypt/istream-decrypt.c 2021-08-23 11:46:46 +0300 Martti Rannanjärvi (bc679231f1) doveadm-dsync: Free ssl_iostream_context on connection failure M src/doveadm/doveadm-dsync.c 2021-04-13 18:25:06 +0200 Stephan Bosch (415c305d6c) lib-smtp: smtp-server-cmd-rcpt - Fix assert crash occurring for pipelined MAIL RCPT MAIL sequence. The assertion is wrong in that it assumes that no MAIL commands can be pending once RCPT command is next to reply. The RCPT command does not block the pipeline, so that a subsequent MAIL command can also be pending (but will almost never succeed). M src/lib-smtp/smtp-server-cmd-rcpt.c M src/lib-smtp/test-smtp-server-errors.c 2021-04-13 18:25:31 +0200 Stephan Bosch (23246612f2) lib-smtp: smtp-server-cmd-data - Add comment to pipeline state assertion. M src/lib-smtp/smtp-server-cmd-data.c 2021-08-20 01:19:28 +0200 Stephan Bosch (741a963c19) lib-smtp: smtp-server-cmd-data - Remove useless trans != NULL checks. M src/lib-smtp/smtp-server-cmd-data.c 2021-08-19 17:06:42 +0100 Siavash Tavakoli (285cf9c849) dict-sql: Fail early if there's unexpected number of bind arguments for iter Otherwise, lib-sql raises a panic. M src/lib-dict-backend/dict-sql.c 2021-08-17 15:23:31 +0200 Timo Sirainen (e34bffaab5) lib: istreams - Make sure freeing snapshots can't access freed parent istream memory This happened after the recent istream-header-filter snapshot changes. M src/lib/istream.c 2021-08-18 19:49:43 +0200 Timo Sirainen (b401e4136f) imap: Fix mailbox leak if MOVE can't open the source mailbox Broken by 143b7c2b412ed8f155e812603fda81886bec466e Fixes: Panic: file mail-user.c: line 229 (mail_user_deinit): assertion failed: ((*user)->refcount == 1) M src/imap/cmd-copy.c 2021-08-18 13:54:39 +0100 Siavash Tavakoli (16deb5b8bc) lib-lua: Don't include lua_resume_compat() for 5.1 lua_resume() is not supported in 5.1, so don't try to add a compatibility function that fails compilation. M src/lib-lua/dlua-compat.c M src/lib-lua/dlua-compat.h 2021-05-25 19:26:14 +0300 Timo Sirainen (bb1d67a870) lib: Remove unused event_filter_add() M src/lib/event-filter.c M src/lib/event-filter.h 2021-08-16 17:13:27 +0300 Timo Sirainen (f1bbfcb712) lib: test-event-filter - Replace event_filter_add() with event_filter_parse() M src/lib/test-event-filter.c 2021-05-24 23:57:13 +0300 Timo Sirainen (c4369cbf6a) lib: Add comments to event-related code M src/lib/event-log.c M src/lib/event-log.h M src/lib/lib-event-private.h M src/lib/lib-event.h 2021-05-24 22:26:27 +0300 Timo Sirainen (d2c0f1374c) lib: event_want_level() - Minor code cleanup event_want_log_level() internally does both of these checks, so it's enough to just check its return value. M src/lib/event-log.c 2021-08-17 12:12:18 +0300 Timo Sirainen (730b2a449f) lib-fs: Fix fs_stats.copy_count tracking with fs_default_copy() The copy_count could have been decreased too many times with async operations. M src/lib-fs/fs-api-private.h M src/lib-fs/fs-api.c 2021-08-16 15:36:37 +0300 Timo Sirainen (b82faee3cb) global: Add ATTR_UNSIGNED_WRAPS to fix various ubsan issues M src/auth/crypt-blowfish.c M src/lib/numpack.c M src/lib/sha3.c 2021-08-05 18:53:57 +0300 Timo Sirainen (9e80b588f4) global: Fix various ubsan issues M src/lib-mail/istream-header-filter.c M src/lib-mail/test-qp-decoder.c M src/lib-test/test-istream.c M src/lib/test-base64.c M src/lib/test-data-stack.c 2021-08-17 10:59:49 +0300 Timo Sirainen (05189ecdc7) doveadm: Free memory for all loaded mail_plugins at deinit M src/doveadm/doveadm-mail.c 2021-08-17 10:50:34 +0300 Timo Sirainen (654d7b2d11) doveadm pw -l: Free all memory to avoid memory leak complaints M src/doveadm/doveadm-pw.c 2021-08-17 09:30:25 +0200 Timo Sirainen (b997fc957e) doveadm batch: Fix memory leak M src/doveadm/doveadm-mail-batch.c 2021-08-17 11:06:36 +0300 Timo Sirainen (46a511412a) doveadm: Split off doveadm_mail_cmd_deinit() M src/doveadm/doveadm-mail.c M src/doveadm/doveadm-mail.h 2021-05-07 21:15:04 +0300 Timo Sirainen (f708052c5d) doveadm: Make doveadm_mail_cmd_free() public M src/doveadm/doveadm-mail.c M src/doveadm/doveadm-mail.h 2021-08-13 11:08:30 +0100 Siavash Tavakoli (f28482afb8) global: Use consistent lua function names Change lua-style function names to be consistent with dovecot's style. M src/auth/db-lua.c M src/lib-lua/dlua-dovecot.c M src/lib-lua/dlua-error.c M src/lib-lua/dlua-pushstring.c M src/lib-lua/dlua-script-private.h M src/lib-lua/dlua-script.c M src/lib-storage/mail-lua.c M src/lib-storage/mail-storage-lua.c M src/lib-storage/mail-user-lua.c M src/lib-storage/mailbox-lua.c M src/plugins/push-notification/push-notification-driver-lua.c 2021-08-12 19:43:25 +0100 Siavash Tavakoli (e14026e708) lib-lua: test-lua: Fix the test for lua versions later than 5.3 M src/lib-lua/test-lua.c 2021-08-12 19:40:22 +0100 Siavash Tavakoli (72a864b4b0) lib-lua: Add lua_resume_compat() and use it in lua versions prior to 5.4 Starting lua 5.4 "lua_resume()" expects an extra "nresults" argument. Add a compatibility function to handle this argument in earlier versions. M src/lib-lua/dlua-compat.c M src/lib-lua/dlua-compat.h M src/lib-lua/dlua-resume.c 2020-05-24 14:47:18 -0400 Felipe Gasper (2595113387) man: Document command/args destination format to sync/backup. M doc/man/doveadm-sync.1.in 2021-08-16 14:52:50 +0300 Timo Sirainen (e14e68cb0b) lib-compression: istream-lz4 - Fix handling partial header reads Reading assert-crashed if the header was read only partially. Either because the file really was truncated or because parent stream already had fewer bytes buffered. M src/lib-compression/istream-lz4.c M src/lib-compression/test-compression.c 2021-08-16 14:51:29 +0300 Timo Sirainen (d8995452c8) lib-compression: istream-lz4 - Remove redundant check The loop is reached only if ret is 0, so there's no need to check it again. M src/lib-compression/istream-lz4.c 2021-08-16 14:50:10 +0300 Timo Sirainen (eea3b751de) lib-compression: istream-lz4 - Add asserts to make sure parent buffer isn't full The parent buffer's max size would have to be tiny for these to happen. M src/lib-compression/istream-lz4.c 2021-07-01 13:52:29 +0100 Siavash Tavakoli (f38100a5fe) dict: Use dict-init-cache Make use of dict-init-cache for initialization and deinitialization of dicts. M src/dict/dict-connection.c M src/dict/main.c 2021-06-25 14:11:52 +0100 Siavash Tavakoli (222e8d5b55) dict: Add caching mechanism for initializing dicts Add a pool for dict instances. Each dict is refcounted and given a grace period of 30 seconds for deletion. If refcount drops to 0 and no new dict operation uses the instance in that period, it will be freed. A maximum of 10 dicts are kept in the cache. M src/dict/Makefile.am A src/dict/dict-init-cache.c A src/dict/dict-init-cache.h 2021-08-09 00:35:09 +0100 Siavash Tavakoli (f5a2a9a6d8) dict: Add dict_created and dict_destroyed events Inherit from dict.event and emitted at dict initialization/deinit. M src/lib-dict/dict.c 2021-08-15 12:45:12 +0300 Martti Rannanjärvi (fcf23d9919) lib-sasl: test-sasl-client.c - Initialize authid of sasl_empty_set This fixes the compiler warning: test-sasl-client.c:8:1: error: missing initializer for field 'authid' of 'const struct dsasl_client_settings' M src/lib-sasl/test-sasl-client.c 2021-08-15 07:12:42 +0300 Martti Rannanjärvi (0434bd96f7) lib-sasl: oauthbearer - Fix memory leak on auth failure M src/lib-sasl/mech-oauthbearer.c 2021-08-11 09:48:06 +0300 Aki Tuomi (64ab5d866c) lib-sasl: Add unit tests M src/lib-sasl/Makefile.am A src/lib-sasl/test-sasl-client.c 2021-08-11 09:59:05 +0300 Aki Tuomi (5071cfe16c) lib-sasl: Do not crash if password is NULL M src/lib-sasl/dsasl-client.c 2021-08-11 09:47:17 +0300 Aki Tuomi (feba4f0c88) lib-sasl: When setting port, parse value, not key. Broken in 228f1e8d583 M src/lib-sasl/mech-oauthbearer.c 2021-08-11 08:49:44 +0300 Aki Tuomi (902407f7eb) auth: Do not forward empty "master" passdb field M src/auth/auth-request-handler.c 2021-08-11 08:48:29 +0300 Aki Tuomi (f4cf9d6974) login-common: Ignore empty value for "master" passdb extra field M src/login-common/client-common-auth.c 2021-08-10 12:26:14 +0100 Siavash Tavakoli (a0c1fe343e) mail-crypt: Add password confirmation for doveadm cryptokey password command To prevent setting wrong passwords by accident. M src/plugins/mail-crypt/doveadm-mail-crypt.c 2021-08-10 12:23:55 +0100 Siavash Tavakoli (13830767a0) mail-crypt: Fix -O argument type for doveadm cryptokey password command Should be boolean instead of string. M src/plugins/mail-crypt/doveadm-mail-crypt.c 2021-04-28 02:01:14 +0300 Timo Sirainen (ddf224808e) lib-index: Fix "Extension introduction for unknown id" errors after map is generated This happens when: * View is opened * Messages are expunged * View is synced with NOEXPUNGES flag * A new extension is introduced * Index is rotated at least twice * View is again synced with NOEXPUNGES flag * More changes are done to index with the new extension * Once more view is synced with NOEXPUNGES flag The last sync will see changes with the new extension ID, but the view's map doesn't know its ID. M src/lib-index/mail-index-sync-ext.c M src/lib-index/test-mail-index.c 2021-06-24 12:58:58 -0400 Josef 'Jeff' Sipek (710346bcb8) virtual: Expunge old emails if backend box guid changed This introduces a new extensible "ext2" header to make it easier to add new fields in the future. It also allows keeping backwards/forwards compatibility with the old code, so the virtual index isn't rebuilt on upgrades or downgrades. M src/plugins/virtual/virtual-storage.c M src/plugins/virtual/virtual-storage.h M src/plugins/virtual/virtual-sync.c 2021-07-29 12:38:12 +0300 Timo Sirainen (5310858bd0) virtual: Don't use data stack when building extension header Some users may have thousands of mailboxes, which grows the data stack unnecessarily large. M src/plugins/virtual/virtual-sync.c 2021-08-09 13:01:12 +0300 Timo Sirainen (97367ef617) indexer: Fix crash if client disconnects while it's waiting for command reply This happened for example if IMAP SEARCH triggered long fts indexing and the IMAP client disconnected while waiting for the reply. Broken by f62a25849358e40a08a2c47f5bcaa1613a31d076 M src/indexer/indexer-client.c 2021-05-06 11:58:21 +0200 Stephan Bosch (9f5e723974) lib-smtp: smtp-server-cmd-data - Fix global state cleanup upon DATA command destroy. Should cleanup global state only when it belongs to the DATA/BDAT command currently being destroyed. Fixes NULL-dereference in i_stream_read() found by OSS-Fuzz. M src/lib-smtp/smtp-server-cmd-data.c M src/lib-smtp/test-smtp-server-errors.c 2021-08-05 11:38:26 +0200 Stephan Bosch (da1d2332bd) lib-smtp: test-smtp-server-errors - Perform "Bad pipelined DATA" test with actual pipelining. M src/lib-smtp/test-smtp-server-errors.c 2021-08-03 19:47:54 +0300 Timo Sirainen (7f9cfccb54) imap, pop3: Prevent reading ssl_ca setting into memory Especially with imap there can be a lot of processes and a large ssl_ca could be wasting a lot of memory. This was already the old behavior before removing ssl_* settings from lib-storage. M src/imap/main.c M src/lib-master/master-service-settings.c M src/lib-master/master-service-settings.h M src/lib-storage/mail-storage-service.c M src/lib-storage/mail-storage-service.h M src/pop3/main.c 2021-08-03 19:46:59 +0300 Timo Sirainen (4ea4a85607) config: Add exclude= settings to drop specific settings M src/config/config-connection.c M src/config/config-request.c M src/config/config-request.h M src/config/doveconf.c 2021-07-29 18:04:53 +0300 Timo Sirainen (327bd99f84) lib-storage: Remove SSL settings from mail_storage_settings They can be accessed via master_service_ssl_settings instead. M src/lib-master/master-service-ssl-settings.c M src/lib-storage/mail-storage-settings.c M src/lib-storage/mail-storage-settings.h 2021-07-29 18:02:57 +0300 Timo Sirainen (1e5324b580) lib-storage: mail_user_init_ssl_client_settings() - Use master_service_ssl_settings This will allow dropping the duplicate SSL settings handling. M src/lib-storage/mail-storage-service.c M src/lib-storage/mail-user.c 2021-07-29 17:45:16 +0300 Timo Sirainen (4930b1b883) dsync: Get SSL settings via master_service_ssl_settings M src/doveadm/doveadm-dsync.c 2021-07-29 17:44:43 +0300 Timo Sirainen (6fcaffd1e5) lib-storage: Add mail_storage_service_user_get_ssl_settings() M src/lib-storage/mail-storage-service.c M src/lib-storage/mail-storage-service.h 2021-07-29 17:44:25 +0300 Timo Sirainen (aa8cb602eb) lib-master: Add master_service_ssl_settings_get_from_parser() M src/lib-master/master-service-ssl-settings.c M src/lib-master/master-service-ssl-settings.h 2021-07-29 17:57:42 +0300 Timo Sirainen (61a7a9e00e) global: Don't zero SSL settings unnecessarily mail_user_init_ssl_client_settings() and mail_user_init_fs_settings() will clear them again anyway. M src/doveadm/doveadm-settings.c M src/lib-lda/mail-send.c M src/lib-storage/mailbox-list.c M src/lmtp/lmtp-proxy.c M src/plugins/fts-solr/fts-backend-solr-old.c M src/plugins/fts-solr/fts-backend-solr.c M src/plugins/fts/fts-parser-tika.c M src/plugins/push-notification/push-notification-driver-ox.c M src/stats/event-exporter-transport-http-post.c M src/submission/submission-backend-relay.c 2021-07-29 17:58:23 +0300 Timo Sirainen (c59736a995) lib-storage: mail_user_init_fs_settings() - Clarify that ssl settings are fully initialized M src/lib-storage/mail-user.c M src/lib-storage/mail-user.h 2021-07-29 17:57:12 +0300 Timo Sirainen (b8a60edd6a) lib-storage: mail_user_init_ssl_client_settings() - Clarify that ssl settings are fully initialized M src/lib-storage/mail-user.c M src/lib-storage/mail-user.h 2021-07-29 15:31:56 +0300 Timo Sirainen (1b2134e0be) doveadm: Free SSL iostream contexts at deinit This wasn't really a memory leak, because the contexts are always kept allocated until deinit anyway. M src/doveadm/doveadm-mail-server.c 2021-07-29 16:06:50 +0300 Timo Sirainen (48d8cb6b4f) lib-ssl-iostream: ssl_iostream_context_unref(NULL) is a no-op M src/lib-ssl-iostream/iostream-ssl.c 2021-08-07 18:52:09 +0200 Timo Sirainen (c84de300ae) man: doveadm-pw - Fix default scheme to be CRYPT / $2y$ bcrypt M doc/man/doveadm-pw.1.in 2021-07-22 15:31:11 +0300 Timo Sirainen (c5cbbdf177) lib-index: Remove mail_index_transaction_get_highest_modseq() This isn't actually used anywhere, so there's no need to keep it. M src/lib-index/mail-index-transaction-export.c M src/lib-index/mail-index-transaction.c M src/lib-index/mail-index.h M src/lib-index/mail-transaction-log-file.c 2021-07-22 15:28:39 +0300 Timo Sirainen (4ddc389c16) lib-index: mail_index_transaction_get_highest_modseq() - Fix handling MAIL_INDEX_MAIL_FLAG_UPDATE_MODSEQ MAIL_INDEX_MAIL_FLAG_UPDATE_MODSEQ flag updates didn't calculate the returned modseq correctly. This function wasn't used outside --with-devel-checks though, but with it this fixes: Panic: file mail-index-transaction.c: line 212 (mail_index_transaction_commit_real): assertion failed: (t->reset || expected_highest_modseq == log->head->sync_highest_modseq) M src/lib-index/mail-index-transaction-export.c 2021-07-22 14:24:11 +0300 Timo Sirainen (11c6ffa0f6) lib-index: Avoid modseq warnings --with-devel-checks Avoids warnings: Requested highest-modseq for transaction, but modseq tracking isn't enabled for the file (this shouldn't happen) M src/lib-index/mail-index-transaction.c 2021-07-22 14:29:24 +0300 Timo Sirainen (a6548a3b73) director: Avoid calling timeval_diff_msecs() with too great time difference Fixes assert-crash --with-devel-checks: Panic: file time-util.c: line 76 (timeval_diff_msecs): assertion failed: (diff <= INT_MAX) M src/director/director-connection.c 2021-07-14 10:00:28 +0300 Aki Tuomi (5245129f06) lib: data-stack - Initialize alloc_count / alloc_bytes This has only effect with devel checks enabled. Fixes counter values to show sensible data. M src/lib/data-stack.c 2021-07-13 13:41:14 +0300 Aki Tuomi (d74cf4ca2a) lib: data-stack - Allow errno changes when sending event M src/lib/data-stack.c 2021-07-29 22:21:52 +0300 Timo Sirainen (368a96783e) lib-master, global: Remove unnecessary MASTER_SERVICE_FLAG_USE_SSL_SETTINGS SSL client settings are now always read. M src/auth/main.c M src/doveadm/doveadm.c M src/doveadm/main.c M src/lib-master/master-service.h M src/lmtp/main.c M src/login-common/main.c M src/stats/main.c 2021-07-29 22:20:17 +0300 Timo Sirainen (36ff43f1a9) lib-master: Use ssl-server settings only when necessary M src/lib-master/master-service-private.h M src/lib-master/master-service-settings.c M src/lib-master/master-service-ssl-settings.c M src/lib-master/master-service.c 2021-07-29 22:18:56 +0300 Timo Sirainen (a7fb3cce6a) lib-master: Remove unused master_service_is_ssl_module_loaded() M src/lib-master/master-service-private.h M src/lib-master/master-service.c M src/lib-master/master-service.h 2021-07-29 21:45:18 +0300 Timo Sirainen (c6cea57577) lib-master, login-common: Split off master_service_ssl_server_settings M src/config/settings-get.pl M src/lib-master/master-service-settings.c M src/lib-master/master-service-ssl-settings.c M src/lib-master/master-service-ssl-settings.h M src/lib-master/master-service-ssl.c M src/login-common/client-common.c M src/login-common/client-common.h M src/login-common/login-settings.c M src/login-common/login-settings.h M src/login-common/main.c 2021-07-29 21:43:03 +0300 Timo Sirainen (79a210c1f7) lib-master, global: Split master_service_ssl_settings_to_iostream_set() to client/server functions M src/auth/auth-policy.c M src/doveadm/doveadm-settings.c M src/lib-master/master-service-ssl-settings.c M src/lib-master/master-service-ssl-settings.h M src/lmtp/lmtp-proxy.c M src/login-common/client-common.c M src/login-common/login-proxy.c M src/login-common/main.c M src/stats/event-exporter-transport-http-post.c 2021-08-05 17:48:42 +0300 Timo Sirainen (77dd65422c) master: Avoid creating prefork timeout if process_limit is already reached M src/master/service-monitor.c 2021-08-05 17:53:58 +0300 Timo Sirainen (0610336a86) master: Avoid high CPU usage when process_min_avail reaches process_limit process_min_avail handling always created a 0ms timeout to try to create the missing processes. This timeout was supposed to stop when it couldn't launch all the wanted processes, but the check wasn't done right. This ended up causing the timeout to be called rapidly over and over again. M src/master/service-monitor.c 2021-07-22 14:51:05 -0600 Michael M Slusarz (904ee71927) lazy_expunge: Add lazy_expunge_exclude setting This allows mailboxes to be excluded via configuration. M src/plugins/lazy-expunge/lazy-expunge-plugin.c 2021-08-03 17:38:33 +0300 Timo Sirainen (9d02ac2e42) fts: Use mailbox-match-plugin API for fts_autoindex_exclude This doesn't change the functionality, just deduplicates the code. M src/plugins/fts/fts-storage.c M src/plugins/fts/fts-user.c M src/plugins/fts/fts-user.h 2021-08-04 15:50:54 +0300 Timo Sirainen (3eb404aa8c) fts: Always initialize struct fts_user Initializing lib-fts is still optional within it. M src/plugins/fts-lucene/fts-lucene-plugin.c M src/plugins/fts-solr/fts-solr-plugin.c M src/plugins/fts/fts-user.c M src/plugins/fts/fts-user.h 2021-07-22 14:20:25 -0600 Michael M Slusarz (27a98a2d3c) lib-storage: Add mailbox exclusion plugin API Allows mailbox exclusion configuration to be easily added to any plugin. M src/lib-storage/Makefile.am A src/lib-storage/mailbox-match-plugin.c A src/lib-storage/mailbox-match-plugin.h 2021-08-04 19:57:35 +0300 Timo Sirainen (8939c30ce9) master: Fix unfinished "time moved backwards" comment M src/master/main.c 2021-08-04 19:54:29 +0300 Timo Sirainen (0768778bb6) master: Log a warning also about "time moved forwards" This isn't really important to know, but it could help figure out performance problems if it happens a lot. M src/master/main.c 2021-08-04 19:52:14 +0300 Timo Sirainen (24216a4924) lib: ioloop - Handle "time moved forwards" only after 100ms difference Previously this was done after even a single microsecond difference, causing it to happen almost constantly. This was causing performance problems when there were many timeouts that had to be updated. Especially master process could have been spending a lot of time unnecessarily here. Broken by b258137d0e0618ae792e3606071a1715d26f107b M src/lib/ioloop.c 2021-08-04 19:55:36 +0300 Timo Sirainen (87bd288902) lib: ioloop - Fix 0 timeout with kqueue() and select() With these it was waiting for 1 ms instead of 0. Broken by fac27f192d8432c45d360025613f7d432271c5bb M src/lib/ioloop.c 2021-08-04 17:24:00 +0300 Timo Sirainen (1f6aaaeb3c) fts: Fix internal error when fts_index_timeout is set Broken by cf114f90e0ba25c18db846ee582e3a130bd52949 M src/plugins/fts/fts-indexer.c 2021-08-03 16:11:35 +0300 Timo Sirainen (b79d3118e5) acl: Cast enums explicitly to int in sorting function Fixes ubsan complaint: runtime error: unsigned integer overflow: 0 - 4 cannot be represented in type 'unsigned int' M src/plugins/acl/acl-api.c 2021-06-29 22:45:33 +0200 Stephan Bosch (bb6efaa417) lib-program-client: program-client-remote - Fix signed integer arithmetic. Make type cast explicit to gain ubsan approval. Also prevent negative reserve_mod from having unexpected effect. M src/lib-program-client/program-client-remote.c 2021-08-03 11:44:06 +0300 Martti Rannanjärvi (ac769778d1) util: dovecot-sysreport - Fix help to have -o as the short form of --core M src/util/dovecot-sysreport 2021-08-03 10:56:08 +0300 Martti Rannanjärvi (6cbeaf165d) util: dovecot-sysreport - Use only spaces for indentation Stop mixing tabs and spaces. M src/util/dovecot-sysreport 2021-07-27 20:13:24 +0300 Timo Sirainen (23388cf96e) stats: Revert the previous OpenMetrics info type revert The OpenMetrics standard does support "info" type. The original Prometheus format doesn't support it, but our support is for OpenMetrics. They don't even have any overlapping types that could be used for this, so the only other possibility would have been to make this configurable. Reverts 55a519d18fbbb8435854f1fcf2642b908d6fc074 M src/stats/stats-service-openmetrics.c 2021-07-28 16:39:59 +0300 Timo Sirainen (8b80c45ab1) submission-login: Fix compiling error with some older compilers M src/submission-login/submission-proxy.c 2021-07-05 00:37:46 +0200 Stephan Bosch (c096b7fd77) submission-login: submission-proxy - Optionally send XCLIENT LOGIN to backend and skip authentication. This behavior is enabled by returning proxy_noauth from passdb. M src/submission-login/submission-proxy.c 2021-07-19 00:29:23 +0200 Stephan Bosch (f94dd904b8) login-common: Add proxy field proxy_noauth. M src/login-common/client-common-auth.c M src/login-common/client-common.h 2021-07-19 00:24:32 +0200 Stephan Bosch (bdba22fecb) submission-login: submission-proxy - Move submission_proxy_success_reply_sent(). M src/submission-login/submission-proxy.c 2021-05-18 20:18:45 +0300 Timo Sirainen (c5387d7778) dict: Use the dict name as the log prefix Otherwise if there are multiple dicts it may not be obvious which one is causing the errors. M src/dict/dict-connection.c 2021-07-22 11:26:10 +0300 Aki Tuomi (55a519d18f) stats: Revert dovecot build information to untyped data OpenMetrics does not know type 'info', so use 'untyped' instead. Broken in ae678116a79fff609cdf4fb1eb7eb3db2975bf1c M src/stats/stats-service-openmetrics.c 2021-07-21 18:12:36 +0300 Timo Sirainen (bf111f6830) lib-storage: mail_cache_*_fields - Check for invalid header names while parsing config This way the errors are noticed early on. M src/config/settings-get.pl M src/lib-storage/mail-storage-settings.c 2020-04-14 12:24:50 +0300 Timo Sirainen (723d129153) lib-storage: mail_cache_*_fields - Log an error if hdr. isn't valid Mainly verify that it doesn't have accidental UTF-8 characters that aren't easily visible in text editors. M src/lib-storage/index/index-storage.c 2020-04-19 14:03:24 +0300 Timo Sirainen (ecac22474a) lib-mail: Add message_header_name_is_valid() M src/lib-mail/message-header-parser.c M src/lib-mail/message-header-parser.h 2021-07-22 16:38:22 +0300 Timo Sirainen (fafd7ad584) login-proxy: Make sure input line isn't freed too early proxy_parse_line() could free the proxy's istream, which frees the line string. With IMAP the line could have been used as part of the error string passed to login_proxy_failed(), which can free the istream before using the string for logging purposes. This could have resulted in logging a corrupted line or a crash. Broken by e3134289529cec16ade44cefd0fd26594ae40e30 M src/login-common/client-common-auth.c 2021-07-23 14:45:03 +0200 Timo Sirainen (af3e934e33) lib-test: Make sure child processes exit cleanly with SIGTERM It's normal behavior that the parent process kills the child process with SIGTERM. This shouldn't result in the child process dying with SIGTERM, but a clean exit. This was causing http-test-client-errors unit tests to fail somewhat randomly, especially when running them only with 1 CPU. M src/lib-test/test-subprocess.c 2021-07-21 14:06:55 +0300 Aki Tuomi (128bcb85a9) lib-test: Ensure we send signals to regular PIDs only M src/lib-test/test-subprocess.c 2021-07-21 14:05:34 +0300 Aki Tuomi (34bdfdcbc7) lib-test: Update subprocess list after forking Due to a race condition, we could end up killing PID 0 by accident sometimes. M src/lib-test/test-subprocess.c 2021-07-22 11:23:00 +0300 Timo Sirainen (e3e4cd2681) lib: random_fill() - Optimize away memmove() We just need to track the position of how far the random_next buffer has been used. M src/lib/randgen.c 2021-07-05 00:36:36 +0200 Stephan Bosch (82d9013dd3) submission-login: submission-proxy - Send XCLIENT data in multiple commands if line exceeds 512 bytes. When the proxy talks to non-Dovecot software, failures could occur otherwise. Particularly Postfix will fail. M src/submission-login/client.h M src/submission-login/submission-proxy.c 2021-06-19 00:31:19 +0200 Stephan Bosch (12c9ce36a4) submission-login: submission-proxy - Send PROTO and HELO XCLIENT fields. M src/submission-login/submission-proxy.c 2021-06-18 19:32:03 +0200 Stephan Bosch (9127db1a89) submission-login: submission-proxy - Properly send EHLO after XCLIENT. M src/submission-login/client.h M src/submission-login/submission-proxy.c 2021-07-05 23:33:51 +0200 Stephan Bosch (3764af4b42) submission-login: submission-proxy - Reorder XCLIENT fields to match lib-smtp client. M src/submission-login/submission-proxy.c 2021-06-19 00:25:02 +0200 Stephan Bosch (b1e0d63624) submission-login: submission-proxy - Handle EHLO reply in a separate function. M src/submission-login/submission-proxy.c 2021-06-18 23:58:38 +0200 Stephan Bosch (297f39ba26) submission-login: submission-proxy - Move sending STARTTLS to separate function. M src/submission-login/submission-proxy.c 2021-06-18 19:52:33 +0200 Stephan Bosch (bbf725af33) submission-login: submission-proxy - Avoid sending empty XCLIENT FORWARD field. M src/submission-login/submission-proxy.c 2021-06-18 19:31:54 +0200 Stephan Bosch (52516b0566) submission: Separately pass XCLIENT HELO value from pre-login to post-login service. M src/submission-login/client-authenticate.c M src/submission/main.c M src/submission/submission-client.c M src/submission/submission-client.h 2021-06-18 17:02:23 +0200 Stephan Bosch (019522fc34) submission: submission-backend-relay - Use smtp_server_connection_get_proxy_data() for composing client settings. M src/submission/submission-backend-relay.c 2021-06-18 17:46:07 +0200 Stephan Bosch (13f5a8132c) submission: main - Restructure parsing of login input data. Needed for adding additional fields. M src/submission/main.c 2021-06-18 16:43:55 +0200 Stephan Bosch (0c90556d3f) submission-login: client-authenticate - Restructure composition of master_prefix. Needed for later commit. M src/submission-login/client-authenticate.c 2021-06-18 19:27:40 +0200 Stephan Bosch (b33f1b875d) lib-smtp: smtp-server-connection - Record proxied EHLO domain separately. This prevents it from being overriden by a local EHLO command. M src/lib-smtp/smtp-server-connection.c M src/lib-smtp/smtp-server-private.h 2021-06-18 19:02:34 +0200 Stephan Bosch (53cdb6dedd) lib-smtp: smtp-server - Make smtp_server_connection_set_proxy_data() public. M src/lib-smtp/smtp-server-private.h M src/lib-smtp/smtp-server.h 2021-06-18 16:54:51 +0200 Stephan Bosch (5f5f93e962) lib-smtp: smtp-server-connection - Use smtp_server_connection_get_proxy_data() for the conn_proxy_data_updated() callback. Removes code duplication. M src/lib-smtp/smtp-server-connection.c 2021-06-18 16:52:26 +0200 Stephan Bosch (26b64133b2) lib-smtp: smtp-server-connection - Allow username/ehlo to be set before smtp_server_connection_login(). This allows setting the proxy data early. M src/lib-smtp/smtp-server-connection.c 2021-06-18 19:25:43 +0200 Stephan Bosch (0f55dcb0bd) lib-smtp: Reformat smtp-server.h. M src/lib-smtp/smtp-server.h 2021-06-18 16:31:08 +0200 Stephan Bosch (85669603b8) submission: Reformat submission-client.h. M src/submission/submission-client.h 2021-06-18 16:30:52 +0200 Stephan Bosch (cf73c66df0) submission: Reformat submission-client.c. M src/submission/submission-client.c 2021-06-24 00:19:16 +0200 Stephan Bosch (c8bdb4578c) login-common: Add support for recording rawlog of connection between proxy and backend. M src/login-common/client-common-auth.c M src/login-common/login-proxy.c M src/login-common/login-proxy.h M src/login-common/login-settings.c M src/login-common/login-settings.h 2021-07-21 17:14:26 +0300 Timo Sirainen (d757b9af43) doveadm: Mark fs_cmd_help() with ATTR_NORETURN This helps static analyzers understand that the function doesn't return. M src/doveadm/doveadm-fs.c 2021-07-21 17:12:05 +0300 Timo Sirainen (6e7928f5cf) doveadm: Avoid passing NULL to memcpy() even though zero bytes are copied Makes static analyzers happier. M src/doveadm/doveadm.c 2021-07-19 16:38:08 +0300 Timo Sirainen (567d853885) doveadm: Remove dead assignment M src/doveadm/client-connection-tcp.c 2021-04-22 11:09:49 +0300 Timo Sirainen (a7146d0939) lib: Use 32 byte buffer for getting randomness This reduces the number of syscalls when small amount of randomness is requested, like i_rand*() calls using only 4 bytes at a time. M src/lib/randgen.c 2021-06-10 12:16:20 +0300 Timo Sirainen (8d396dda21) doveadm: Remove code related to obsolete doveadm_mail_cmd handling struct doveadm_mail_cmd couldn't be completely removed since v2 mail commands are still converted to it. M src/doveadm/client-connection-tcp.c M src/doveadm/doveadm-mail-batch.c M src/doveadm/doveadm-mail.c M src/doveadm/doveadm-mail.h M src/doveadm/doveadm.c 2021-06-10 12:06:40 +0300 Timo Sirainen (5676c510bf) doveadm sync/backup/dsync-server: Convert to v2 command M src/doveadm/doveadm-dsync.c M src/doveadm/doveadm-dsync.h M src/doveadm/doveadm-mail.c 2021-06-10 11:51:51 +0300 Timo Sirainen (dfe41ddaac) doveadm batch: Convert to v2 command M src/doveadm/doveadm-mail-batch.c M src/doveadm/doveadm-mail.c M src/doveadm/doveadm-mail.h 2021-06-10 01:14:14 +0300 Timo Sirainen (1e48423c17) doveadm: Remove struct doveadm_cmd and related code M src/doveadm/client-connection-tcp.c M src/doveadm/doveadm-cmd.c M src/doveadm/doveadm-cmd.h M src/doveadm/doveadm.c M src/doveadm/doveadm.h M src/doveadm/main.c 2021-06-10 01:09:34 +0300 Timo Sirainen (875a371693) doveadm: Remove doveadm_cmd_ver2.old_cmd M src/doveadm/doveadm-cmd.c M src/doveadm/doveadm-cmd.h 2021-06-10 01:08:16 +0300 Timo Sirainen (058f76650a) doveadm proxy: Convert to v2 commands M src/doveadm/doveadm-proxy.c 2021-06-10 01:03:46 +0300 Timo Sirainen (871adaab1f) doveadm oldstats: Convert to v2 commands M src/doveadm/doveadm-oldstats.c 2021-06-10 00:59:53 +0300 Timo Sirainen (3aef610846) doveadm stop/reload: Convert to v2 commands M src/doveadm/doveadm-master.c 2021-06-10 00:58:45 +0300 Timo Sirainen (59087d1dad) doveadm fs: Convert to v2 commands M src/doveadm/doveadm-fs.c 2021-06-10 00:45:43 +0300 Timo Sirainen (b6e92ea8fb) doveadm auth cache flush: Convert auth-server command to v2 M src/doveadm/doveadm-auth-server.c M src/doveadm/doveadm-auth.c 2021-06-10 00:42:38 +0300 Timo Sirainen (af1d3d37f1) doveadm auth: Convert to v2 commands M src/doveadm/doveadm-auth.c 2021-06-10 00:18:17 +0300 Timo Sirainen (94734b9359) doveadm instance: Convert to v2 commands M src/doveadm/doveadm-instance.c 2021-06-10 00:05:28 +0300 Timo Sirainen (fc0b20f702) doveadm log: Convert to v2 commands M src/doveadm/doveadm-log.c 2021-06-10 00:01:00 +0300 Timo Sirainen (f8290ea73a) doveadm replicator: Convert to v2 commands M src/doveadm/doveadm-replicator.c 2021-06-09 23:48:10 +0300 Timo Sirainen (f1524717c6) doveadm config: Convert to v2 command M src/doveadm/doveadm.c 2021-06-09 23:45:51 +0300 Timo Sirainen (476dc132cb) doveadm exec: Convert to v2 command M src/doveadm/doveadm.c 2021-06-10 14:23:46 +0300 Timo Sirainen (938428f914) doveadm: Add CMD_FLAG_NO_UNORDERED_OPTIONS M src/doveadm/doveadm-cmd.c M src/doveadm/doveadm-cmd.h 2021-06-09 23:44:29 +0300 Timo Sirainen (8b461f612c) doveadm: Add CMD_FLAG_NO_OPTIONS This allows command to process all parameters, including parameters starting with "-". M src/doveadm/doveadm-cmd.c M src/doveadm/doveadm-cmd.h 2021-06-09 23:39:54 +0300 Timo Sirainen (b086c1a88b) doveadm: Split off doveadm_cmd_process_options() M src/doveadm/doveadm-cmd.c 2021-06-09 23:37:19 +0300 Timo Sirainen (087ec4374b) doveadm: Reformat doveadm-cmd.c M src/doveadm/doveadm-cmd.c 2021-06-09 23:21:27 +0300 Timo Sirainen (9f305a24c5) doveadm help: Convert to v2 command M src/doveadm/doveadm.c 2021-06-09 23:13:30 +0300 Timo Sirainen (7b67742aa7) doveadm dump: Convert to v2 command M src/doveadm/doveadm-cmd.h M src/doveadm/doveadm-dump.c M src/doveadm/doveadm.c 2021-06-09 23:10:08 +0300 Timo Sirainen (4a508ba07a) doveadm dump: Change doveadm_cmd_dump.cmd() API to be simpler M src/doveadm/doveadm-dump-dbox.c M src/doveadm/doveadm-dump-dcrypt-file.c M src/doveadm/doveadm-dump-dcrypt-key.c M src/doveadm/doveadm-dump-index.c M src/doveadm/doveadm-dump-log.c M src/doveadm/doveadm-dump-mailboxlog.c M src/doveadm/doveadm-dump-thread.c M src/doveadm/doveadm-dump.c M src/doveadm/doveadm-dump.h M src/doveadm/doveadm-zlib.c M src/plugins/fts-lucene/doveadm-fts-lucene.c M src/plugins/fts/doveadm-dump-fts-expunge-log.c 2021-06-09 23:02:36 +0300 Timo Sirainen (ced5df32b5) doveadm pw: Convert to v2 command M src/doveadm/doveadm-cmd.h M src/doveadm/doveadm-pw.c M src/doveadm/doveadm.c 2021-06-09 22:55:55 +0300 Timo Sirainen (cfe3a83df7) doveadm mailbox mutf7: Convert to v2 command M src/doveadm/doveadm-cmd.c M src/doveadm/doveadm-cmd.h M src/doveadm/doveadm-mutf7.c 2021-06-09 22:47:35 +0300 Timo Sirainen (07ba60c061) doveadm sis deduplicate/find: Convert to v2 command M src/doveadm/doveadm-cmd.c M src/doveadm/doveadm-cmd.h M src/doveadm/doveadm-sis.c 2021-06-09 22:42:54 +0300 Timo Sirainen (11439a8366) doveadm zlibconnect: Convert to v2 command M src/doveadm/doveadm-cmd.h M src/doveadm/doveadm-zlib.c M src/doveadm/doveadm.c 2021-06-09 22:39:55 +0300 Timo Sirainen (580b696a1f) doveadm: Code cleanup - Add doveadm_cmdline_commands_ver2[] M src/doveadm/doveadm.c 2021-06-10 16:56:06 +0300 Timo Sirainen (3d52021b2d) doveadm: Support building ARRAY type mail command parameters M src/doveadm/doveadm-mail.c 2021-06-10 16:55:04 +0300 Timo Sirainen (5dc7039807) doveadm: Fix building IP/INT64 type mail command parameters M src/doveadm/doveadm-mail.c 2021-06-10 16:51:58 +0300 Timo Sirainen (ce9ac4a9cc) doveadm: Split off doveadm_cmd_parse_arg() M src/doveadm/doveadm-mail.c 2020-12-03 19:20:32 +0200 Timo Sirainen (6477f9be35) lib: Fix assert-crash when destroying ioloop that has active context Normally the ioloop shouldn't have an active context at deinit, but it seems to be possible in some situations. It's not really bad anyway, so just allow it. Fixes: Panic: file ioloop.c: line 928 (io_loop_destroy): assertion failed: (ioloop->cur_ctx == NULL) M src/lib/ioloop.c M src/lib/test-ioloop.c 2021-07-19 14:56:47 +0300 Timo Sirainen (eac71a2968) lib-mail: Fix memory leak in istream-header-filter Broken by 1c1b77dbf9a548aac788efb76973ce2d0fa6c732 M src/lib-mail/istream-header-filter.c 2021-07-19 13:54:24 +0300 Timo Sirainen (5bd95c2ba9) lib: data-stack - t_try_realloc() - Add missing data_stack_last_buffer_reset() call This fixes incorrect "buffer overflow" panics with DEBUG builds. M src/lib/data-stack.c 2021-07-19 13:52:58 +0300 Timo Sirainen (7dedc453ca) lib: data-stack - data_stack_last_buffer_reset(() - Add comments and an assert This clarifies how the function is expected to work. M src/lib/data-stack.c 2021-07-12 14:26:38 +0200 Markus Valentin (4fdb040d24) lib-storage: Use escaped name length to calculate truncation margin This fixes corruption of mailbox names when the storage_name_escape_char has been part of the parent folder name. Broken by 5dd81d83d8d9120ed2a74d5bd2aa62622885b49c M src/lib-storage/list/mailbox-list-index-iter.c 2021-07-12 13:40:58 +0300 Aki Tuomi (14ad268aa1) lib-lua: Fix LIBDICT_LUA variable usage It needs to be appended to, not set again. Broken by 3d0b7e9bb59e3dc41fd5a4d09832eedea7a92933. M src/lib-lua/Makefile.am 2021-07-08 12:24:47 +0300 Aki Tuomi (3d0b7e9bb5) lib-lua: Only link libdict_lua if it's available M src/lib-lua/Makefile.am 2021-07-08 11:10:38 +0300 Aki Tuomi (b4827bc2f2) plugins/fts: Restore fts_indexer_cmd It was removed in cf114f90e0ba25c18db846ee582e3a130bd52949 and that broke some FTS plugins. M src/plugins/fts/fts-indexer.c 2021-06-22 13:28:34 +0200 Timo Sirainen (3bac871aea) lib-dict: Fix linking when building without Lua Linking didn't work on some non-Linux OSes (non-GNU linkers?) M src/lib-dict/Makefile.am 2021-06-04 11:16:53 +0300 Timo Sirainen (b0a354f7a9) lib-compression: istream-zstd - Make sure parent stream error isn't overwritten This could have happened if the parent istream failed before the zstd header was read. Practically this didn't happen currently, because the initial parent stream error was normally already handled by istream-decompress before istream-zstd was even called. M src/lib-compression/istream-zstd.c 2021-06-04 11:16:22 +0300 Timo Sirainen (8e3a7d9a50) lib-compression: istream-zlib - Fix parent stream error handling near EOF This happened when gz stream (including trailer) was fully read, but the final check to see if there is a concatenated gz stream afterwards failed due to parent istream failure. In this case the error was ignored and istream returned success, truncating any potential concatenated istream input. This situation was very unlikely to happen. M src/lib-compression/istream-zlib.c 2021-05-27 19:34:50 +0300 Timo Sirainen (1c1b77dbf9) lib-mail: Fix istream-header-filter snapshotting M src/lib-mail/istream-header-filter.c M src/lib-mail/test-istream-header-filter.c 2021-06-17 19:55:56 +0300 Timo Sirainen (25e0619c01) lib: Add istream_snapshot.free() to allow more complex snapshots M src/lib/istream-private.h M src/lib/istream.c 2021-06-15 12:21:22 +0200 Markus Valentin (f8c0c372a9) lib-storage: Make use of MAIL_INDEX_VIEW_SYNC_FLAG_2ND_INDEX M src/lib-storage/index/index-sync-pvt.c 2021-06-15 12:19:00 +0200 Markus Valentin (1d9b391105) lib-index: Introduce MAIL_INDEX_VIEW_SYNC_FLAG_2ND_INDEX This flag is used to make sure secondary views flags-index can work properly without emitting warnings about inconsistency. If an inconsistency is encountered fix it by fully syncing. M src/lib-index/mail-index-view-sync.c M src/lib-index/mail-index.h 2021-06-15 08:59:17 +0200 Markus Valentin (c1f2323e15) Revert "lib-storage: Always fix inconsistency when syncing private flags index" This reverts commit 986d9cbbecffd836d977b6ad956b04e3ca606677. This is reverted because storing flags on private indexes no longer send untagged replies. M src/lib-storage/index/index-sync-private.h M src/lib-storage/index/index-sync-pvt.c M src/lib-storage/index/index-sync.c M src/lib-storage/index/index-transaction.c 2021-07-01 10:46:05 +0200 Markus Valentin (9183e2b3af) acl: Ignore acls in acl_lookup_dict_rebuild_add_backend if ignore_acls is set In case an namespace has been configured to ignore ACLs also respect that when acl_lookup_dict_rebuild is called. Co-Authored-By: Vincent Brillault M src/plugins/acl/acl-lookup-dict.c 2021-06-02 00:40:19 +0200 Stephan Bosch (357ff0b35b) lib-smtp: test-smtp-payload - Set all timeouts to CLIENT_PROGRESS_TIMEOUT. This prevents connect and idle timeouts from triggering earlier than the progress timeout. M src/lib-smtp/test-smtp-payload.c 2021-06-22 11:52:02 -0600 Michael M Slusarz (c5edbe6007) imap: PREVIEW responses need trailing space 2.3.15 regression Before 2.3.15, there was this same buggy behavior in error cases; 2.3.15 moved that buggy behavior to the success code path DOP-2463 M src/imap/imap-fetch-body.c 2021-06-14 23:46:48 +0300 Timo Sirainen (5fbff5f80d) doveadm-server: Add log prefix to logs written to client M src/doveadm/client-connection-tcp.c 2021-06-14 23:43:11 +0300 Timo Sirainen (8f2033be24) doveadm-server: Simplify writing log output to client M src/doveadm/client-connection-tcp.c 2021-06-14 20:14:13 +0200 Timo Sirainen (c4acd0ce0e) lib: Fix log prefix in internal handler when log handler has been overridden Adds back mail_log_prefix to doveadm mail commands when doveadm-server was accessed via TCP. Originally broken by c9dd53f7180a78668cbc1e6eb34d5b1722beccb9 M src/lib/failures.c 2021-06-04 23:00:21 +0100 Siavash Tavakoli (60cbb2959c) dict-file: Make sure home_dir doesn't change during operations file_dict is initialized for a specific user. Keep record of the user's home_dir and check for all dict operations that the user did not change. M src/lib-dict/dict-file.c 2021-06-02 16:17:22 +0100 Siavash Tavakoli (ebc92f1ba7) global: Remove dict_settings.home_dir Allows dict to be shared across users. Dict operations use dict_op_settings.home_dir if set. M src/lib-dict/dict-file.c M src/lib-dict/dict.h M src/lib-storage/index/index-attribute.c M src/plugins/last-login/last-login-plugin.c M src/plugins/notify-status/notify-status-plugin.c M src/plugins/quota-clone/quota-clone-plugin.c M src/plugins/quota/quota-dict.c M src/plugins/quota/quota.c 2021-05-26 15:18:20 +0100 Siavash Tavakoli (bdcdd37fb0) dict: Split protocol command arguments in dict_command_input() Instead of duplicating code and splitting in each command functions separately. M src/dict/dict-commands.c 2021-05-26 01:41:51 +0100 Siavash Tavakoli (e222a33dc1) lib-dict: Make sure username is valid as well when checking key prefix If this is a private key, username must be non-empty. M src/lib-dict/dict.c 2021-05-24 12:54:58 +0100 Siavash Tavakoli (4c15dc4ede) dict: Remove dict_connection.username and dict_settings.username - dict should be user agnostic. dict operations have username. - same for dict connection - also removes username from dict process' log prefix M src/auth/db-dict.c M src/auth/db-oauth2.c M src/dict/dict-connection.c M src/dict/dict-connection.h M src/doveadm/doveadm-dict.c M src/lib-dict-backend/test-dict-sql.c M src/lib-dict-extra/dict-fs.c M src/lib-dict-extra/test-dict-fs.c M src/lib-dict/dict.c M src/lib-dict/dict.h M src/lib-dict/test-dict-client.c M src/lib-fs/fs-dict.c M src/lib-oauth2/test-oauth2-jwt.c M src/lib-storage/index/index-attribute.c M src/plugins/acl/acl-lookup-dict.c M src/plugins/last-login/last-login-plugin.c M src/plugins/notify-status/notify-status-plugin.c M src/plugins/quota-clone/quota-clone-plugin.c M src/plugins/quota/quota-dict.c M src/plugins/quota/quota.c 2021-06-03 19:59:23 +0100 Siavash Tavakoli (037442cde7) dict: Add username field for command events To prepare for connection username removal in next commit. Instead of adding username field for the parent event, add it in command events. Commands can now be run for different users. Having the same username field as the one used in initialization can be wrong. M src/dict/dict-commands.c M src/dict/dict-connection.c 2021-05-24 11:47:15 +0100 Siavash Tavakoli (a9e6e57a73) dict-client: Do not send username in initial handshake Dict commands that need username have it included in their arguments now. M src/lib-dict/dict-client.c 2021-05-24 11:58:44 +0100 Siavash Tavakoli (2af85d6cbc) dict-fs: Remove unused fs_dict.username M src/lib-dict-extra/dict-fs.c 2021-05-24 11:58:02 +0100 Siavash Tavakoli (88636cd5a1) dict-redis: Remove unused redis_dict.username M src/lib-dict/dict-redis.c 2021-05-24 11:57:18 +0100 Siavash Tavakoli (f7da270894) dict-memcached-ascii: Remove unused memcached_ascii_dict.username M src/lib-dict/dict-memcached-ascii.c 2021-05-24 11:56:29 +0100 Siavash Tavakoli (e2a74dab49) dict-sql: Remove unused sql_dict.username M src/lib-dict-backend/dict-sql-private.h M src/lib-dict-backend/dict-sql.c 2021-05-24 11:54:56 +0100 Siavash Tavakoli (38ae540aa5) dict-ldap: Remove unused ldap_dict.username M src/lib-dict-backend/dict-ldap.c 2021-06-03 21:27:31 +0100 Siavash Tavakoli (6c94259f8f) dict: Add dict_event_create Helper function for dict events. If dict_op_settings has username set, adds it as a field. M src/lib-dict/dict.c 2021-06-03 21:18:03 +0100 Siavash Tavakoli (843cb951df) dict-client: Send username in commands Lookup, iterate_begin, and transaction_begin need username. This bumps dict protocol's major version to 3. M src/lib-dict/dict-client.c M src/lib-dict/dict-client.h 2021-06-03 21:16:22 +0100 Siavash Tavakoli (bb6c727856) dict-redis: Use dict_op_settings to get full key Switch from dict.username to dict_op_settings.username. Also, ensure that username is escaped. M src/lib-dict/dict-redis.c 2021-06-03 21:14:51 +0100 Siavash Tavakoli (3d78c522f7) dict-memcached-ascii: Use dict_op_settings to get full key Switch from dict.username to dict_op_settings.username. M src/lib-dict/dict-memcached-ascii.c 2021-06-03 21:12:27 +0100 Siavash Tavakoli (f4d43cf907) dict-fs: Use dict_op_settings to get full key Switch from dict.username to dict_op_settings.username. M src/lib-dict-extra/dict-fs.c 2021-06-03 20:58:05 +0100 Siavash Tavakoli (6ed788ca21) dict: Use dict_op_settings in backends - Use dict_op_settings in dict API functions - forward the settings object to backends for dict lookup/iterate - Update backends to use dict_op_settings M src/lib-dict-backend/dict-cdb.c M src/lib-dict-backend/dict-ldap.c M src/lib-dict-backend/dict-sql.c M src/lib-dict-extra/dict-fs.c M src/lib-dict/dict-client.c M src/lib-dict/dict-fail.c M src/lib-dict/dict-file.c M src/lib-dict/dict-memcached-ascii.c M src/lib-dict/dict-memcached.c M src/lib-dict/dict-private.h M src/lib-dict/dict-redis.c M src/lib-dict/dict.c 2021-06-03 18:31:57 +0100 Siavash Tavakoli (8d69e81674) notify-status: Initialize dict_op_settings for dict operations M src/plugins/notify-status/notify-status-plugin.c 2021-06-03 18:32:50 +0100 Siavash Tavakoli (b87665654f) last-login: Initialize dict_op_settings for dict operations M src/plugins/last-login/last-login-plugin.c 2021-06-03 18:30:17 +0100 Siavash Tavakoli (88f5f42541) quota: Initialize dict_op_settings for dict operations M src/plugins/quota-clone/quota-clone-plugin.c M src/plugins/quota/quota-dict.c M src/plugins/quota/quota.c 2021-06-03 19:32:26 +0100 Siavash Tavakoli (42052d71f3) dict: Initialize dict_op_settings for dict operations M src/dict/dict-commands.c 2021-06-03 18:33:21 +0100 Siavash Tavakoli (b70da6c60b) acl: Initialize dict_op_settings for dict lookup M src/plugins/acl/acl-lookup-dict.c 2021-06-03 18:34:26 +0100 Siavash Tavakoli (737e107ef7) lib-oauth2: Initialize dict_op_settings for dict operations M src/lib-oauth2/oauth2-jwt.c M src/lib-oauth2/test-oauth2-jwt.c 2021-06-03 18:41:14 +0100 Siavash Tavakoli (683c314667) lib-dict: lua: Initialize dict_op_settings for dict operations - Add new mandatory argument for lookup, set, and transaction_begin. - Use the username to initialize dict_op_settings passed to lib-dict API M src/lib-dict/dict-iter-lua.c M src/lib-dict/dict-lua.c M src/lib-dict/dict-txn-lua.c 2021-07-01 20:39:41 +0100 Siavash Tavakoli (b3ab76ff1d) lib-dict-extra: test-dict-fs: Initialize dict_op_settings for dict operations M src/lib-dict-extra/test-dict-fs.c 2021-06-03 18:39:39 +0100 Siavash Tavakoli (b150ee039c) lib-dict-backend: test-dict-sql: Initialize dict_op_settings for dict operations M src/lib-dict-backend/test-dict-sql.c 2021-06-03 18:38:50 +0100 Siavash Tavakoli (051d8cbe36) lib-dict: test-dict-client: Initialize dict_op_settings for dict operations M src/lib-dict/test-dict-client.c 2021-06-03 18:36:04 +0100 Siavash Tavakoli (7fce91db18) lib-storage: Initialize dict_op_settings for dict operations M src/lib-storage/index/index-attribute.c 2021-06-03 18:35:28 +0100 Siavash Tavakoli (f2083c0b5c) lib-fs: Initialize dict_op_settings for dict operations M src/lib-fs/fs-dict.c 2021-06-03 18:13:31 +0100 Siavash Tavakoli (11046766af) auth: userdb-dict: Initialize dict_op_settings for dict iterate M src/auth/userdb-dict.c 2021-06-03 18:11:47 +0100 Siavash Tavakoli (09e89ca08a) auth: db-dict: Initialize dict_op_settings for dict lookup M src/auth/db-dict.c 2021-06-03 12:53:08 +0100 Siavash Tavakoli (8ec65b7e0c) doveadm dict: Initialize & use dict_op_settings for dict commands Sets the username in cmd_dict_init_full and use the settings struct for dict operations. M src/doveadm/doveadm-dict.c 2021-06-03 00:06:44 +0100 Siavash Tavakoli (64719ad090) lib-storage: Add mail_user.dict_op_set and mail_user_get_dict_op_settings() Used to initialize or obtain dict_op_settings for the user. M src/lib-storage/mail-user.c M src/lib-storage/mail-user.h 2021-06-04 15:39:05 +0100 Siavash Tavakoli (aceb659c98) lib-storage: mail-user: Clarify mail_user_get_home() usage string Explicitly comment about returned string lifetime. M src/lib-storage/mail-user.h 2021-05-18 17:52:55 +0100 Siavash Tavakoli (5b579636a4) dict: Optionally accept username in lookup/iterate/begin dict protocol commands Only an optional field, don't actually use it. M src/dict/dict-commands.c 2021-05-28 11:57:39 +0100 Siavash Tavakoli (f976f4ac89) dict-file: Remove file_dict_iterate_path struct No need for the struct since support for multi-path iterate is removed. So path and path length can be merged with file_dict_iterate_context. M src/lib-dict/dict-file.c 2021-05-26 13:47:50 +0100 Siavash Tavakoli (32e8bd5b5a) dict backends: Remove multi-path handling code in dict iteration With mutli-path iteration support being dropped from dict protocol, these can be cleaned up. M src/lib-dict-backend/dict-cdb.c M src/lib-dict-backend/dict-sql.c M src/lib-dict-extra/dict-fs.c M src/lib-dict/dict-client.c M src/lib-dict/dict-fail.c M src/lib-dict/dict-file.c M src/lib-dict/dict-private.h M src/lib-dict/dict.c 2021-05-26 12:15:06 +0100 Siavash Tavakoli (cbc81b4471) dict: Drop support for multi-path iteration in dict protocol Remove dict_iterate_init_multiple() since it is not used anywhere. Also drop support in dict protocol to read multiple paths. M src/dict/dict-commands.c M src/lib-dict/dict.c M src/lib-dict/dict.h 2021-05-18 01:50:03 +0100 Siavash Tavakoli (ecc4985151) lib-dict: Add dict_op_settings_dup() and dict_op_settings_private_free() - dict_op_settings_dup() creates a copy of dict_op_settings into a new struct dict_dop_settings_private. - dict_op_settings_private_free() frees the memory for copied object. M src/lib-dict/dict-private.h M src/lib-dict/dict.c 2021-05-03 15:09:49 +0100 Siavash Tavakoli (4aeba6af64) lib-dict: Add dict_op_settings parameter for dict_iterate_init() Only adds the parameter, doesn't use it. M src/auth/userdb-dict.c M src/doveadm/doveadm-dict.c M src/lib-dict-backend/test-dict-sql.c M src/lib-dict/dict-iter-lua.c M src/lib-dict/dict.c M src/lib-dict/dict.h M src/lib-dict/test-dict-client.c M src/lib-fs/fs-dict.c M src/lib-storage/index/index-attribute.c M src/plugins/acl/acl-lookup-dict.c 2021-05-03 15:09:01 +0100 Siavash Tavakoli (8c0a16627e) lib-dict: Add dict_op_settings parameter for dict_transaction_begin() Only adds the parameter, doesn't use it. M src/dict/dict-commands.c M src/doveadm/doveadm-dict.c M src/lib-dict-backend/test-dict-sql.c M src/lib-dict-extra/test-dict-fs.c M src/lib-dict/dict-txn-lua.c M src/lib-dict/dict.c M src/lib-dict/dict.h M src/lib-dict/test-dict-client.c M src/lib-fs/fs-dict.c M src/lib-oauth2/test-oauth2-jwt.c M src/lib-storage/index/index-attribute.c M src/plugins/acl/acl-lookup-dict.c M src/plugins/last-login/last-login-plugin.c M src/plugins/notify-status/notify-status-plugin.c M src/plugins/quota-clone/quota-clone-plugin.c M src/plugins/quota/quota-dict.c M src/plugins/quota/quota.c 2021-05-03 13:42:56 +0100 Siavash Tavakoli (c840870249) lib-dict: Add dict_op_settings Used for dict operations. Currently username & home_dir are used. Also, change dict_lookup() to accept a parameter of this type but don't actually use it. M src/auth/db-dict.c M src/dict/dict-commands.c M src/doveadm/doveadm-dict.c M src/lib-dict-backend/test-dict-sql.c M src/lib-dict-extra/test-dict-fs.c M src/lib-dict/dict-client.c M src/lib-dict/dict-lua.c M src/lib-dict/dict.c M src/lib-dict/dict.h M src/lib-dict/test-dict-client.c M src/lib-fs/fs-dict.c M src/lib-oauth2/oauth2-jwt.c M src/lib-storage/index/index-attribute.c M src/plugins/quota/quota-dict.c 2021-05-03 12:15:54 +0100 Siavash Tavakoli (53fa6616c5) lib-dict: Remove dict_settings.value_type It was originally added to dict-db and no other backend uses it. With dict-db removed, there is no need to keep it. M src/auth/db-oauth2.c M src/dict/dict-connection.c M src/lib-dict/dict-client.c M src/lib-dict/dict.h M src/lib-oauth2/test-oauth2-jwt.c 2021-05-12 12:54:30 +0100 Siavash Tavakoli (08fee75254) dict-client: Escape username and dict uri in handshake HELLO message M src/lib-dict/dict-client.c 2021-04-30 14:42:46 +0100 Siavash Tavakoli (d5acb577c9) lib-dict-backen: Drop unused dict-db M src/lib-dict-backend/Makefile.am D src/lib-dict-backend/dict-db.c 2021-06-24 12:56:05 -0400 Josef 'Jeff' Sipek (5a7c7869c7) virtual: Expunge old emails if backend box uidvalidity changed M src/plugins/virtual/virtual-storage.h M src/plugins/virtual/virtual-sync.c 2021-06-14 23:28:48 +0300 Timo Sirainen (9ea5d36197) doveadm-server: Don't return two error lines if a command fails This normally didn't affect doveadm client usage, but it did break reply matching when multiple usernames were handled by a single command (e.g. wildcard users). M src/doveadm/client-connection-tcp.c 2020-12-10 10:44:42 +0200 Timo Sirainen (e4ab282d56) lib-http: test-http-client-errors - Don't rely on sleeps Use the notification signal API instead. Also it's only one test (group) that needs to do this. M src/lib-http/test-http-client-errors.c 2021-06-18 14:19:36 +0300 Timo Sirainen (ec04bc903e) lib-test: Add notification signal send/wait API This allows a simple way for child/parent processes to communicate when they're ready. SIGHUP signal is reserved for this. M src/lib-test/test-subprocess.c M src/lib-test/test-subprocess.h 2020-12-10 10:54:25 +0200 Timo Sirainen (6192e2a196) doveadm batch: Fix assert-crash that happened when it was attempted to be used Fixes: Panic: file mail-storage.c: line 1067 (mailbox_set_reason): assertion failed: (reason != NULL) M src/doveadm/doveadm-mail-batch.c 2021-06-25 14:52:11 +0200 Markus Valentin (d2d021efe0) lib-fs: metawrap - Fix handling empty file As empty files are already closed when fs-metawrap attempts to append metadata there have been problems with size calculation. Fix this by relying on the same mechanism as if metadata changed during write. This recreates metadata and keeps old body. This fixes an issue when writing empty mails to cache (failed: Cached message size larger than expected). This was introduced by 03e102ddccaae9e944c503d4269de755731798e8a M src/lib-fs/fs-metawrap.c 2021-06-25 14:28:57 +0200 Markus Valentin (cab617276a) lib-fs: fs-metawrap - Expect fs_stat to return size 0 for empty file M src/lib-fs/test-fs-metawrap.c 2021-06-14 12:47:15 +0300 Timo Sirainen (f0256e3d60) NEWS: Updates for v2.3.15 M NEWS 2021-05-24 14:03:57 +0300 Aki Tuomi (7ad5753566) NEWS: Add news for 2.3.14.1 M NEWS 2021-05-22 00:16:38 +0200 Stephan Bosch (bcdbf445a9) lib-smtp: smtp-server-connection - Fix STARTTLS command injection vulnerability. The input handler kept reading more commands even though the input was locked by the STARTTLS command, thereby causing it to read the command pipelined beyond STARTTLS. This causes a STARTTLS command injection vulerability. M src/lib-smtp/smtp-server-cmd-starttls.c M src/lib-smtp/smtp-server-connection.c 2021-06-08 09:13:25 +0300 Aki Tuomi (9b04e6fbfb) lib-dict-extra: dict-fs - Escape unsafe paths Change any path components that are `.` or `..` to `...` and `....`. Prevents path traversal attacks. M src/lib-dict-extra/Makefile.am M src/lib-dict-extra/dict-fs.c A src/lib-dict-extra/test-dict-fs.c 2021-06-08 09:04:21 +0300 Aki Tuomi (15682a20d5) lib-oauth2: Do not escape '.' This is not really needed and just makes things difficult. M src/lib-oauth2/oauth2-jwt.c M src/lib-oauth2/test-oauth2-jwt.c 2021-05-03 09:58:29 +0300 Aki Tuomi (368adea6d9) lib-oauth2: Add missing test_begin/test_end to token escape M src/lib-oauth2/test-oauth2-jwt.c 2021-04-14 19:17:30 +0300 Aki Tuomi (dde02b27df) lib-oauth2: test-oauth2-jwt - Fix linkage for openssl Without whole archive option ssl_iostream_unref isn't included in linkage, which will prevent libdcrypt from loading openssl backend. M src/lib-oauth2/Makefile.am 2020-11-19 19:55:42 +0200 Aki Tuomi (137558d31c) lib-oauth2: Ensure azp is escaped too M src/lib-oauth2/oauth2-jwt.c M src/lib-oauth2/test-oauth2-jwt.c 2021-04-14 13:47:16 +0300 Aki Tuomi (cf8f670629) lib-oauth2: Add test for token escape M src/lib-oauth2/test-oauth2-jwt.c 2021-04-14 14:12:16 +0300 Aki Tuomi (8b716828c4) lib-oauth2: Improve identifier escaping function M src/lib-oauth2/oauth2-jwt.c 2021-04-10 17:54:45 +0300 Aki Tuomi (1db66e3950) lib-oauth2: Move identifier escaping to own function M src/lib-oauth2/oauth2-jwt.c 2021-03-25 15:36:49 +0200 Timo Sirainen (fa92b1a362) lib-storage: Sync mailbox if autoexpunging finds mails that are already expunged The syncing should remove the mails from the index. M src/lib-storage/mail-autoexpunge.c 2021-03-25 15:34:14 +0200 Timo Sirainen (0e8844adc3) lib-storage: Fix infinite loop in autoexpunging if the mails are already expunged This happens if the mails exist in the index, but mail_get_save_date() fails with MAIL_ERROR_EXPUNGED. M src/lib-storage/mail-autoexpunge.c 2021-05-31 14:48:42 +0300 Aki Tuomi (8609b88e86) plugins/fts: Use event logging M src/plugins/fts/fts-indexer.c 2021-05-26 13:55:52 +0300 Aki Tuomi (cf114f90e0) plugins/fts: fts-indexer - Use connection.c functions M src/plugins/fts/fts-indexer.c 2021-05-31 19:31:35 +0300 Aki Tuomi (43d18b2d3f) plugins/fts: fts-indexer - Move fts_indexer_init to end of file Simplifies next commit M src/plugins/fts/fts-indexer.c 2021-05-26 13:54:56 +0300 Aki Tuomi (1510536887) plugins/fts: fts-indexer - Use connection structures M src/plugins/fts/fts-indexer.c 2021-05-06 14:55:55 +0300 Aki Tuomi (b832f6c3c1) indexer: worker - Fix busy/free status Determining whether worker is free or not should be determined using worker_connection_is_busy, not whether there are connections in the list. A worker connection is busy when it has a request. M src/indexer/indexer.c M src/indexer/worker-pool.c 2021-05-06 12:54:15 +0300 Aki Tuomi (f62a258493) indexer: indexer-client - Use connection.c functions M src/indexer/indexer-client.c M src/indexer/indexer-client.h M src/indexer/indexer.c 2021-05-06 12:41:39 +0300 Aki Tuomi (0273caf1b9) indexer: indexer-client - Use connection structure M src/indexer/indexer-client.c 2021-05-06 12:08:39 +0300 Aki Tuomi (0dfa2531ae) indexer: indexer-worker - Use event logging M src/indexer/master-connection.c 2021-05-06 12:03:16 +0300 Aki Tuomi (bf42ae1ae7) indexer: indexer-worker: Use connection.c functions M src/indexer/indexer-worker.c M src/indexer/master-connection.c M src/indexer/master-connection.h 2021-05-06 11:42:37 +0300 Aki Tuomi (2f5494df0a) indexer: indexer-worker: Use connection structure M src/indexer/master-connection.c 2021-05-06 11:21:43 +0300 Aki Tuomi (990b69f195) indexer: worker-connection - Use connection.c functions M src/indexer/worker-connection.c M src/indexer/worker-connection.h M src/indexer/worker-pool.c 2021-05-06 10:59:24 +0300 Aki Tuomi (1ed0c8be75) indexer: worker-connection - Prepare for using connection.c M src/indexer/worker-connection.c M src/indexer/worker-connection.h M src/indexer/worker-pool.c 2021-05-06 10:56:40 +0300 Aki Tuomi (57317458ce) indexer: worker-pool - Use connection_list M src/indexer/worker-pool.c 2021-05-06 10:49:23 +0300 Aki Tuomi (61f8942012) indexer: worker-pool - Remove unused last_use M src/indexer/worker-pool.c 2021-05-06 10:29:23 +0300 Aki Tuomi (4225108434) indexer: worker-connection - Use connection.h structures M src/indexer/indexer.c M src/indexer/worker-connection.c M src/indexer/worker-connection.h M src/indexer/worker-pool.c M src/indexer/worker-pool.h 2021-05-06 10:11:54 +0300 Aki Tuomi (d76761698a) indexer: worker-connection - Move constructor further down Simplifies next commit M src/indexer/worker-connection.c 2021-05-06 10:11:24 +0300 Aki Tuomi (9aadd7fa03) Reformat worker-connection.c M src/indexer/worker-connection.c 2021-05-25 10:38:46 +0300 Aki Tuomi (7fcf330135) lib: lib-event - Copy ru_last when making passthrough event Otherwise user_cpu_usecs does not get added to the sent events. M src/lib/lib-event.c M src/lib/lib-event.h 2021-05-06 14:29:03 +0300 Aki Tuomi (da607df02a) master: Fix idle-kill for processes with a single short-lived client lib-master sends unimportant service status updates to master only once per second when client_limit>1, because within that 1 second the available client count may have already changed many times. Normally this is fine, but there's a problem with the initial client: * The client connection launches a new process * The process sends the initial status notification with available_count=MAX * The client connection is handled, but because the status notification was just sent, the update won't be sent until 1 second later * The client disconnects within the 1 second * The available_count is again MAX, so no status notification is sent In this situation the master process never created the idle-kill timeout. Usually the following clients will cause a status notification to be sent, but if there was only the one client then this process won't be idle-killed. Fix the situation so that the idle-kill timeout is created already by the initial status notification. M src/master/service-monitor.c 2021-06-03 19:04:26 +0300 Timo Sirainen (bb618563b7) lib: Add array_foreach_reverse[_modifiable]() This is especially useful when deleting multiple elements inside the loop. M src/lib/array.h M src/lib/test-array.c 2021-06-03 16:50:39 +0300 Timo Sirainen (df1b4b8750) lib: Don't use special code for i_unreached() with STATIC_CHECKER This was done originally to help scan-build, but this is no longer necessary. Also actually running code where __builtin_unreachable() was reached produced (very weird) undefined behavior. Reverts e2e9ea6da9f3db5fd7fe467db79232d20d03832f M src/lib/macros.h 2021-06-03 16:48:36 +0300 Timo Sirainen (ecc984350e) Makefile.am: Update configure parameters for scan-build Especially add --enable-static-checker. M Makefile.am 2021-06-04 12:46:53 +0300 Timo Sirainen (70defb0fb7) lib-imap: imap-parser - Parse literal size using as same algorithm as str_parse*(). This prevents wrapping the integer value and fixes an ubsan complaint. Based on Stephan's similar patch in managesieve-parser. M src/lib-imap/imap-parser.c 2021-06-04 12:45:08 +0300 Timo Sirainen (71e1d599ed) lib-imap: imap-parser - Fix 8 bit atom check to use unsigned char. M src/lib-imap/imap-parser.c 2020-11-20 11:56:41 +0200 Timo Sirainen (605f65f8c1) lib-http: Add http-client category to client events M src/lib-http/http-client.c 2021-06-02 12:39:39 +0200 Markus Valentin (6b2963fe81) acl: Ignore acls in acl_mailbox_right_lookup if ignore_acls is set In case an namespace has been configured to ignore ACLs make sure that also happens for acl_mailbox_right_lookup. M src/plugins/acl/acl-mailbox.c 2021-06-01 13:10:23 +0200 Markus Valentin (d2a85c0441) acl: If acl_ignore_namespace is set acl_backend can be NULL Allow an uninitialized acl backend when ignore_acls is set. M src/plugins/acl/acl-mailbox.c 2021-05-25 20:03:53 +0300 Timo Sirainen (2d676b0007) lib-mail: Add MESSAGE_PART_FLAG_OVERFLOW to MIME parts that reached parsing limits This allows callers to find out which MIME parts were properly parsed. M src/lib-mail/message-parser.c M src/lib-mail/message-part.h M src/lib-mail/test-message-parser.c 2021-04-29 17:00:47 +0300 Timo Sirainen (9d21af067f) imap: copy: Abort if client disconnects during COPY Since the client didn't receive the COPY tagged reply, it doesn't know whether the COPY succeeded or not. This likely causes it to try the COPY again and duplicate the mails. M src/imap/cmd-copy.c 2021-05-19 05:56:13 -0600 Splintermail Dev (e903c76ef3) imap: imap-sync - Fix VANISHED response with UID=1 Fixes a bug introduced in 4eb3f6f27, where a UID EXPUNGE 1 command resulted in a VANSIHED 0:1 response, which is invalid IMAP syntax (sequence sets must have nonzero values). M src/imap/imap-sync.c 2021-05-17 12:13:16 +0300 Aki Tuomi (0cb2ec40a4) fts: Do not consider arbitrary headers with 8-bit data as language-specific If we do stemming etc processing for arbitrary headers, they might become impossible to find in subsequent searches due to stemming. This practically breaks e.g. From/To header searches with non-ascii names. M src/plugins/fts/fts-build-mail.c 2020-03-09 11:11:04 +0200 Timo Sirainen (c38df6196d) lib: DEBUG: Fix potential crash in handling "Growing data stack" debug message This could have only happened when data_stack_grow event was enabled and when --enable-devel-checks was used. M src/lib/data-stack.c M src/lib/test-data-stack.c 2021-05-27 11:18:05 +0300 Timo Sirainen (4784a79d09) lib: test-data-stack: Run each test with the same data stack state M src/lib/test-data-stack.c 2021-05-21 16:59:17 +0300 Timo Sirainen (b0fd5705af) lib-lua: Delay running Lua script until dlua_script_init() This allows the caller to register globals before running the script. M src/lib-lua/dlua-script.c M src/lib-lua/dlua-script.h 2021-05-21 16:58:01 +0300 Timo Sirainen (f45c32c968) lib-lua: Move finalizing event and setting linked list to dlua_create_script() There's no need to delay them until dlua_script_create_finish(). M src/lib-lua/dlua-script.c 2021-05-21 17:48:48 +0300 Timo Sirainen (f985653670) lib-lua: Update dlua_script_create_*() comment Reusing existing scripts wasn't actually implemented. M src/lib-lua/dlua-script.h 2021-05-21 17:06:37 +0300 Timo Sirainen (67c7c1aaae) lib-lua: dlua_script_init() - Always return -1 if script_init() fails The previous behavior was to forward the script_init() return value to the caller. This was somewhat unexpected behavior. M src/lib-lua/dlua-script.c 2021-05-31 11:33:40 +0300 Timo Sirainen (2b508d396c) lib-storage: dlua_register_mail_storage() - Fix popping dlua_dovecot in Lua stack M src/lib-storage/mail-storage-lua.c 2021-05-07 20:37:02 +0300 Timo Sirainen (c8ac1fd03b) lib-storage: Fix corrupted cache when adding attachment keywords If IMAP BODYSTRUCTURE parsing fails, it means the BODYSTRUCTURE doesn't match the MIME parts. This likely means that one or both of them are corrupted. Handle this by deleting the email from cache, so this error won't keep repeating. M src/lib-storage/mail.c 2021-05-07 20:28:03 +0300 Timo Sirainen (bbcf91c5d6) lib-storage: Don't log error if attachment flags couldn't be set due to missing cache Ever since 194dcaa65cdd247393633f2daa4b40fd12985440 missing attachment keywords have been attempted to be automatically added if all the necessary fields are in dovecot.index.cache. However, if mime.parts wasn't in the cache an error was unnecessarily logged. Fixes: Error: Failed to add attachment keywords: mail_get_parts() failed: Mail field not cached M src/lib-storage/mail.c 2021-05-21 13:53:02 +0200 Markus Valentin (2480f7bd2c) imap-acl: In case mailbox name is "" set it to INBOX for shared namespaces To prevent proxying ACL commands with mailbox "" replace it with "INBOX" when used with shared namespaces. M src/plugins/imap-acl/imap-acl-plugin.c 2021-05-25 16:09:25 +0200 Markus Valentin (bfde81138a) imapc: Extract imapc_mailbox_name_equals from imapc_untagged_status M src/lib-storage/index/imapc/imapc-mailbox.c M src/lib-storage/index/imapc/imapc-storage.c M src/lib-storage/index/imapc/imapc-storage.h 2021-05-20 16:03:12 +0200 Markus Valentin (b58ac1f607) imap-acl: Replace mailbox_open_as_admin with mailbox_open_allocated_as_admin M src/plugins/imap-acl/imap-acl-plugin.c 2021-05-20 14:27:46 +0200 Markus Valentin (becb0ee0d5) imap-acl: Allow LISTRIGHT replies without opening as admin As the reply is hardcoded there is no need to proxy the ACL command to a remote backend in case imapc_feature "acl" is enabled. M src/plugins/imap-acl/imap-acl-plugin.c 2021-05-19 15:12:35 +0200 Markus Valentin (8d994ed413) imap-acl: Implement proxying commands to an imapc location for DELETEACL Before calling imap_acl_cmd_deleteacl in cmd_deleteacl the new code checks if the command should be proxied and if so, does the proxying. M src/plugins/imap-acl/imap-acl-plugin.c 2021-05-19 15:11:40 +0200 Markus Valentin (52333bdb22) imap-acl: Implement proxying commands to an imapc location for SETACL Before calling imap_acl_cmd_setacl in cmd_setacl the new code checks if the command should be proxied and if so, does the proxying. M src/plugins/imap-acl/imap-acl-plugin.c 2021-05-19 15:09:24 +0200 Markus Valentin (7a6dda9cef) imap-acl: Implement proxying commands to an imapc location for GETACL Before calling imap_acl_cmd_getacl in cmd_getacl the new code checks if the command should be proxied and if so, does the proxying. M src/plugins/imap-acl/imap-acl-plugin.c 2021-05-25 16:59:31 +0200 Markus Valentin (d64123e856) imap-acl: Extract imap_acl_cmd_deleteacl from cmd_deletacl This change makes acl_mailbox_open_allocated_as_admin called later which is necessary for the following proxying IMAP ACL changes. M src/plugins/imap-acl/imap-acl-plugin.c 2021-05-25 16:45:13 +0200 Markus Valentin (98f1a2a6e4) imap-acl: Extract imap_acl_cmd_setacl from cmd_setacl This change makes acl_mailbox_open_allocated_as_admin called later which is necessary for the following proxying IMAP ACL changes. M src/plugins/imap-acl/imap-acl-plugin.c 2021-05-25 16:29:10 +0200 Markus Valentin (f583ef8991) imap-acl: Extract imap_acl_cmd_getacl from cmd_getacl This change makes acl_mailbox_open_allocated_as_admin called later which is necessary for the following proxying IMAP ACL changes. M src/plugins/imap-acl/imap-acl-plugin.c 2021-05-19 14:52:36 +0200 Markus Valentin (5a7cf68dfd) imap-acl: Implement proxying commands to an imapc location for MYRIGHTS Introduce the needed changes to proxy imap-acl commands to a remote backend using imap-client. Before calling imap_acl_cmd_myrights in cmd_myrights the new code checks if the command should be proxied and if so, does the proxying. M src/plugins/imap-acl/Makefile.am M src/plugins/imap-acl/imap-acl-plugin.c 2021-05-25 12:40:55 +0200 Markus Valentin (c923bd0f75) imap-acl: Add imapc_acl_get_mailbox_error Allows to retrieve full mailbox error. M src/plugins/imap-acl/Makefile.am M src/plugins/imap-acl/imap-acl-plugin.c 2021-05-25 11:19:47 +0200 Markus Valentin (f2e0cdfc9c) imap-acl: Split off imap_acl_cmd_myrights from cmd_myrights M src/plugins/imap-acl/imap-acl-plugin.c 2021-05-20 13:47:55 +0200 Markus Valentin (358432fba5) imap-acl: Split acl_mailbox_open_as_admin This allows easier implementation of the imap-acl proxying. M src/plugins/imap-acl/imap-acl-plugin.c 2021-05-20 23:21:10 +0200 Markus Valentin (c963be712f) imap-acl: Add imap_acl_storage with module context M src/plugins/imap-acl/imap-acl-plugin.c M src/plugins/imap-acl/imap-acl-plugin.h 2021-05-25 12:38:50 +0200 Markus Valentin (7f7a39bcb1) imapc: Add imapc_mail_error_to_resp_text_code to access error msg by enum M src/lib-storage/index/imapc/imapc-storage.c M src/lib-storage/index/imapc/imapc-storage.h 2021-05-26 10:31:26 +0200 Markus Valentin (fa47e36587) imapc: Change function signature prefix to imapc_resp_text_code_parse M src/lib-storage/index/imapc/imapc-list.c M src/lib-storage/index/imapc/imapc-storage.c M src/lib-storage/index/imapc/imapc-storage.h 2021-05-20 23:18:30 +0200 Markus Valentin (07e2f39e5c) imapc: Add imapc_storage_client_unregister_untagged function M src/lib-storage/index/imapc/imapc-storage.c M src/lib-storage/index/imapc/imapc-storage.h 2021-05-18 16:26:46 +0200 Markus Valentin (885794cbce) imapc: Add imapc_features=acl In order to allow proxying IMAP ACL commands to a remote backend M src/lib-storage/index/imapc/imapc-settings.c M src/lib-storage/index/imapc/imapc-settings.h 2021-05-21 19:23:57 +0200 Timo Sirainen (67c08cfc9b) lib: test-event-filter-*: Hide details of tests unless they fail This removes ~14k lines of output from test-lib run. M src/lib/test-event-filter-expr.c M src/lib/test-event-filter-merge.c M src/lib/test-event-filter-parser.c 2021-05-21 16:11:45 +0300 Timo Sirainen (d9f2b426ea) imap: Send tagged login reply before finalizing user initialization Broken by 5fc66f182ff6941639d30372b414c1b39ae1e67e M src/imap/imap-client.c M src/imap/imap-client.h M src/imap/imap-master-client.c M src/imap/main.c 2021-05-21 16:23:36 +0300 Timo Sirainen (02363cfb7b) m4, dovecot-config: Add LIBDOVECOT_LUA_INCLUDE This allows building plugins that use lib-lua against uninstalled Dovecot source code tree. M dovecot-config.in.in M m4/dovecot.m4 2021-05-20 11:05:37 -0400 Josef 'Jeff' Sipek (d386e3727f) lib: event filter - Return invalid chars in the lexer This way, we leave it up to the parser to figure out whether or not they make sense. M src/lib/event-filter-lexer.l M src/lib/test-event-filter-parser.c 2021-05-20 10:24:35 -0400 Josef 'Jeff' Sipek (8c6ea200af) lib: event filter - Allow '?' in filter language tokens Without this, it is not possible to use '?' wildcards without quoting the value. M src/lib/event-filter-lexer.l M src/lib/test-event-filter-parser.c 2021-05-18 17:44:08 +0300 Timo Sirainen (308ba466c8) dict-sql: Support SQL_DB_FLAG_ON_CONFLICT_DO M src/lib-dict-backend/dict-sql.c 2021-05-18 17:40:00 +0300 Timo Sirainen (5329cd3af4) lib-sql: Add SQL_DB_FLAG_ON_CONFICT_DO for new enough sqlite and pgsql M src/lib-sql/driver-pgsql.c M src/lib-sql/driver-sqlite.c M src/lib-sql/driver-test.c M src/lib-sql/sql-api.h 2021-05-18 17:21:59 +0300 Timo Sirainen (6cc9bd8e2b) lib-sql: sqlpool: Implement get_flags() as a wrapper to the real db M src/lib-sql/driver-sqlpool.c 2021-05-18 17:15:02 +0300 Timo Sirainen (3b3d90d2c9) lib: test-array - Add more unit tests for array_foreach*() Make sure that the elem value is as expected after the loop completes. M src/lib/test-array.c 2021-05-18 17:08:51 +0300 Timo Sirainen (60dc5c2fe0) lib-sql: Add sql_db_vfuncs.get_flags() M src/lib-sql/sql-api-private.h M src/lib-sql/sql-api.c 2021-05-18 17:02:30 +0300 Timo Sirainen (88a56737a5) dict-sql: Use SQL_DB_FLAG_ON_DUPLICATE_KEY Instead of hardcoding mysql check. M src/lib-dict-backend/dict-sql-private.h M src/lib-dict-backend/dict-sql.c 2021-05-18 17:00:44 +0300 Timo Sirainen (0d8acaeae2) lib-sql: Add SQL_DB_FLAG_ON_DUPLICATE_KEY flag for MySQL M src/lib-sql/driver-mysql.c M src/lib-sql/driver-test.c M src/lib-sql/sql-api.h 2021-05-24 18:55:28 +0300 Aki Tuomi (4766b85437) auth: mech-oauth2 - Iterate fields in safer manner Static analyser wasn't happy about the previous way. M src/auth/mech-oauth2.c 2020-11-09 12:29:16 +0100 Stephan Bosch (5703f0b007) lib-smtp: smtp-server-recipient - Remove smtp_server_recipient_initialize(). It is no longer needed. M src/lib-smtp/smtp-server-cmd-rcpt.c M src/lib-smtp/smtp-server-private.h M src/lib-smtp/smtp-server-recipient.c 2020-11-09 12:29:29 +0100 Stephan Bosch (b09ec34569) lib-smtp: smtp-server-recipient - Create transaction event early if there is no transaction yet. This allows having a parent for the recipient event once the recipient is created, which can precede the creation of the transaction. M src/lib-smtp/smtp-server-connection.c M src/lib-smtp/smtp-server-private.h M src/lib-smtp/smtp-server-recipient.c M src/lib-smtp/smtp-server-transaction.c 2021-05-21 18:20:10 +0300 Timo Sirainen (57874285f2) lib: Free unused data stack memory once per second while running ioloop This way if the data stack has grown excessively large temporarily, it won't permanently waste memory. And if the data stack grows back to the same large size, re-allocating it once per second doesn't cause performance problems. M src/lib/ioloop.c 2021-05-21 18:13:08 +0300 Timo Sirainen (14ac1c5efe) lib: data-stack - Keep the largest unused block in memory after all This reverts 2da21080dbbe50b4924ac0135c84babfb404dcce, but that alone doesn't produce working code so there are also some further fixups. M src/lib/data-stack.c M src/lib/data-stack.h M src/lib/test-data-stack.c 2021-05-17 01:24:31 +0200 Stephan Bosch (d0ce18bc7f) lib-smtp: test-smtp-payload - Double the client progress timeout. Otherwise, SSL tests can fail on systems with low entropy. M src/lib-smtp/test-smtp-payload.c 2021-04-21 03:02:38 +0200 Stephan Bosch (a2ea45e543) lib-smtp: smtp-client-transaction - Allow destroying connection while transaction still holds reference. The lifetime of the transaction is controlled by the application and not so much by the connection. The transaction holds a reference to the connection, so if the connection is forcibly destroyed it needs, to notify the transaction of this event. This fixes: Panic: file connection.c: line 938 (connection_list_deinit): assertion failed: (conn != list->connections) M src/lib-smtp/smtp-client-connection.c M src/lib-smtp/smtp-client-private.h M src/lib-smtp/smtp-client-transaction.c 2021-04-22 12:13:35 +0200 Stephan Bosch (efcb45d77f) lib-smtp: smtp-client-transaction - Properly handle pending failure upon smtp_client_transaction_send_reset(). M src/lib-smtp/smtp-client-transaction.c 2021-04-22 12:03:59 +0200 Stephan Bosch (f73471d049) lib-smtp: smtp-client-connection - Add smtp_client_connection_transactions_fail() and use it. Use it to always fail the whole transaction first before the individual commands if possible. M src/lib-smtp/smtp-client-connection.c 2021-04-22 11:53:30 +0200 Stephan Bosch (406f3a4ee7) lib-smtp: smtp-client-connection - Split off smtp_client_connection_transactions_fail_reply(). M src/lib-smtp/smtp-client-connection.c 2021-04-22 12:36:18 +0200 Stephan Bosch (9673639616) lib-smtp: smtp-client-connection - Always abort all commands upon smtp_client_connection_close(). Before, these would get a disconnect failure, which makes no sense when the client is causing the disconnect. M src/lib-smtp/smtp-client-connection.c 2021-04-22 12:32:38 +0200 Stephan Bosch (0ef7144312) lib-smtp: smtp-client-connection - Abort all transactions upon smtp_client_connection_close(). Before, these would get a disconnect failure, which makes no sense when the client is causing the disconnect. M src/lib-smtp/smtp-client-connection.c 2021-04-22 12:09:11 +0200 Stephan Bosch (c93786ad17) lib-smtp: test-smtp-payload - Finish client transaction only when it finishes completely. M src/lib-smtp/test-smtp-payload.c 2021-05-17 01:13:36 +0200 Stephan Bosch (a2371f18ce) lib-smtp: Reformat smtp-client-transaction.c. M src/lib-smtp/smtp-client-transaction.c 2021-04-22 11:46:30 +0200 Stephan Bosch (105fd27947) lib-smtp: Reformat smtp-client-connection.c. M src/lib-smtp/smtp-client-connection.c 2021-05-10 22:37:44 +0300 Aki Tuomi (c6de40d420) auth: oauth2 - Support passing openid-configuration URL to client on failure M doc/example-config/dovecot-oauth2.conf.ext M src/auth/auth-request.h M src/auth/db-oauth2.c M src/auth/mech-oauth2.c 2021-05-10 22:29:23 +0300 Aki Tuomi (291452bca5) auth: mech-oauth2 - Pass error fields as array Makes it easier to add fields to it later on. M src/auth/mech-oauth2.c 2021-05-21 14:42:07 +0300 Timo Sirainen (f9461066c5) imap: copy/move: Fix memory leak when no messages were found M src/imap/cmd-copy.c 2021-02-12 01:22:25 +0200 Timo Sirainen (b13c1e300e) doveadm: Delay reading settings until doveadm plugins are loaded M src/doveadm/doveadm-mail.c M src/doveadm/doveadm-mail.h M src/doveadm/doveadm.c M src/doveadm/main.c 2021-02-12 01:54:48 +0200 Timo Sirainen (d8841feb84) doveadm: Add doveadm_setting_roots_*() API for plugins to register settings M src/doveadm/doveadm-settings.c M src/doveadm/doveadm-settings.h M src/doveadm/doveadm.c M src/doveadm/main.c M src/lib-master/master-service-settings.c 2021-02-15 17:11:07 +0200 Timo Sirainen (b1b19b0e25) doveadm: Move settings reading code into doveadm-settings.c This code is now shared between doveadm and doveadm-server. M src/doveadm/doveadm-settings.c M src/doveadm/doveadm-settings.h M src/doveadm/doveadm.c M src/doveadm/main.c 2021-02-12 19:17:25 +0200 Timo Sirainen (ca96472b05) lib-master: Add master_service_settings_input.extra_modules This allows specifying more than one module. M src/lib-master/master-service-settings.c M src/lib-master/master-service-settings.h 2021-02-12 19:15:44 +0200 Timo Sirainen (5f1126a9fb) lib-master: master_service_exec_config() - Build argv using dynamic array M src/lib-master/master-service-settings.c 2021-05-11 00:07:24 +0300 Aki Tuomi (ef2a1b2336) auth: auth-worker - Respect service_count If service_count is set, then auth-worker will stop after given number of requests. M src/auth/auth-settings.c M src/auth/auth-worker-client.c M src/auth/auth-worker-client.h M src/auth/main.c 2021-05-20 15:54:04 +0300 Timo Sirainen (714ff4342e) imap: Improve sending internal error to client if initialization fails The "Internal server error" should be sent using the same ostream that was created. Also if service_user initialization failed there was no OK reply to sent to login. M src/imap/main.c 2021-05-20 15:42:45 +0300 Timo Sirainen (2e56339868) imap: Send initial tagged reply directly using ostream This simplifies the following commits. M src/imap/main.c 2021-05-20 13:22:18 +0300 Timo Sirainen (5fc66f182f) imap: Send initial tagged reply and capability after rawlogs are initialized This way the initial tagged reply and capability is written to the rawlog. Broken by 16328738d35370685387ec51d20657265855e770 M src/imap/main.c 2021-05-20 13:16:40 +0300 Timo Sirainen (2dcb967ec1) imap: Split client_add_input_capability() into two functions M src/imap/main.c 2021-05-20 13:14:00 +0300 Timo Sirainen (75c4ad294a) imap: Rename struct client_input to imap_login_request This better indicates what it is about, and causes less confusion with all the other client_input variables. M src/imap/main.c 2021-03-08 16:45:08 +0200 Timo Sirainen (7c8becb4b0) pop3: Handle pipelined input via istream-concat This fixes rawlog_dir to work properly. It didn't log the pipelined input to rawlog and it may have also caused the connection to hang. M src/pop3/main.c 2021-03-08 16:44:31 +0200 Timo Sirainen (8fa48cb6d0) pop3: Move finishing istream to client_create_finish() M src/pop3/pop3-client.c M src/pop3/pop3-client.h 2021-03-08 16:55:49 +0200 Timo Sirainen (e56bea8045) imap: Handle pipelined input from imap-hibernate via istream-concat Similarly to the previous commit, this fixes issues with rawlog. M src/imap/imap-master-client.c 2021-03-08 16:37:15 +0200 Timo Sirainen (380aa66738) imap: Handle pipelined input via istream-concat This fixes rawlog_dir to work properly. It didn't log the pipelined input to rawlog and it may have also caused the connection to hang. M src/imap/imap-client.c M src/imap/imap-client.h M src/imap/main.c 2021-03-08 16:33:50 +0200 Timo Sirainen (16328738d3) imap: Move iostream-rawlog creation to client_create_finish() This allows the caller to modify the istream before rawlog. M src/imap/imap-client.c 2021-03-08 16:33:33 +0200 Timo Sirainen (c8a9ccc5aa) lib: Add i_stream_copy_fd() M src/lib/istream.c M src/lib/istream.h 2021-05-14 15:57:20 +0200 Markus Valentin (ad4c2b77a8) acl: Fix broken LIST for shared namespaces Due to the recent changes in the usage of the acl_ignore_namespace setting shared namespaces where trying to use fast listing too. This resulted in wrong LIST IMAP command outputs when using acl plugin. Broken by dc8ecd38a7e54b8bb80ae97712a0d8ad4edcbed3 M src/plugins/acl/acl-mailbox-list.c 2021-05-12 19:06:27 +0300 Aki Tuomi (83939b222d) lib-lua: dlua-compat - Undefine lua_isinteger It's being defined in compat to return boolean, so undefine it here to make sure it compiles. Broken in b59e89ebd97fa52de25b8e976a7dfe61f0d8a639 M src/lib-lua/dlua-compat.c 2021-04-30 11:34:51 +0200 Markus Valentin (dc8ecd38a7) acl: Prevent crashes with acl_ignore_namespace In case a namespace was ignored for ACLs an crash could occur because of "Module context acl_storage_module missing". This panic is prevented by this change. M src/plugins/acl/acl-mailbox-list.c M src/plugins/acl/acl-mailbox.c M src/plugins/acl/acl-plugin.h 2021-05-06 10:18:10 +0200 Markus Valentin (81b845fcf7) acl: Move static acl_namespace_is_ignored M src/plugins/acl/acl-mailbox-list.c 2021-02-18 12:41:51 +0200 Timo Sirainen (b04d1a4a71) lib-program-client: Change program_client_run*() to return enum program_client_exit_status Their behavior is clearer when result is expressed as enum than int. M src/director/director.c M src/lib-program-client/program-client.c M src/lib-program-client/program-client.h M src/lib-program-client/test-program-client-net.c M src/lib-program-client/test-program-client-unix.c M src/lib-smtp/smtp-submit.c 2021-02-18 12:33:06 +0200 Timo Sirainen (da5c1d11b9) lib-program-client: Rename "exit_code" to "exit_status" exit_code typically refers to the numeric 0..255 value that processes exit with. M src/lib-program-client/program-client-local.c M src/lib-program-client/program-client-private.h M src/lib-program-client/program-client-remote.c M src/lib-program-client/program-client.c M src/lib-program-client/program-client.h 2021-02-18 12:30:50 +0200 Timo Sirainen (6a30dcc20b) lib-program-client: Move enum program_client_exit_code to public .h file M src/lib-program-client/program-client-private.h M src/lib-program-client/program-client.h 2021-05-10 19:46:53 +0300 Aki Tuomi (2b403bc75c) lib-lua: dlua-dovecot - Ref event on push Matches with unref on __gc. M src/auth/db-lua.c M src/lib-lua/dlua-dovecot.c 2021-05-10 19:23:48 +0300 Aki Tuomi (5becc3bb36) lib-lua: test-lua - Use bool for expected_isnum in check_tointegerx_compat M src/lib-lua/test-lua.c 2021-05-10 19:21:50 +0300 Aki Tuomi (b59e89ebd9) lib-lua: Define lua_isinteger as boolean function M src/lib-lua/dlua-script-private.h M src/lib-lua/dlua-script.c M src/lib-lua/test-lua.c 2021-04-19 14:51:05 +0300 Aki Tuomi (1fa8dbb63e) lib-lua: Fix error reporting for script loading M src/lib-lua/dlua-script.c 2021-04-19 14:45:56 +0300 Aki Tuomi (27e165d381) lib-lua: Use dluaL_error for luaL_error M src/lib-lua/dlua-script-private.h 2021-04-16 13:19:26 +0300 Aki Tuomi (4258a2d8d7) lib-lua: Fix luaL_error usage M src/auth/db-lua.c M src/lib-lua/dlua-script.c M src/lib-storage/mailbox-lua.c 2021-04-16 13:11:20 +0300 Aki Tuomi (5d70672760) lib-lua: Add dluaL_error M src/lib-lua/Makefile.am A src/lib-lua/dlua-error.c M src/lib-lua/dlua-script-private.h 2021-04-16 13:10:41 +0300 Aki Tuomi (890c7a0581) lib-lua: dlua-script - Add dlua_pushfstring Uses full sprintf M src/lib-lua/Makefile.am A src/lib-lua/dlua-pushstring.c M src/lib-lua/dlua-script-private.h 2021-04-15 11:19:52 +0300 Aki Tuomi (15773af5b3) lib-lua: dlua-wrapper - Constify extra functions M src/lib-lua/dlua-wrapper.h 2021-05-11 16:53:57 +0200 Timo Sirainen (da9ccf08a4) lib-index, lib-compression: Fix explicit integer wrapping Using modulo instead of AND wrapped it one number too early. Luckily these didn't break anything. M src/lib-compression/test-compression.c M src/lib-index/mail-cache-lookup.c M src/lib-index/mail-cache-purge.c 2021-05-05 12:45:25 +0300 Timo Sirainen (f550663b37) lib: abort() on unexpected exit() This can especially be useful in catching bugs in Lua script that could unexpectedly exit. M src/lib-master/master-service.c M src/lib/failures.c M src/lib/lib.c M src/lib/lib.h M src/master/main.c 2021-05-05 12:44:03 +0300 Timo Sirainen (6d52674782) global: Replace exit() with lib_exit() M src/auth/checkpassword-reply.c M src/auth/db-checkpassword.c M src/config/doveconf.c M src/dict/main.c M src/doveadm/doveadm-mail.c M src/doveadm/doveadm-pw.c M src/doveadm/doveadm.c M src/lib-compression/bench-compression.c M src/lib-oauth2/test-oauth2-jwt.c M src/lib-test/test-common.c M src/lib-test/test-subprocess.c M src/lib/failures.c M src/lib/lib.h M src/lib/test-file-create-locked.c M src/master/main.c M src/util/rawlog.c M src/util/tcpwrap.c 2021-04-14 10:45:55 +0200 Stephan Bosch (f2fc1c01f8) lib-http: http-client-peer - Fix segfault occurring upon backoff connect. If peers decide to close and destroy immediately, the iteration in the shared peer yields an invalid pointer for the next peer to connect. Fixed by preserving pointer to next peer inside the loop. M src/lib-http/http-client-peer.c 2021-04-30 16:59:50 -0400 Josef 'Jeff' Sipek (aefe4941c1) lib: event filter - Avoid using event field wildcard matching when not needed If the right hand side of an event field comparison is not using any wildcards, we can compare using strcasecmp() instead of the more expensive wildcard_match_icase(). This wildcard matching avoidance change speeds up matching quite a bit. When the desired comparison is *not* a wildcard match (i.e., the filter is 'fieldname=abc'), microbenchmarks show at least a 11% speedup in filter matching speed. When the comparison includes a wildcard (i.e., the filter is 'fieldname=abc*'), microbenchmarks show approximately 0.9% filer matching slowdown. Since there are so many non-wildcard matches in a typical filter, this is a very good trade-off. M src/lib/event-filter-parser.y M src/lib/event-filter-private.h M src/lib/event-filter.c 2021-04-30 16:39:15 -0400 Josef 'Jeff' Sipek (dcb47858e1) lib: event filter - Rename EVENT_FILTER_NODE_TYPE_EVENT_FIELD to denote wildcard matching M src/lib/event-filter-parser.y M src/lib/event-filter-private.h M src/lib/event-filter.c 2021-04-30 12:41:55 -0400 Josef 'Jeff' Sipek (33e01c1c30) lib: event filter - Avoid using event name wildcard matching when not needed If the right hand side of an event name comparison is not using any wildcards, we can compare using strcmp() instead of the more expensive wildcard_match(). This wildcard matching avoidance change speeds up matching quite a bit. When the desired comparison is *not* a wildcard match (i.e., the filter is 'event=abc'), microbenchmarks show at least a 30% speedup in filter matching speed. When the comparison includes a wildcard (i.e., the filter is 'event=abc*'), microbenchmarks show approximately 0.4% filer matching slowdown. Since there are so many non-wildcard matches in a typical filter, this is a very good trade-off. M src/lib/event-filter-parser.y M src/lib/event-filter-private.h M src/lib/event-filter.c 2021-04-30 12:44:17 -0400 Josef 'Jeff' Sipek (aa6edb3499) lib: event filter - Rename EVENT_FILTER_NODE_TYPE_EVENT_NAME to denote wildcard matching M src/lib/event-filter-parser.y M src/lib/event-filter-private.h M src/lib/event-filter.c 2021-04-30 14:09:10 -0400 Josef 'Jeff' Sipek (0e7cf747a9) lib: Add wildcard_is_literal to check if a mask has * or ? M src/lib/wildcard-match.h 2021-05-10 11:26:54 +0300 Timo Sirainen (e786e5f40a) lib: test-env-util - Make static analyzer happy M src/lib/test-env-util.c 2021-05-06 21:25:54 +0300 Aki Tuomi (79a2edcd07) lib-dict: dict-lua - Don't yield again until previous one has completed M src/lib-dict/dict-iter-lua.c 2021-05-04 12:15:55 +0300 Aki Tuomi (315f9073f4) lib-dict: dict-lua - Use absolute stack positions for arguments M src/lib-dict/dict-iter-lua.c M src/lib-dict/dict-lua.c M src/lib-dict/dict-txn-lua.c 2021-05-05 13:40:29 +0300 Aki Tuomi (9547662586) acl: Reinitialize local acl object after creating mailbox For INDEX layout this is needed to actually get the local mailbox path. This fixes inheriting ACLs from parent folder for INDEX layouts. M src/plugins/acl/acl-mailbox.c 2021-05-05 18:18:29 +0300 Timo Sirainen (8b92cf375f) lib: Add unit tests to env-util M src/lib/Makefile.am A src/lib/test-env-util.c M src/lib/test-lib.inc 2021-01-20 20:53:53 +0200 Timo Sirainen (d9dad9970e) lib-index: Use env_put() instead of putenv() directly M src/lib-index/test-mail-index-transaction-update.c 2021-01-20 20:51:56 +0200 Timo Sirainen (d1f628e8b0) configure, lib: Remove workarounds for unsetenv() It's in POSIX.1-2001 and available on all modern systems. M configure.ac D m4/unsetenv.m4 M src/lib/env-util.c 2021-01-20 20:48:24 +0200 Timo Sirainen (8e7744b179) lib: env_put() - Use setenv() instead of putenv() It's already in POSIX.1-2001 so it should be available everywhere. M src/lib/env-util.c M src/lib/env-util.h M src/lib/lib.c 2021-01-20 20:46:27 +0200 Timo Sirainen (9f1b0a7fa5) lib, global: Change env_put() API to take name,value pair M src/auth/db-checkpassword.c M src/auth/db-ldap.c M src/auth/mech-gssapi.c M src/config/doveconf.c M src/dict/main.c M src/doveadm/doveadm.c M src/lda/main.c M src/lib-master/master-service-settings.c M src/lib-master/master-service.c M src/lib/env-util.c M src/lib/env-util.h M src/lib/restrict-access.c M src/lib/test-var-expand.c M src/master/service-process.c M src/util/script-login.c 2021-01-20 20:45:11 +0200 Timo Sirainen (990bb780a3) lib-program-client, script: Use env_put_array() M src/lib-program-client/program-client-local.c M src/util/script.c 2021-01-20 20:42:40 +0200 Timo Sirainen (3af2f08c27) lib: Add env_put_array() M src/lib/env-util.c M src/lib/env-util.h 2021-04-20 18:06:19 +0200 Timo Sirainen (f19988344d) util/dovecot-sysreport: Finish report even if doveadm calls fail It can be useful to generate the report even when dovecot isn't running. M src/util/dovecot-sysreport 2021-04-01 14:16:34 +0300 Timo Sirainen (ebf2557b57) util/dovecot-sysreport --core: Support multiple core files M doc/man/dovecot-sysreport.1.in M src/util/dovecot-sysreport 2021-04-01 14:12:14 +0300 Timo Sirainen (d7cb97d26c) util/dovecot-sysreport --core: Check gdb existence earlier Simplifies the next commit. M src/util/dovecot-sysreport 2021-04-01 14:09:42 +0300 Timo Sirainen (74d399f441) util/dovecot-sysreport --core: Change binary path to be optional If not specified, detect it from the core file itself M src/util/dovecot-sysreport 2021-05-06 01:08:50 +0300 Timo Sirainen (e2651f1d5e) global: Use array_idx_elem() where possible M src/auth/auth-worker-server.c M src/auth/db-dict.c M src/auth/db-ldap.c M src/auth/db-lua.c M src/director/director.c M src/doveadm/dsync/dsync-mailbox-import.c M src/doveadm/dsync/dsync-mailbox-tree-sync.c M src/indexer/indexer-queue.c M src/lib-dict-backend/dict-ldap.c M src/lib-dict/dict-client.c M src/lib-dns/test-dns-util.c M src/lib-http/http-server-resource.c M src/lib-imap-client/imapc-connection.c M src/lib-index/mail-index-transaction.c M src/lib-ldap/ldap-connection.c M src/lib-sql/driver-cassandra.c M src/lib-storage/index/imapc/imapc-save.c M src/lib-storage/index/imapc/imapc-sync.c M src/lib-storage/index/maildir/maildir-keywords.c M src/lib-storage/list/mailbox-list-fs-iter.c M src/lib-storage/list/mailbox-list-index-notify.c M src/lib-storage/mail-search-args-imap.c M src/lib-storage/mailbox-attribute.c M src/lib-storage/mailbox-list.c M src/lib/hash2.c M src/plugins/acl/acl-lookup-dict.c M src/plugins/push-notification/push-notification-drivers.c M src/plugins/push-notification/push-notification-events.c M src/plugins/quota/quota.c M src/plugins/virtual/virtual-save.c M src/stats/stats-service-openmetrics.c 2021-05-04 16:40:09 +0300 Timo Sirainen (2070e0faf9) lib: Add array_idx_elem() This returns array_idx()'s value dereferenced, so it only works for arrays of pointers. Note that using *array_idx() does the same, but it won't compile if the compiler doesn't have typeof() support. M src/lib/array.h M src/lib/test-array.c 2021-02-10 22:06:29 +0200 Timo Sirainen (f79dbc248c) lib: Remove array_swap() It's not used anywhere, and it's a bit too weird. M src/lib/array.h M src/lib/test-array.c 2021-02-10 21:45:58 +0200 Timo Sirainen (2b50ec125b) global: Use array_foreach_elem() where possible M src/dict/dict-commands.c M src/imap-login/imap-login-commands.c M src/imap-urlauth/imap-urlauth-worker.c M src/ipc/ipc-connection.c M src/ipc/ipc-group.c M src/lib-fs/fs-api.c M src/lib-mail/istream-attachment-connector.c M src/lib-master/master-service-settings.c M src/lib-program-client/program-client-local.c M src/lib-program-client/program-client-remote.c M src/lib-sql/driver-cassandra.c M src/lib-sql/driver-sqlpool.c M src/lib-test/test-subprocess.c M src/lmtp/lmtp-proxy.c M src/login-common/login-proxy.c M src/login-common/main.c M src/replication/replicator/doveadm-connection.c M src/replication/replicator/replicator-brain.c 2021-02-10 21:45:41 +0200 Timo Sirainen (b3bc25eac5) lib-fts: Use array_foreach_elem() where possible M src/lib-fts/fts-filter.c M src/lib-fts/fts-language.c M src/lib-fts/fts-tokenizer.c 2021-02-10 21:45:19 +0200 Timo Sirainen (bdc37a1d9c) submission: Use array_foreach_elem() where possible M src/submission/submission-backend-relay.c M src/submission/submission-backend.c M src/submission/submission-recipient.c 2021-02-10 21:43:18 +0200 Timo Sirainen (6392b0706f) stats: Use array_foreach_elem() where possible M src/stats/client-http.c M src/stats/stats-metrics.c M src/stats/stats-service-openmetrics.c M src/stats/stats-settings.c 2021-02-10 21:35:04 +0200 Timo Sirainen (7c7e7215de) lib-smtp: Use array_foreach_elem() where possible M src/lib-smtp/smtp-server-cmd-data.c M src/lib-smtp/smtp-server-transaction.c M src/lib-smtp/smtp-submit.c 2021-02-10 21:31:16 +0200 Timo Sirainen (162320b73c) lib-old-stats: Use array_foreach_elem() where possible M src/lib-old-stats/stats.c 2021-02-10 21:20:25 +0200 Timo Sirainen (1bf42b1140) config: Use array_foreach_elem() where possible M src/config/config-filter.c M src/config/config-parser.c M src/config/doveconf.c 2021-02-10 21:18:42 +0200 Timo Sirainen (3200ca5b9a) plugins: Use array_foreach_elem() where possible M src/plugins/fts/fts-search-args.c M src/plugins/fts/fts-user.c M src/plugins/mail-crypt/doveadm-mail-crypt.c M src/plugins/mail-crypt/mail-crypt-acl-plugin.c M src/plugins/mail-crypt/mail-crypt-key.c M src/plugins/notify-status/notify-status-plugin.c M src/plugins/push-notification/push-notification-driver-dlog.c M src/plugins/push-notification/push-notification-driver-lua.c M src/plugins/push-notification/push-notification-drivers.c M src/plugins/push-notification/push-notification-event-flagsclear.c M src/plugins/push-notification/push-notification-event-flagsset.c M src/plugins/push-notification/push-notification-plugin.c M src/plugins/push-notification/push-notification-triggers.c 2021-02-10 21:09:42 +0200 Timo Sirainen (6a1099f54a) master: Use array_foreach_elem() where possible M src/master/main.c M src/master/master-client.c M src/master/master-settings.c M src/master/service-listen.c M src/master/service-log.c M src/master/service-monitor.c M src/master/service.c 2021-02-10 21:03:16 +0200 Timo Sirainen (4dea1aeb5f) lib-index: Use array_foreach_elem() where possible M src/lib-index/mail-index-fsck.c M src/lib-index/mail-index-transaction.c 2021-02-10 21:01:06 +0200 Timo Sirainen (6d8e8e328a) lib-imap-client: Use array_foreach_elem() where possible M src/lib-imap-client/imapc-client.c M src/lib-imap-client/imapc-connection.c 2021-02-10 20:58:20 +0200 Timo Sirainen (d97ca599fa) lib-http: Use array_foreach_elem() where possible M src/lib-http/http-client-host.c M src/lib-http/http-client-peer.c M src/lib-http/http-client-queue.c M src/lib-http/http-client.c M src/lib-http/http-message-parser.c M src/lib-http/http-request.c M src/lib-http/http-response.c M src/lib-http/http-server-resource.c M src/lib-http/http-server-response.c M src/lib-http/http-server.c 2021-02-10 20:45:50 +0200 Timo Sirainen (93c59b3309) lib-dict: Use array_foreach_elem() where possible M src/lib-dict/dict-client.c M src/lib-dict/dict.c 2021-02-10 20:44:08 +0200 Timo Sirainen (b797b8377c) imap: Use array_foreach_elem() where possible M src/imap/imap-client.c M src/imap/imap-commands-util.c M src/imap/imap-notify.c M src/imap/imap-state.c 2021-02-10 20:41:27 +0200 Timo Sirainen (75b985c753) doveadm: Use array_foreach_elem() where possible M src/doveadm/doveadm-dump.c M src/doveadm/doveadm-fs.c M src/doveadm/doveadm-mail-batch.c M src/doveadm/doveadm-mail-mailbox.c M src/doveadm/doveadm-mail-server.c M src/doveadm/doveadm-print-table.c M src/doveadm/doveadm-who.c M src/doveadm/dsync/dsync-brain.c M src/doveadm/dsync/dsync-ibc-pipe.c M src/doveadm/dsync/dsync-mailbox-import.c M src/doveadm/server-connection.c 2021-02-10 20:34:25 +0200 Timo Sirainen (8364fd0be1) director: Use array_foreach_elem() where possible M src/director/director-connection.c M src/director/director-host.c M src/director/director.c M src/director/doveadm-connection.c M src/director/mail-host.c M src/director/main.c M src/director/notify-connection.c M src/director/user-directory.c 2021-02-10 20:25:30 +0200 Timo Sirainen (cab67ca2cd) auth: Use array_foreach_elem() where possible M src/auth/auth-worker-server.c M src/auth/auth.c M src/auth/db-dict-cache-key.c M src/auth/db-dict.c M src/auth/passdb.c M src/auth/userdb.c 2021-02-10 20:13:52 +0200 Timo Sirainen (6c540c71a7) lib-storage: Use array_foreach_elem() where possible M src/lib-storage/index/dbox-single/sdbox-file.c M src/lib-storage/index/dbox-single/sdbox-sync.c M src/lib-storage/index/imapc/imapc-mail-fetch.c M src/lib-storage/index/imapc/imapc-mailbox.c M src/lib-storage/index/index-search.c M src/lib-storage/index/maildir/maildir-save.c M src/lib-storage/list/mailbox-list-index-sync.c M src/lib-storage/list/mailbox-list-index.c M src/lib-storage/mail-autoexpunge.c M src/lib-storage/mail-namespace.c M src/lib-storage/mail-storage-hooks.c M src/lib-storage/mail-storage.c M src/lib-storage/mailbox-list.c M src/lib-storage/mailbox-lua.c M src/lib-storage/mailbox-tree.c M src/lib-storage/mailbox-watch.c 2021-02-10 20:06:07 +0200 Timo Sirainen (6934e3eff8) lib: Use array_foreach_elem() where possible M src/lib/env-util.c M src/lib/event-filter.c M src/lib/ioloop.c M src/lib/istream-multiplex.c M src/lib/lib-event.c M src/lib/ostream-multiplex.c 2021-02-10 19:53:25 +0200 Timo Sirainen (e788a21940) lib: array.h - Update array_foreach*() comments M src/lib/array.h 2021-02-10 19:49:00 +0200 Timo Sirainen (178a24d520) lib: array.h - Require C99 We're already requiring C99 elsewhere. M src/lib/array.h 2021-05-05 17:49:33 +0300 Timo Sirainen (50957d30d6) lib: array_foreach_elem() - Don't allow using it for sizes larger than a pointer Dovecot doesn't use any types larger than the pointer size (e.g. long double). Restricting it to max pointer size might prevent inefficient usage. M src/lib/array.h M src/lib/test-array.c 2021-02-10 19:47:13 +0200 Timo Sirainen (db41d8aef3) lib: array_foreach_elem() - Small optimization Avoid having to recalculate the end of the array after each loop. This makes the resulting assembler output similar to array_foreach(). M src/lib/array.h 2021-04-01 17:24:10 +0300 Timo Sirainen (c9fa200175) lib-index: Try harder to open index with MAIL_INDEX_OPEN_FLAG_READONLY The readonly-flag is used when rebuilding index or dumping indexes. In both cases it's better to try to open the index as best as possible, since fsck isn't allowed. M src/lib-index/mail-index-map-read.c M src/lib-index/mail-index.c 2021-05-06 15:17:05 -0400 Josef 'Jeff' Sipek (ef61bea432) lib-lua: Remove obsolete threading check We support multiple lua thread as long as they are created using the dlua_script_new_thread() helper. M src/lib-lua/dlua-script.c 2021-05-05 16:47:43 +0300 Timo Sirainen (3d2a582d56) dict-ldap: Fix calling dict_wait() on async lookup The dict_wait() could have waited forever because nothing stopped the ioloop. Also fix calling the callback with the proper active ioloop. M src/lib-dict-backend/dict-ldap.c 2021-05-05 16:41:21 +0300 Timo Sirainen (8e730ab0b7) dict-redis: dict-client: Use the proper active ioloop while calling commit() callbacks If the callbacks did any IO/timeout changes, they would have gone to a wrong ioloop. This would have caused a warning about IO/timeout leak though, so it doesn't seem like there were such code paths currently. M src/lib-dict/dict-redis.c 2021-05-05 16:37:52 +0300 Timo Sirainen (d559180d9e) dict-memcached-ascii: Assert-crash if dict ioloop gets any unexpected IOs or timeouts M src/lib-dict/dict-memcached-ascii.c 2021-03-22 17:05:24 +0200 Timo Sirainen (92c30d0d36) dict-client: Assert-crash if dict ioloop gets any unexpected IOs or timeouts M src/lib-dict/dict-client.c 2021-03-22 16:50:04 +0200 Timo Sirainen (ad5d1ee03f) dict-client: Use the proper active ioloop while calling commit() and lookup() callbacks If the callbacks did any IO/timeout changes, they would have gone to a wrong ioloop. M src/lib-dict/dict-client.c 2021-03-22 16:59:09 +0200 Timo Sirainen (4c40609b56) lib: Add io_loop_is_empty() M src/lib/ioloop.c M src/lib/ioloop.h M src/lib/test-ioloop.c 2021-05-05 11:19:24 +0300 Timo Sirainen (49b2183103) stats: Truncate field values to 1000 bytes with log exporter This attempts to prevent log lines from growing longer than 4 kB, which causes them to wrap. M src/stats/event-exporter-fmt-json.c M src/stats/event-exporter-fmt-tab-text.c M src/stats/stats-metrics.c M src/stats/stats-metrics.h 2021-05-04 14:12:20 +0300 Timo Sirainen (2227e1ab77) imap: copy/move: Refresh source mailbox before copying/moving This way if another session had just expunged mails, the expunges will be noticed and the copy/move will abort early. M src/imap/cmd-copy.c 2021-04-29 15:49:00 +0300 Timo Sirainen (143b7c2b41) imap: move: Sync source mailbox between commits This way the messages are actually expunged from storage after the commit, not just requested to be expunged. Most importantly this means that if another session attempts to start moving the same messages it can be noticed earlier and one of the moves aborted. M src/imap/cmd-copy.c 2021-04-29 15:45:44 +0300 Timo Sirainen (739a46fe1b) imap: Add imap_search_anyset_to_uidset() M src/imap/imap-search-args.c M src/imap/imap-search-args.h 2021-04-29 15:46:48 +0300 Timo Sirainen (3704149543) imap: Allow imap_search_seqset_iter_init() to iterate over uidset also M src/imap/imap-search-args.c M src/imap/imap-search-args.h 2021-04-29 15:43:10 +0300 Timo Sirainen (3421ea2f78) lib-storage: Fix mailbox_get_uid_range() to handle "*" correctly Previously attempting to convert e.g. 1:* range would just assert-crash. There were no such callers currently though. M src/lib-storage/mailbox-get.c M src/lib-storage/test-mailbox-get.c 2021-04-29 15:39:29 +0300 Timo Sirainen (91ba53a4a0) lib-storage: Always set struct mail.expunged Previously it was set only when some error noticed that there was a problem accessing the mail. Now this is set immediately in mail_set_seq(). This allows e.g. IMAP COPY/MOVE to abort when it encounters expunged mails. M src/lib-storage/index/index-mail.c 2021-05-04 02:19:07 +0200 Stephan Bosch (d9ce815d93) lib-program-client: test-program-client-unix - Add test for delayed disconnect after sending result code. M src/lib-program-client/test-program-client-unix.c 2021-05-03 23:54:11 +0200 Stephan Bosch (9599b0daaa) lib-program-client: test-program-client-net - Add test for delayed disconnect after sending result code. M src/lib-program-client/test-program-client-net.c 2021-05-04 02:12:21 +0200 Stephan Bosch (9af1bb34e8) lib-program-client: test-program-client-unix - Fix server-side argument count check. M src/lib-program-client/test-program-client-unix.c 2021-05-04 02:11:34 +0200 Stephan Bosch (982322ac6e) lib-program-client: test-program-client-net - Fix server-side argument count check. M src/lib-program-client/test-program-client-net.c 2021-05-03 23:54:26 +0200 Stephan Bosch (1666e897f3) lib-program-client: program-client-remote - Fix result parsing in the istream. This fixes internal errors occurring when the parent stream is fully read before EOF is signaled. This was caused by the fact that the final bytes were not always reserved properly for parsing, so that these ended up being exposed to and eaten by the application. At the end, the result parsing code would be faced with no data, thereby causing an internal error to be returned by the calling application. This came to light as CI tests involving Sieve extprograms failed irregularly. This problem only occurs when a (slight) delay exists between the last data being sent and the connection being closed by the script service, making this hard to reproduce. It typically occurred only under high server load. M src/lib-program-client/program-client-remote.c 2021-05-03 23:51:36 +0200 Stephan Bosch (4d4b1a1798) lib-program-client: program-client-remote - Fix error handling of istream. These days, input streams also set eof upon error, making the existing code path wrong. M src/lib-program-client/program-client-remote.c 2021-05-04 01:46:22 +0200 Stephan Bosch (0ffc146325) lib-program-client: program-client-remote - Add proper error and debug logging for result code parsing. M src/lib-program-client/program-client-remote.c 2021-05-04 01:34:30 +0200 Stephan Bosch (17ca57dba7) lib-program-client: program-client-local - Add debug for child start problem. M src/lib-program-client/program-client-local.c 2021-05-03 23:49:11 +0200 Stephan Bosch (ca34fd9db1) lib-program-client: Reformat test-program-client-unix.c. M src/lib-program-client/test-program-client-unix.c 2021-05-03 23:43:47 +0200 Stephan Bosch (e04a83afc8) lib-program-client: Reformat test-program-client-net.c. M src/lib-program-client/test-program-client-net.c 2021-05-03 23:35:38 +0200 Stephan Bosch (cfb3944760) lib-program-client: Reformat program-client-remote.c. M src/lib-program-client/program-client-remote.c 2021-04-22 12:07:12 +0300 Timo Sirainen (159e07879e) lib-test: Convert test_assert()s to fatal asserts when running static analyzer This avoids unnecessary warnings about unit tests crashing when test_assert()s fail. The warnings are correct, but it's a bit unnecessary to write the failure code paths that nicely. M src/lib-test/test-common.c M src/lib-test/test-common.h 2021-04-26 14:14:45 +0300 Timo Sirainen (e71b8894ab) lib: Perform most of the event logging within data stack frame M src/lib/event-log.c M src/lib/test-event-log.c 2021-04-26 14:13:09 +0300 Timo Sirainen (7fae81da43) lib-storage: Add data stack frames to mail_set_*() This can reduce data stack usage significantly with mail thread building. M src/lib-storage/mail.c 2021-03-31 16:26:00 +0300 Timo Sirainen (6a058be026) lib: data-stack - If frame doesn't change current block, no blocks need to be freed This is a micro-optimization to t_pop() to avoid an extra if-check. M src/lib/data-stack.c 2021-03-31 16:22:24 +0300 Timo Sirainen (68ecc20d7b) lib: data-stack - Use stack_block.left_lowwater only with DEBUG M src/lib/data-stack.c 2021-03-31 16:17:30 +0300 Timo Sirainen (e8942f869c) lib: Remove data_stack_set_clean_after_pop() M src/lib/data-stack.c M src/lib/data-stack.h M src/lib/test-data-stack.c 2021-03-31 16:04:47 +0300 Timo Sirainen (62fa24f787) lib: data-stack - Move frame memory allocation inside data stack block M src/lib/data-stack.c M src/lib/test-data-stack.c 2021-03-31 14:25:47 +0300 Timo Sirainen (158dfdf6ff) lib: data-stack - Replace stack_frame_block with a single stack_frame This simplifies the code at the cost of more memory allocations. However, this will be fixed by the following commit. M src/lib/data-stack.c 2020-11-16 20:54:20 +0200 Timo Sirainen (0e3652c4ea) lib: data-stack - Add data_stack_grow event This is now always enabled, not just in debug builds. M src/lib/data-stack.c M src/lib/data-stack.h M src/lib/lib.c M src/lib/test-data-stack.c 2021-03-31 14:40:12 +0300 Timo Sirainen (aff92930fb) lib: t_get_bytes_available() - Fix return value when current_block is almost full M src/lib/data-stack.c M src/lib/test-data-stack.c 2020-11-16 14:56:50 +0200 Timo Sirainen (f520a62a25) lib-settings: settings_check() - Avoid growing data stack unnecessarily Each check_func() could have increased data stack usage. Add it inside a data stack frame to avoid it growing unnecessarily large. M src/lib-settings/settings-parser.c 2020-11-16 14:58:08 +0200 Timo Sirainen (df4f7032cb) lib: module_dir_*load*(): Avoid growing data stack when checking duplicates This check could have unnecessarily grown data stack size when many plugins are installed. M src/lib/module-dir.c 2020-11-16 19:37:26 +0200 Timo Sirainen (a7ccda0286) global: Use T_END_PASS_STR() where possible M src/config/config-parser.c M src/lib-fs/fs-api.c M src/lib-imap/imap-bodystructure.c M src/lib-mail/mail-user-hash.c M src/lib-mail/message-search.c M src/lib-settings/settings-parser.c M src/lib-sql/driver-cassandra.c M src/lib-sql/driver-sqlpool.c 2020-11-16 18:23:59 +0200 Timo Sirainen (6f68dc6736) lib: data-stack - Add t_pop_pass_str() and T_END_PASS_STR[_IF]() This simplifies passing error strings out of stack frames. For example: const char *error; T_BEGIN { ... if (ret < 0) error = t_strdup_printf("foo() failed: %m"); } T_END_PASS_STR_IF(ret < 0, &error); // error is still valid M src/lib/data-stack.c M src/lib/data-stack.h M src/lib/test-data-stack.c 2021-03-31 11:56:10 +0300 Timo Sirainen (b5b15e1d41) lib: Add data_stack_frame_contains() M src/lib/data-stack.c M src/lib/data-stack.h 2021-03-31 13:19:00 +0300 Timo Sirainen (f0180e7885) lib: Add data_stack_get_alloc_size() M src/lib/data-stack.c M src/lib/data-stack.h 2021-03-31 12:59:29 +0300 Timo Sirainen (b2bb139396) lib: Fix data_stack_get_used_size() to return correct size It only included the last allocated block's used size. M src/lib/data-stack.c 2021-03-31 12:52:47 +0300 Timo Sirainen (1f021a21b1) lib: data-stack - Don't set stack_block.next=NULL after mem_block_alloc() already did it M src/lib/data-stack.c 2021-03-31 12:51:34 +0300 Timo Sirainen (7b1c81b369) lib: data-stack - mem_block_alloc() - Set stack_block.left to final value immediately There's no need to first set it to 0 and then have the caller change it again. M src/lib/data-stack.c 2020-11-17 00:36:27 +0200 Timo Sirainen (6c37802b18) lib: data-stack - Remove unused_frame_blocks It's not that expensive to keep allocating them as needed, and it's a potential waste of memory to keep them around. M src/lib/data-stack.c 2020-11-17 00:32:45 +0200 Timo Sirainen (2da21080db) lib: data-stack - Don't keep largest unused block in memory It's not that expensive to allocate it again, but it might be expensive to keep allocated a block that became huge due to a bug. The huge block could be just wasting memory without ever being used again. M src/lib/data-stack.c 2020-11-16 18:09:44 +0200 Timo Sirainen (59ff832bd1) lib: data-stack - Add unit test for data_stack_set_clean_after_pop() M src/lib/test-data-stack.c 2020-11-16 18:08:57 +0200 Timo Sirainen (8d5c1b2ecb) lib: data-stack - Rename variables in clean_after_pop handling These new variables make more sense than the old ones. M src/lib/data-stack.c 2020-11-16 18:06:55 +0200 Timo Sirainen (c702072ece) lib: data-stack - Rename lowwater to left_lowwater This describes its behavior better. Also add a comment explaining what exactly it is. M src/lib/data-stack.c 2020-11-16 17:57:39 +0200 Timo Sirainen (8a37fc6f68) lib: data-stack - Rename block_space_used[] to block_space_left[] This describes its behavior better. Also add a comment explaining what exactly it is. M src/lib/data-stack.c 2020-11-16 15:25:36 +0200 Timo Sirainen (d3e36b20b1) lib: data-stack - Use INITIAL_STACK_SIZE without growing it to nearest power M src/lib/data-stack.c 2021-03-31 13:13:22 +0300 Timo Sirainen (dda74fe776) global: Never use t_push(NULL) A non-NULL name is expected by the debug logging. M src/lib-master/master-service.c M src/lib/data-stack.c 2021-03-31 13:11:16 +0300 Timo Sirainen (afe3adbd51) lib: Recalculate events' debug logging state after replacing event filters M src/lib/event-log.c M src/lib/event-log.h M src/lib/lib-event-private.h M src/lib/lib-event.c 2021-05-03 19:40:23 +0300 Timo Sirainen (10dbf465e0) lib-index: test-mail-index-sync-ext - Fix memory leak M src/lib-index/test-mail-index-sync-ext.c 2021-04-12 22:43:57 +0200 Stephan Bosch (02de37f6c2) lib-smtp: smtp-server-transaction - Make sure current data command is recorded as soon as possible. This prevents crashes when replies are sent early. This also prevents crashes when invalid DATA commands are sent in succession. M src/lib-smtp/smtp-server-cmd-data.c M src/lib-smtp/smtp-server-recipient.c M src/lib-smtp/smtp-server-transaction.c M src/lib-smtp/test-smtp-server-errors.c 2021-04-12 22:50:48 +0200 Stephan Bosch (b9d41364d0) lib-smtp: smtp-server-transaction - Rename smtp_server_transaction_last_data() to smtp_server_transaction_data_command(). M src/lib-smtp/smtp-server-cmd-data.c M src/lib-smtp/smtp-server-private.h M src/lib-smtp/smtp-server-transaction.c 2021-04-12 22:46:17 +0200 Stephan Bosch (b98ebb2b00) lib-smtp: smtp-server-recipient - Rename smtp_server_recipient_last_data() to smtp_server_recipient_data_command(). M src/lib-smtp/smtp-server-private.h M src/lib-smtp/smtp-server-recipient.c M src/lib-smtp/smtp-server-transaction.c 2021-05-03 14:07:44 +0300 Timo Sirainen (635fb845ea) login-common: Add client.list_type to better track which linked list client belongs to Add asserts to make sure the client is always in the expected list. M src/login-common/client-common.c M src/login-common/client-common.h 2021-04-23 16:43:36 +0300 Timo Sirainen (e619fe552d) login-common: Fix handling destroyed_clients linked list The client needs to be removed from destroyed_clients linked list before it's added to client_fd_proxies linked list. Broken by 1c622cdbe08df2f642e28923c39894516143ae2a M src/login-common/client-common.c 2021-02-06 20:11:14 +0200 Timo Sirainen (1992a4d1d6) lib-index: test-mail-index-sync-ext - Fix to link with the full libindex M src/lib-index/Makefile.am M src/lib-index/test-mail-index-sync-ext.c 2021-02-02 17:41:28 +0200 Timo Sirainen (37a5735c2d) lib-index: Add/update comments related to cloning maps M src/lib-index/mail-index-map.c M src/lib-index/mail-index-private.h M src/lib-index/mail-index-sync-update.c 2021-02-02 17:25:33 +0200 Timo Sirainen (b249bb724c) lib-index: Don't call mail_index_modseq_sync_map_replaced() if nothing changed M src/lib-index/mail-index-sync-update.c 2021-02-02 16:13:50 +0200 Timo Sirainen (e274d915fc) lib-index: Add comments to struct mail_transaction_log and related M src/lib-index/mail-transaction-log-private.h 2021-02-02 16:13:01 +0200 Timo Sirainen (4c74469147) lib-index: Rename MAIL_TRANSACTION_LOG_LOCK_CHANGE_TIMEOUT to .._DOTLOCK_.. M src/lib-index/mail-transaction-log-private.h M src/lib-index/mail-transaction-log.c 2021-02-02 16:02:58 +0200 Timo Sirainen (f309a14f3d) lib-index: Rename mail_transaction_log_file.lock_created to lock_create_time M src/lib-index/mail-transaction-log-file.c M src/lib-index/mail-transaction-log-private.h M src/lib-index/mail-transaction-log.c 2021-02-02 15:59:34 +0200 Timo Sirainen (7eb8a13552) lib-index: Move mail_transaction_log_file_get_modseq_next_offset() to its own file This nicely isolates the modseq_cache code to its own file. M src/lib-index/Makefile.am M src/lib-index/mail-transaction-log-file.c A src/lib-index/mail-transaction-log-modseq.c 2021-02-02 15:26:08 +0200 Timo Sirainen (52fb040144) lib-index: Remove unused mail_transaction_log_file.saved_tail_sync_offset Shrinking tail_offsets have been ignored since 082e82792b8ac33ad42beac510441b37a3c50737 M src/lib-index/mail-transaction-log-file.c M src/lib-index/mail-transaction-log-private.h 2021-02-02 15:24:53 +0200 Timo Sirainen (f2a5850203) lib-index: Rename mail_transaction_log_file.saved_tail_offset to last_read_hdr_tail_offset This describes better what it's actually used for. M src/lib-index/mail-transaction-log-append.c M src/lib-index/mail-transaction-log-file.c M src/lib-index/mail-transaction-log-private.h M src/lib-index/mail-transaction-log.c 2021-02-02 15:07:02 +0200 Timo Sirainen (9a2f2a1149) lib-index: Remove mail_transaction_log.nfs_flush Just access it via mail_index.flags like it's done elsewhere. M src/lib-index/mail-transaction-log-file.c M src/lib-index/mail-transaction-log-private.h M src/lib-index/mail-transaction-log.c 2021-02-02 14:59:02 +0200 Timo Sirainen (751e99be42) lib-index: Rename mail_transaction_log.dotlock_count to dotlock_refcount Also change it to a signed integer and add asserts to make sure it's >=0. This is how refcounts are handled generally in Dovecot. M src/lib-index/mail-transaction-log-file.c M src/lib-index/mail-transaction-log-private.h 2021-02-01 23:05:50 +0200 Timo Sirainen (63cf1888d1) lib-index: Update mail caching decisions explanation comment. M src/lib-index/mail-cache-decisions.c 2021-02-01 22:30:27 +0200 Timo Sirainen (f7ab72fd4e) lib-index: Add test-mail-cache-fields unit test M src/lib-index/Makefile.am A src/lib-index/test-mail-cache-fields.c 2021-02-01 22:11:11 +0200 Timo Sirainen (ea548e9c48) lib-index: Add comments to struct mail_cache and related Also reorder some fields so the grouping makes more sense. M src/lib-index/mail-cache-fields.c M src/lib-index/mail-cache-private.h M src/lib-index/mail-cache.h 2021-01-25 21:10:32 +0200 Timo Sirainen (67b438b599) lib-index: Add comments to struct mail_cache_header and related M src/lib-index/mail-cache-private.h M src/lib-index/mail-cache.h 2021-01-29 19:11:36 +0200 Timo Sirainen (cf1c443ca8) lib-index: Add comments to mail-transaction-log.h M src/lib-index/mail-transaction-log.h 2021-01-25 23:06:59 +0200 Timo Sirainen (d13f33d7a9) lib-index: Update mail_index_mail_flags comments and add MAIL_INDEX_MAIL_FLAG_UNUSED M src/lib-index/mail-index.h 2021-01-25 22:42:37 +0200 Timo Sirainen (9a71b83bdd) lib-index: Add comments to struct mail_index_ext_header and related M src/lib-index/mail-index-private.h M src/lib-index/mail-transaction-log.h 2021-01-25 22:10:29 +0200 Timo Sirainen (f18d48f83f) lib-index: Add comments to struct mail_index_header and related M src/lib-index/mail-index.h 2021-01-20 19:22:06 +0200 Timo Sirainen (60db30ce31) lib-index: Add comments to struct mail_index_view M src/lib-index/mail-index-view-private.h 2021-01-20 19:21:10 +0200 Timo Sirainen (52ae13770e) lib-index: Add comments and reorder fields in struct mail_index The field ordering was pretty random for some fields. The new ordering should make more sense. M src/lib-index/mail-index-private.h 2021-01-20 18:43:27 +0200 Timo Sirainen (382fe4cf01) lib-index: Rename mail_index.pending_log2_rotate_time to hdr_log2_rotate_time_delayed_update This describes better what it does. Also add some comments explaining what its purpose is. M src/lib-index/mail-index-private.h M src/lib-index/mail-index-sync.c M src/lib-index/mail-transaction-log.c 2021-02-06 21:00:58 +0200 Timo Sirainen (ffe862c746) lib-index: mail_index_expunge_handler_t - Remove seq and context parameters They're not actually used anywhere. M src/lib-index/mail-cache-private.h M src/lib-index/mail-cache-sync-update.c M src/lib-index/mail-cache.c M src/lib-index/mail-index-private.h M src/lib-index/mail-index-sync-ext.c M src/lib-index/mail-index-sync-update.c M src/lib-index/mail-index.c 2021-01-25 22:44:17 +0200 Timo Sirainen (7943d5ec25) lib-index: mail_index_register_expunge_handler() - Remove call_always handling It's not needed anymore. M src/lib-index/mail-cache.c M src/lib-index/mail-index-private.h M src/lib-index/mail-index-sync-ext.c M src/lib-index/mail-index.c 2021-01-20 18:17:27 +0200 Timo Sirainen (5068447559) lib-index: Remove "sync lost" callback handlers These were used to invalidate in-memory dovecot.index.cache cache with mmap_disable=yes. This became unnecessary when cache file became append-only. M src/lib-index/mail-index-map-read.c M src/lib-index/mail-index-private.h M src/lib-index/mail-index.c 2021-01-20 18:07:33 +0200 Timo Sirainen (15aea21ba8) lib-index: Move fields from struct mail_index to struct mail_index_error This clarifies which are error related fields. nodiskspace isn't actually currently used for anything, but it seems potentially useful in the future. M src/lib-index/mail-index-private.h M src/lib-index/mail-index-strmap.c M src/lib-index/mail-index.c 2021-01-20 18:04:40 +0200 Timo Sirainen (ba11772d6e) lib-index: Use mail_index_reset_error() when opening index This resets the error more cleanly than changing nodiskspace directly. M src/lib-index/mail-index.c 2021-01-20 18:01:03 +0200 Timo Sirainen (25d5331503) lib-index: Remove mail_index.index_lock_timeout Nothing needs it. M src/lib-index/mail-index-private.h M src/lib-index/mail-index.c M src/lib-index/mail-transaction-log-file.c 2021-01-20 17:54:49 +0200 Timo Sirainen (2f0a0e87b2) lib-index: Move fields from struct mail_index to struct mail_index_settings This clarifies which fields are settings related. M src/lib-index/mail-cache-purge.c M src/lib-index/mail-cache-transaction.c M src/lib-index/mail-cache.c M src/lib-index/mail-index-lock.c M src/lib-index/mail-index-private.h M src/lib-index/mail-index-strmap.c M src/lib-index/mail-index-transaction-export.c M src/lib-index/mail-index-write.c M src/lib-index/mail-index.c M src/lib-index/mail-transaction-log-append.c M src/lib-index/mail-transaction-log-file.c M src/lib-index/mail-transaction-log.c 2021-01-20 17:35:20 +0200 Timo Sirainen (706709e677) lib-index: Remove mail_index_view.index_sync_view Nothing was using it. M src/lib-index/mail-index-sync.c M src/lib-index/mail-index-view-private.h 2021-01-20 17:34:01 +0200 Timo Sirainen (920b0ad025) lib-index: Remove mail_index_view.transactions and related functions It's enough to have transaction_list, nothing needs the count. M src/lib-index/mail-index-private.h M src/lib-index/mail-index-transaction.c M src/lib-index/mail-index-view-private.h M src/lib-index/mail-index-view-sync.c M src/lib-index/mail-index-view.c 2021-01-20 17:31:36 +0200 Timo Sirainen (ab3f44539b) lib-index: Change mail_index_view_get_transaction_count() into _have_transactions() This allows removing mail_index_view.transactions in the next commit. M src/lib-index/mail-index-view.c M src/lib-index/mail-index.h M src/lib-storage/index/dbox-multi/mdbox-map.c 2021-01-20 17:22:20 +0200 Timo Sirainen (09a5aeb327) lib-index: Rename mail_index.last_read_log_* to main_index_hdr_log_* Also update the comment to describe better what the variables do. M src/lib-index/mail-index-map-read.c M src/lib-index/mail-index-private.h M src/lib-index/mail-index-sync.c M src/lib-index/mail-index-write.c 2021-01-19 12:51:07 +0200 Timo Sirainen (1eea5d4468) lib-index: Remove mail_index_map.hdr_base It was just causing unnecessary complexity. Simpler to just keep hdr_copy_buf always up-to-date and access it directly. M src/lib-index/mail-index-fsck.c M src/lib-index/mail-index-map-read.c M src/lib-index/mail-index-map.c M src/lib-index/mail-index-modseq.c M src/lib-index/mail-index-private.h M src/lib-index/mail-index-sync-ext.c M src/lib-index/mail-index-sync-keywords.c M src/lib-index/mail-index-sync-update.c M src/lib-index/test-mail-index-write.c 2021-01-29 17:45:45 +0200 Timo Sirainen (6383fd8538) lib-index: MAIL_TRANSACTION_LOG_VERSION_* - Add also FEATURE_ suffix for feature macros This more clearly differentiates them from the other MAIL_TRANSACTION_LOG_VERSION_* macros M src/lib-index/mail-transaction-log.h 2021-01-29 17:03:34 +0200 Timo Sirainen (c697dd10a1) lib-index: Verify that keywords in dovecot.index header don't change unexpectedly Previously this was behind DEBUG for performance reasons, but that was only because dovecot.index file used to be modified directly. Nowadays it's rare that the index is being re-read within the same session (most changes are read via dovecot.index.log), so it's better to verify that things are working correctly. M src/lib-index/mail-index-map-hdr.c 2021-01-19 12:48:16 +0200 Timo Sirainen (d71c7b5cf2) lib-index: Add and use MAIL_INDEX_MAP_HDR_OFFSET() helper macro M src/doveadm/doveadm-dump-index.c M src/lib-index/mail-index-fsck.c M src/lib-index/mail-index-map-hdr.c M src/lib-index/mail-index-map.c M src/lib-index/mail-index-modseq.c M src/lib-index/mail-index-private.h M src/lib-index/mail-index-sync-keywords.c M src/lib-index/mail-index-view.c M src/lib-index/mail-index-write.c 2021-01-19 12:42:02 +0200 Timo Sirainen (55f8474dbf) lib-index: Fill mail_index_map.hdr_copy_buf also when mmap()ing index This doesn't seem to have been necessary so far, but will be required by the following changes. M src/lib-index/mail-index-map-read.c 2021-05-03 13:15:17 +0300 Timo Sirainen (7031569672) imap: Fix using SETMETADATA NIL to unset value Broken by 923362d27d9b2428e301614673cb0efba3bf928f M src/imap/cmd-setmetadata.c 2021-04-22 11:36:40 +0300 Timo Sirainen (28ca2bb152) master: Explain how "client_limit is lower than required" is calculated in the warning M src/config/settings-get.pl M src/master/master-settings.c 2021-04-21 10:41:27 -0400 Josef 'Jeff' Sipek (a200c09711) stats: Use only one filter for stats and exports Since there is no way to have a exported-only metric (i.e., all metrics are used for statistics calculations), the exported metrics are always a subset of all metrics. Additionally, since exported metrics have a non-NULL exporter info while stats-only metrics have a NULL, it is very easy to check if a given metric shoud be exported or not. We can combine these facts and simplify the event matching. We can simply match against the "all metrics" filter, perform the statistics, and then export the event if needed. This reduces the CPU load quite dramatically since we are no longer duplicating the matching for exported metrics. Stats-only metrics shouldn't see any measurable difference in performance. M src/stats/stats-metrics.c 2021-04-21 11:50:54 -0400 Josef 'Jeff' Sipek (32cb941a17) lib: event filter - Extend existing queries if context matches (event_filter_parse) Since there is no practical difference between a filter with one query and a filter with multiple queries using the same context pointer, we can extend the existing queries as long as there is a context pointer match. This reduces the number of queries (and filter expressions) thereby increasing future optimization opportunities. M src/lib/event-filter.c 2021-04-21 11:47:51 -0400 Josef 'Jeff' Sipek (12507668f7) lib: event filter - Extend existing queries if context matches (event_filter_merge_with_context*) Since there is no practical difference between a filter with one query and a filter with multiple queries using the same context pointer, we can extend the existing queries as long as there is a context pointer match. This reduces the number of queries (and filter expressions) thereby increasing future optimization opportunities. M src/lib/event-filter.c 2021-04-21 11:42:55 -0400 Josef 'Jeff' Sipek (1115aeff8b) lib: event filter - Extend existing queries if context matches (event_filter_add) Since there is no practical difference between a filter with one query and a filter with multiple queries using the same context pointer, we can extend the existing queries as long as there is a context pointer match. This reduces the number of queries (and filter expressions) thereby increasing future optimization opportunities. M src/lib/event-filter.c 2021-04-21 11:52:27 -0400 Josef 'Jeff' Sipek (c18107397c) lib: event filter - Move add_node higher up in the file to avoid a prototype M src/lib/event-filter.c 2021-04-21 11:37:31 -0400 Josef 'Jeff' Sipek (725c7bdec7) lib: event filter - Add filter op argument to add_node M src/lib/event-filter.c 2021-04-21 11:19:31 -0400 Josef 'Jeff' Sipek (d8d2f0ea3c) lib: event filter - Generalize query construction helpers If instead of taking the internal query, they take a filter expression node, they can be reused by optimizations in subsequent commits. M src/lib/event-filter.c 2021-04-26 19:49:22 +0300 Timo Sirainen (714fb52a99) lib: Rename event_find_field() to event_find_field_nonrecursive() and make it public M src/lib/lib-event.c M src/lib/lib-event.h 2021-03-16 19:13:23 +0200 Timo Sirainen (b3460178be) lib: Reformat lib-event to avoid long lines M src/lib/lib-event.c M src/lib/lib-event.h 2021-03-16 19:09:06 +0200 Timo Sirainen (07437af0e5) lib: Rename event_find_field*() to event_find_field_recursive*() This clarifies how it works. M src/auth/test-auth-request-fields.c M src/lib-dict/dict.c M src/lib/event-filter.c M src/lib/lib-event.c M src/lib/lib-event.h M src/lib/test-event-filter-expr.c M src/lib/test-event-filter.c M src/stats/event-exporter-fmt-json.c M src/stats/event-exporter-fmt-tab-text.c M src/stats/stats-metrics.c 2021-03-16 18:26:20 +0200 Timo Sirainen (30fd8eada2) lib: event_find_field() - Rewrite without using recursion This simplifies the following change. M src/lib/lib-event.c 2021-03-09 16:32:35 +0200 Timo Sirainen (f9177a5788) lib: event_match_field() - Avoid recursing event fields twice event_find_field() is already recursive. M src/lib/event-filter.c 2021-03-09 16:31:20 +0200 Timo Sirainen (012a453862) lib: Split off event_has_category_nonrecursive() M src/lib/event-filter.c 2021-03-11 18:55:21 +0200 Timo Sirainen (66d3263685) lib-master: test-event-stats - Fix "large event id" test to check for END Otherwise the END would be visible in the next test. M src/lib-master/test-event-stats.c 2021-03-11 18:29:45 +0200 Timo Sirainen (a6437c7668) lib-master: test-event-stats - Avoid busy-looping while waiting for "test done" file M src/lib-master/test-event-stats.c 2021-01-27 10:55:14 +0200 Aki Tuomi (c0f394fe76) lib: event importing - Do not accept empty field name M src/lib/lib-event.c 2020-12-15 09:15:56 +0200 Aki Tuomi (e3bd0f78e1) lib: lib-event - Use named initializators for passthrough event M src/lib/lib-event.c 2021-04-26 15:39:36 +0300 Aki Tuomi (94f8661813) m4: Include local copy of pkg.m4 We need features not present in early versions. The variable=name support has been there since 1.7.4 of pkg-config. M configure.ac A m4/pkg.m4 2021-04-21 19:18:07 +0300 Timo Sirainen (0b49075d90) lib-storage: Avoid logging the same mail istream read error multiple times M src/lib-storage/index/index-mail.c M src/lib-storage/index/index-mail.h 2021-04-26 12:02:58 +0300 Aki Tuomi (226d78ac75) master: Notify systemd after we are really stopped M src/master/main.c 2021-04-26 08:39:50 +0300 Aki Tuomi (2465a431d4) Makefile.am: Fix systemd detection mess in automake M Makefile.am M configure.ac A m4/want_systemd.m4 2021-04-26 08:29:02 +0300 Aki Tuomi (8df32a724b) dovecot.service: Set type to notify only when compiling with systemd M Makefile.am M configure.ac M dovecot.service.in 2021-04-26 08:38:14 +0300 Aki Tuomi (599271fcc1) Makefile.am: Make systemd service file generation more readable M Makefile.am 2021-04-26 09:38:44 +0300 Aki Tuomi (2353fd43af) configure.ac: Move CFLAGS to right place Now it's in middle of passdb displaying M configure.ac 2021-03-24 16:09:51 +0200 Timo Sirainen (eb6509f963) lib-storage: Fix detecting duplicate nodes in mailbox list index The duplicates were checked only for root nodes, not for child nodes. M src/lib-storage/list/mailbox-list-index.c 2021-04-08 17:08:54 +0100 Siavash Tavakoli (49f4107082) driver-mysql: Rollback a failed multi-statement transaction If transaction failed, send "ROLLBACK" statement. M src/lib-sql/driver-mysql.c 2021-04-07 16:44:00 +0100 Siavash Tavakoli (0795e4cc62) driver-mysql: Avoid BEGIN/COMMIT for single statement transactions To reduce unnecessary load to database. M src/lib-sql/driver-mysql.c 2021-04-01 20:39:27 +0300 Timo Sirainen (0f66865e0e) lib-imap: imap_bodystructure_write() - Return error on corruption instead of assert-crash This could happen if broken message_parts came from cache and message_part->data was newly read from the mail input. M src/lib-imap-storage/imap-msgpart.c M src/lib-imap/fuzz-imap-bodystructure.c M src/lib-imap/imap-bodystructure.c M src/lib-imap/imap-bodystructure.h M src/lib-imap/test-imap-bodystructure.c M src/lib-storage/index/imapc/imapc-mail-fetch.c M src/lib-storage/index/index-mail.c 2021-04-08 15:04:42 +0300 Timo Sirainen (4db18b7413) lib-storage: Split off index_mail_parse_bodystructure_full() M src/lib-storage/index/index-mail.c 2021-04-09 14:09:17 +0300 Timo Sirainen (12ae2af6ac) lib-imap: fuzz-imap-bodystructure - Change failures to i_panic() instead of i_fatal() M src/lib-imap/fuzz-imap-bodystructure.c 2021-03-04 09:52:40 +0200 Aki Tuomi (641cfdb62a) NEWS: Mention XZ/LZMA removal. M NEWS 2021-03-02 10:55:53 +0200 Aki Tuomi (b2f9c2f538) NEWS: Update news for 2.3.14 M NEWS 2021-03-30 21:12:41 +0200 Stephan Bosch (a5209c83c3) lib-smtp: smtp-params - Make explicit which extra parameters can be written by smtp_params_*_write(). This can be used to prevent sending unsupported parameters to the remote server, even when these are listed in extra_parameters. Before, blindly proxying parameters would cause MAIL/RCPT error replies from the remote server. M src/lib-smtp/smtp-client-command.c M src/lib-smtp/smtp-params.c M src/lib-smtp/smtp-params.h M src/lib-smtp/test-smtp-params.c 2021-03-30 21:06:58 +0200 Stephan Bosch (4987b516aa) lib-smtp: smtp-client-connection - Explicitly specify which MAIL/RCPT parameters are added by extra capabilities. This is used in later commit to limit which custom parameters are actually sent to the server based on the capabilities supported by said server. M src/lib-smtp/smtp-client-connection.c M src/lib-smtp/smtp-client-private.h M src/lib-smtp/smtp-client.h M src/lmtp/lmtp-proxy.c 2021-03-30 21:48:24 +0200 Stephan Bosch (b37ecc4f02) lib-smtp: smtp-client-connection - Prevent recording extra capabilities from server more than once. M src/lib-smtp/smtp-client-connection.c 2021-03-30 21:45:33 +0200 Stephan Bosch (8bf233ddf3) lib-smtp: smtp-client-connection - Prevent duplicate registrations for extra capabilities. M src/lib-smtp/smtp-client-connection.c 2021-03-31 12:33:38 +0200 Stephan Bosch (47203e9f30) lib-smtp: smtp-client-connection - Move smtp_client_connection_find_extra_capability(). M src/lib-smtp/smtp-client-connection.c 2021-03-30 21:33:17 +0200 Stephan Bosch (af677f5b78) lib-smtp: smtp-client-connection - Change extra capability registration to use a struct. This is needed for adding additional features in later commit. M src/lib-smtp/smtp-client-connection.c M src/lib-smtp/smtp-client-connection.h M src/lib-smtp/smtp-client-private.h M src/lib-smtp/smtp-client.h M src/lmtp/lmtp-proxy.c 2021-03-30 21:41:48 +0200 Stephan Bosch (1a77fca29f) lib-smtp: smtp-client-connection - Fix typo in function name. M src/lib-smtp/smtp-client-connection.c 2021-03-31 00:06:29 +0200 Stephan Bosch (985f21ad5a) lmtp: lmtp-commands - Drop XRCPTFORWARD parameter once processed. This prevents it from popping up elsewhere. This for example crudely fixes a problem in the proxy where XRCPTFORWARD was sent even without backend server support. M src/lmtp/lmtp-commands.c 2021-04-19 12:46:44 +0300 Timo Sirainen (cdbb581436) imap: NOTIFY - Fix crash if client disconnects while sending FETCH notification (try #2) Continues the incomplete fix for c4f4058d16096f23eea0b3182205d6653f5954dd Fixes: Panic: Trying to close mailbox INBOX with open transactions M src/imap/imap-client.c 2021-04-16 16:13:39 +0300 Timo Sirainen (673a9e1d17) login-common: Fix memory leak if anvil query is aborted M src/login-common/client-common.h M src/login-common/sasl-server.c 2021-04-16 11:18:15 +0300 Aki Tuomi (50b5ee12db) virtual: virtual-mail - Use index_mail_set_seq to ensure cleanup Forgotten in 67ab2070cf513179382b564871f2a0f177987cc9 M src/plugins/virtual/virtual-mail.c 2021-04-16 11:16:36 +0300 Aki Tuomi (0cd683c086) virtual: virtual-mail - Pass wanted_headers and wanted_fields to backend mails only Broken in 67ab2070cf513179382b564871f2a0f177987cc9 M src/plugins/virtual/virtual-mail.c 2021-04-16 10:01:45 +0300 Aki Tuomi (e5098ff2b0) virtual: virtual-mail - Use index_mail_free Since we are using index_mail_init, we need to use index_mail_free to free up the virtual mail. M src/plugins/virtual/virtual-mail.c 2021-04-16 10:24:22 +0300 Aki Tuomi (df46da1ace) virtual: virtual-mail - Free wanted headers in close if we are freeing Simplifies next change M src/plugins/virtual/virtual-mail.c 2021-04-16 10:03:33 +0300 Aki Tuomi (448330c320) virtual: virtual-mail - Free up mails in virtual_mail_close if we are freeing up Makes next change easier M src/plugins/virtual/virtual-mail.c 2021-04-14 18:08:03 +0300 Timo Sirainen (829b04676c) lib: Add comment to CALLBACK_TYPECHECK() macro M src/lib/macros.h 2021-03-31 03:08:26 +0100 Siavash Tavakoli (0d252dccb3) lib-index: Add "mail_cache_lookup" event Adds new event for cache lookups with lookup name as "field" event field. M src/lib-index/mail-cache-lookup.c 2021-03-31 17:28:46 +0100 Siavash Tavakoli (fa7a490bc3) lib-index: Small refactor in mail_cache_lookup_field() Makes it easier to emit event in next commit regardless of code path. M src/lib-index/mail-cache-lookup.c 2021-03-30 00:37:59 +0100 Siavash Tavakoli (d6ceec7f3a) lib-storage: Add "mail_expunged" event Emitted when a message is actually expunged. Has UID as a field. M src/lib-storage/mail-storage.c 2021-03-29 13:41:55 +0100 Siavash Tavakoli (d5fe1b3c75) lib-storage, plugins/virtual: Use mail_sync_notify() Instead of calling sync_notify vfunc directly. M src/lib-storage/index/dbox-multi/mdbox-sync.c M src/lib-storage/index/dbox-single/sdbox-sync.c M src/lib-storage/index/imapc/imapc-sync.c M src/lib-storage/index/maildir/maildir-sync-index.c M src/lib-storage/index/mbox/mbox-sync.c M src/plugins/virtual/virtual-sync.c 2021-03-29 13:41:32 +0100 Siavash Tavakoli (8f9b9731e6) lib-storage: Add mailbox_sync_notify() Instead of calling sync_notify vfunc directly everywhere. M src/lib-storage/mail-storage-private.h M src/lib-storage/mail-storage.c 2021-03-29 13:01:40 +0100 Siavash Tavakoli (0972d42cdb) lib-storage: Emit "mail_expunge_requested" event Adds a new event, "mail_expunge_requested" which is emitted when a message is marked to being expunged. M src/lib-storage/mail-storage-private.h M src/lib-storage/mail.c 2021-02-10 13:57:08 +0200 Aki Tuomi (c8fa10672b) lib-storage: Emit "mail_opened" event when mails opened Adds a new event, "mail_opened" with "reason" as field. Also drop duplicate event in index_mail_init_stream(). M src/lib-storage/index/index-mail.c M src/lib-storage/mail-storage-private.h M src/lib-storage/mail.c 2021-04-06 00:38:06 +0100 Siavash Tavakoli (9a8449d815) lib-storage: Include "age_days" field in mail.event Goes back one week, if mail age information is known, an integer field is added with value of mail age in number of days. M src/lib-storage/index/index-mail.c 2021-03-31 16:08:06 +0100 Siavash Tavakoli (67ab2070cf) plugins/virtual: Use index_mail_init() to initialize the mail Cleans up duplicated code. Also, index_mail_init initializes mail.event as well. Something that was missing previously. M src/plugins/virtual/virtual-mail.c 2021-03-31 16:01:02 +0100 Siavash Tavakoli (3fe38329a9) lib-storage: Refactor index_mail_init() to make it more reusable Adds arguments for two memory pools, to be set for mail.pool and mail.data_pool. If data_pool is NULL, a pool is allocated but mail_pool is required. M src/lib-storage/index/dbox-common/dbox-mail.c M src/lib-storage/index/imapc/imapc-mail.c M src/lib-storage/index/index-mail.c M src/lib-storage/index/index-mail.h M src/lib-storage/index/pop3c/pop3c-mail.c 2021-03-11 14:14:53 +0200 Timo Sirainen (5dd81f98a9) lib-storage: Recreate mail.event when active mail is changed This makes sure that the two mails' events are treated completely independently without any accidental spilling. It also prevents wasting memory if each mail changes the event and grows the memory pool. M src/lib-storage/index/index-mail.c 2021-04-12 21:18:05 +0200 Stephan Bosch (4d76fa500b) lib-smtp: fuzz-smtp-server - Implement all callbacks required for full transaction. Before required RCPT and DATA callbacks were omitted, causing assertion failures when the fuzzer reached the RCPT stage. M src/lib-smtp/fuzz-smtp-server.c 2021-04-12 21:14:07 +0200 Stephan Bosch (99b3f881f8) lib-test: fuzzer - Fix FD-based fuzzing to only shutdown input FD upon end of data. Before, it closed the whole socket once the data input ended. This for example caused the SMTP server fuzzer to end before all replies were sent. This shortened the test and could have hidden bugs that occur later in the SMTP transaction. M src/lib-test/fuzzer.c M src/lib-test/fuzzer.h 2021-04-12 21:12:27 +0200 Stephan Bosch (d14c6b5e52) lib-smtp: smtp-reply - Add debug message for reply send error. This makes it a little clearer at what point the connection loss or error was noticed and for which command/reply. M src/lib-smtp/smtp-server-reply.c 2021-04-14 11:57:39 +0300 Timo Sirainen (6a3b1ac4fb) lib-lua: Fix compiler warning with dlua_pcall_yieldable() M src/lib-lua/dlua-script-private.h 2021-04-09 11:35:05 +0200 Markus Valentin (c3fc5c9060) lib-storage: Make sure listescape can work correctly with shared namespaces This makes sure that if storage_name_escape_char is set, shared mailboxes do not return the invalid/unescaped mailbox storage_name internally which could result in failures like "Invalid mailbox name: Name must not have '/' character" even when using the listescape plugin. Broken by 5fd5ad3a2be6708e81f8dcfcbb06a3957dddd276 M src/lib-storage/mailbox-list.c 2021-04-01 21:42:02 +0300 Timo Sirainen (1d9b4e1400) lib: Fix buffer_t aliasing problems with LTO This changes the buffer_t slightly, which requires adding extra braces when buffer_t contents are directly defined. This changes Dovecot to require C11 compatible compiler, because it uses anonymous union and struct. GNU99 extensions are also enough. M src/anvil/anvil-settings.c M src/auth/auth-settings.c M src/config/config-settings.c M src/config/settings-get.pl M src/dict/dict-settings.c M src/director/director-settings.c M src/dns/dns-client-settings.c M src/doveadm/doveadm-settings.c M src/imap-hibernate/imap-hibernate-settings.c M src/imap-login/imap-login-settings.c M src/imap-urlauth/imap-urlauth-login-settings.c M src/imap-urlauth/imap-urlauth-settings.c M src/imap-urlauth/imap-urlauth-worker-settings.c M src/imap/imap-settings.c M src/indexer/indexer-settings.c M src/indexer/indexer-worker-settings.c M src/ipc/ipc-settings.c M src/lib/buffer.c M src/lib/buffer.h M src/lib/test-buffer.c M src/lmtp/lmtp-settings.c M src/log/log-settings.c M src/old-stats/stats-settings.c M src/plugins/fts-lucene/Snowball.cc M src/plugins/fts-lucene/lucene-wrapper.cc M src/pop3-login/pop3-login-settings.c M src/pop3/pop3-settings.c M src/replication/aggregator/aggregator-settings.c M src/replication/replicator/replicator-settings.c M src/stats/stats-settings.c M src/submission-login/submission-login-settings.c M src/submission/submission-settings.c 2021-04-01 21:37:27 +0300 Timo Sirainen (4e5bb6738d) lib: buffer - Change real_buffer.r_buffer type to const void * M src/lib/buffer.c 2021-04-01 12:47:15 +0300 Timo Sirainen (831c95f67d) imap: Fix accessing uninitialized variable warning with LTO There doesn't seem to be any other way to quiet this warning, although it's wrong. M src/imap/imap-master-client.c 2021-04-01 12:45:39 +0300 Timo Sirainen (21bb5d5224) doveadm dict: Handle missing parameters without crashing M src/doveadm/doveadm-dict.c 2021-04-01 12:20:46 +0300 Timo Sirainen (7831a1f082) global: Fix accessing uninitialized variables on unit test failures M src/lib-index/test-mail-index-modseq.c M src/lib/test-strnum.c M src/lib/test-time-util.c 2021-04-01 12:33:33 +0300 Timo Sirainen (7da0d129c5) lib-imap: imap_envelope_parse() - Refactor to avoid LTO warnings The original code was correct, but gcc with LTO still gave warnings about potentially uninitialized envlp_r and error_r. M src/lib-imap/imap-envelope.c 2021-04-01 12:22:37 +0300 Timo Sirainen (a879354bbf) lib: test-array - Fix LTO compiler warnings -flto correctly realizes that the source buffer size is 1, while memcpy() is trying to copy UINT_MAX. Try to hide this by allocating the source buffer dynamically. The intention is to assert-crash anyway before the memcpy() is reached. M src/lib/test-array.c 2021-04-13 12:45:45 +0300 Aki Tuomi (7473d1c11e) lib-compression: ostream-zstd - Do not return 0 as default This is accepted by the library but does complicate things with dovecot. M src/lib-compression/ostream-zstd.c 2021-04-13 12:45:23 +0300 Aki Tuomi (3fd17f53c9) lib-compression: ostream-zstd - Fix assert on value range M src/lib-compression/ostream-zstd.c 2021-04-10 13:52:15 +0200 Arjen de Korte (397ca180b8) doc/openssl.cnf: Increase default_bits to 2048 NIST guidelines mandate that all SSL certificates must be of at least 2048 key length M doc/dovecot-openssl.cnf 2021-03-26 14:10:37 +0200 Aki Tuomi (096b7122b9) global: Update default TLS protocol to TLSv1.2 M doc/example-config/conf.d/10-ssl.conf M src/lib-master/master-service-ssl-settings.c M src/lib-storage/mail-storage-settings.c 2021-04-06 15:42:22 +0300 Aki Tuomi (9301b1042b) lib-ssl-iostream: Accept TLS version case-insensitive M src/lib-ssl-iostream/iostream-openssl-common.c 2021-03-26 14:11:48 +0200 Aki Tuomi (585e09f4d7) lib-ssl-iostream: Add additional supported protocols ANY - Any protocol version accepted TLSv1.3 - Self-explanatory LATEST - The newest protocol only M src/lib-ssl-iostream/iostream-openssl-common.c 2021-03-26 12:08:40 +0200 Aki Tuomi (57aa5d271f) lib-master: Add ssl_cipher_suites M src/lib-master/master-service-ssl-settings.c M src/lib-master/master-service-ssl-settings.h M src/lib-storage/mail-storage-settings.c M src/lib-storage/mail-storage-settings.h 2021-04-01 12:41:40 +0300 Aki Tuomi (4b8d368a91) imap-zlib: Support per-algorithm compression level M src/config/old-set-parser.c M src/plugins/imap-zlib/imap-zlib-plugin.c 2021-03-30 19:05:42 +0300 Aki Tuomi (46eb5a53d1) zlib: Check that compression level is within supported range M src/plugins/zlib/zlib-plugin.c 2021-03-30 19:04:31 +0300 Aki Tuomi (d4d2eec8a4) imap-zlib: Check that compression level is within supported range M src/plugins/imap-zlib/imap-zlib-plugin.c 2021-03-30 19:03:30 +0300 Aki Tuomi (9b420dde6e) fs-compress: Check that compression range is within supported range M src/plugins/fs-compress/fs-compress.c 2021-04-01 09:26:10 +0300 Aki Tuomi (97628ea00b) lib-compression: Implement min/default/max getters M src/lib-compression/compression.c M src/lib-compression/ostream-bzlib.c M src/lib-compression/ostream-lz4.c M src/lib-compression/ostream-zlib.c M src/lib-compression/ostream-zlib.h M src/lib-compression/ostream-zstd.c 2021-03-30 19:01:20 +0300 Aki Tuomi (250a7ea9db) lib-compression: Add compression level range to handlers M src/lib-compression/compression.h 2021-03-30 18:54:42 +0300 Aki Tuomi (fa63cbcd70) lib-compression: Use designated initializers for compression handlers M src/lib-compression/compression.c 2021-04-01 09:51:09 +0300 Aki Tuomi (ca81d36252) m4: want_zstd.m4 - Detect is ZSTD_minCLevel is present M m4/want_zstd.m4 2021-02-05 14:48:52 -0500 Josef 'Jeff' Sipek (0a81b9bccb) lib-compression: Be explicit about xz magic number including a \0 M src/lib-compression/compression.c 2021-04-09 01:49:21 +0200 Stephan Bosch (4e55a32d71) lib-smtp: test-smtp-server-errors - Add actual HELO tests to "bad HELO" test. Before, it only tested the EHLO command. M src/lib-smtp/test-smtp-server-errors.c 2021-04-09 01:43:38 +0200 Stephan Bosch (642ecfa43e) lib-smtp: test-smtp-server-errors - Add correct command test to "bad HELO" test. M src/lib-smtp/test-smtp-server-errors.c 2021-04-09 01:25:59 +0200 Stephan Bosch (b3a21d8622) lib-smtp: test-smtp-server-errors - Properly check server reply in "bad HELO" test. M src/lib-smtp/test-smtp-server-errors.c 2021-04-09 01:29:06 +0200 Stephan Bosch (f97765d1b7) lib-smtp: test-smtp-server-errors - Rename "bad EHLO" test to "bad HELO". M src/lib-smtp/test-smtp-server-errors.c 2020-09-11 21:08:03 +0200 Stephan Bosch (896f120709) lib-smtp: smtp-server-cmd-helo - Fix panic occurring for default HELO reply. This only fails for the HELO command; the EHLO command is unaffected. The default reply routine is not actually used at the moment, but it is used by the fuzzer. Panic was: Panic: file smtp-server-cmd-helo.c: line 160 (smtp_server_cmd_ehlo_reply_create): assertion failed: (cmd->cmd->reg->func == smtp_server_cmd_ehlo) M src/lib-smtp/smtp-server-cmd-helo.c 2020-09-11 22:40:31 +0200 Stephan Bosch (0cf64cf8f1) lib-smtp: Reformat smtp-server-cmd-helo.c. M src/lib-smtp/smtp-server-cmd-helo.c 2021-03-23 10:27:23 +0100 Stephan Bosch (905668e0ac) lib-smtp: smtp-server-cmd-data - Fix crash occurring when BDAT is the last in a too long sequence of bad commands. When smtp_server_reply() detects that too many replies were sent regarding syntax errors, it will terminate the connection. Most commands will just stop processing and exit when a reply is submitted, so no crash occurs for those. However, BDAT will try to skip the data block, so that it will not be interpreted as a large set of input commands, which subsequentely crashes because the command parser is already gone after terminating the connection. M src/lib-smtp/smtp-server-cmd-data.c 2021-03-25 10:59:19 +0200 Timo Sirainen (444b4afdf0) push-notification: Fix logging initialization error M src/plugins/push-notification/push-notification-drivers.c 2021-03-24 09:43:17 +0100 Markus Valentin (81ec456313) imapc: imapc_list_get_fs() - Set index_pvt_dir for mailbox_list_settings To allow using private indexes with imapc storage the index_pvt_dir must be set when listing the mailbox. Previously this did not happen because the index_pvt_dir was simply NULL, now the value is copied from the imapc_mailbox_list. M src/lib-storage/index/imapc/imapc-list.c 2021-03-30 16:50:13 +0300 Timo Sirainen (57069b23e6) lib-index: Avoid accessing already freed "reason" when purging Broken by 4b60d609c05d334d29a72c6dbbe301a66f518089 M src/lib-index/mail-cache-purge.c 2021-03-30 11:00:57 +0100 Siavash Tavakoli (a64539fba0) lib-ssl-iostream: Avoid calling X509_check_ip_asc if malformed input was used Try to match certificate using "X509_check_ip_asc" only when "X509_check_host" didn't report an internal error or malformed input. M src/lib-ssl-iostream/iostream-openssl-common.c 2021-03-24 11:01:34 -0400 Josef 'Jeff' Sipek (4ccc5f9571) lib-lua: Document the DLUA_WRAP_C_DATA macro M src/lib-lua/dlua-wrapper.h 2020-08-13 20:01:41 +0300 Aki Tuomi (18cf172fc0) oauth2-jwt: Use int64_t instead time_t for portability M src/lib-oauth2/oauth2-jwt.c 2021-03-21 22:15:48 +0000 Siavash Tavakoli (af41ad228f) lib-ssl-iostream: Use OpenSSL's X509_check_host and X509_check_ip_asc if available Make use of "X509_check_host()" and "X509_check_ip_asc()" if OpenSSL version used has support for these functions. Revert back to previous custom implementation in case either is not available. Hosts are checked with partial wildcards (e.g. foo*.example.com) disabled. If host name check fails, check against IP addresses in the certificate. M src/lib-ssl-iostream/iostream-openssl-common.c 2021-03-21 22:14:55 +0000 Siavash Tavakoli (202a65fb59) m4: Add HAVE_X509_CHECK_HOST, HAVE_X509_CHECK_IP, and HAVE_X509_CHECK_IP_ASC Defined when compiling against an OpenSSL version supporting "X509_check_host", "X509_check_ip()", and "X509_check_ip_asc()" respectively. M m4/ssl.m4 2021-03-18 12:20:35 +0000 Siavash Tavakoli (8d84e36e31) lib-ssl-iostream: Ignore case when checking certificate name Host name case must be ignored when cheking with certificate. M src/lib-ssl-iostream/iostream-openssl-common.c 2021-03-22 13:00:31 +0200 Timo Sirainen (ca86ef368a) lib: ioloop - Remove unused timer_is_larger() macro M src/lib/ioloop.c 2021-03-01 12:56:21 +0200 Timo Sirainen (d92eb240cd) lib: test-ioloop - Make sure recreating 0-timeout in callback works M src/lib/ioloop.c M src/lib/test-ioloop.c 2021-03-01 13:03:16 +0200 Timo Sirainen (fac27f192d) lib: ioloop - Fix 0 ms timeouts to trigger without waiting 2ms between calls M src/lib/ioloop.c M src/lib/test-ioloop.c 2021-03-01 13:02:40 +0200 Timo Sirainen (adad8ad7fc) lib-test: test_assert_ucmp() - Fix typo to make it compile M src/lib-test/test-common.h 2021-03-22 13:04:15 +0100 Markus Valentin (1fc91d56d4) lib-compression: Get error with i_stream_get_error() so it's recursive In some cases the iostream.error was NULL so the errno default message was used. This fixes an regression introduced by 8b6142f9ba9. M src/lib-compression/istream-decompress.c 2021-03-23 09:02:06 +0200 Aki Tuomi (b72e08e519) lib-dict: dict-lua - Do not free pool after iteration finishes Otherwise we get double-free from gc. Broken in 1e67b93cc9f469bb144fc890a6cb9b9b9cd20811 M src/lib-dict/dict-iter-lua.c 2021-03-23 12:32:13 +0200 Timo Sirainen (9c58ce8e50) man: doveconf - Fix -P/ typo to just -P M doc/man/doveconf.1.in 2021-03-23 12:31:46 +0200 Timo Sirainen (c4d7aea669) man: doveconf - Document -s parameter M doc/man/doveconf.1.in 2021-01-27 20:26:26 +0200 Timo Sirainen (e453a424d9) doveadm zlibconnect: Support multiple compression algorithms Unfortunately they don't work very well, because only the deflate ostream supports flushing ostream before closing it. M src/doveadm/doveadm-zlib.c 2021-01-27 19:50:38 +0200 Timo Sirainen (0871db37b3) doveadm zlibconnect: Support automatically starting compression on COMPRESS command The previous method of using ctrl-d wasn't really suitable for scripting. M src/doveadm/doveadm-zlib.c 2021-01-27 20:29:11 +0200 Timo Sirainen (9a1eba3f41) lib-compression: Fix potential hangs with non-blocking istreams M src/lib-compression/istream-lz4.c M src/lib-compression/istream-lzma.c M src/lib-compression/istream-zlib.c M src/lib-compression/istream-zstd.c 2021-01-27 20:34:29 +0200 Timo Sirainen (14ab7acd03) lib: i_stream_read() - Fix assert with DEBUG enabled It doesn't matter if the data buffer changes for <=0 return value if the buffer was previously empty. M src/lib/istream.c 2021-02-04 02:15:22 +0200 Timo Sirainen (e6d8ac87a2) lib-storage: mailbox_list_init_fs() - Add event_parent M src/lib-storage/index/dbox-common/dbox-storage.c M src/lib-storage/mailbox-list.c M src/lib-storage/mailbox-list.h 2021-02-04 02:00:28 +0200 Timo Sirainen (040ec09363) lib-storage: Rename mail_storage_service_input.parent_event to event_parent This makes it more consistent with other settings. M src/imap/main.c M src/lda/main.c M src/lib-storage/mail-storage-service.c M src/lib-storage/mail-storage-service.h M src/lmtp/lmtp-local.c M src/plugins/quota/quota-status.c 2021-02-04 01:58:25 +0200 Timo Sirainen (dd0049bf67) lib-fs: Rename fs_settings.event to event_parent This makes it more consistent with other settings. M src/lib-fs/fs-api.c M src/lib-fs/fs-api.h M src/lib-fs/fs-dict.c M src/lib-storage/mail-user.c 2021-02-04 01:36:52 +0200 Timo Sirainen (84da97fd4e) lib-dict: Set connections' event_parent correctly dict->dict.event is NULL at this point. M src/lib-dict/dict-client.c M src/lib-dict/dict-memcached-ascii.c M src/lib-dict/dict-memcached.c 2021-02-04 01:27:34 +0200 Timo Sirainen (afbc5c30e4) auth: db-sql - Fill sql_settings.event_parent M src/auth/db-sql.c 2021-02-04 01:16:12 +0200 Timo Sirainen (ef3f457051) global: Set http_client_settings.event_parent when possible M src/auth/db-oauth2.c M src/plugins/fts-solr/solr-connection.c M src/plugins/fts/fts-parser-tika.c 2021-02-04 01:13:40 +0200 Timo Sirainen (0b1beeccb0) fts-solr: solr-connection - Add parent event M src/plugins/fts-solr/fts-backend-solr-old.c M src/plugins/fts-solr/fts-backend-solr.c M src/plugins/fts-solr/solr-connection.c M src/plugins/fts-solr/solr-connection.h 2021-02-04 01:10:57 +0200 Timo Sirainen (91be621311) global: Set dns_lookup_settings.event_parent M src/auth/auth-request.c M src/lib-http/http-client-host.c M src/lib-imap-client/imapc-connection.c M src/lib-program-client/program-client-remote.c M src/lib-smtp/smtp-client-connection.c M src/lib-storage/index/pop3c/pop3c-client.c 2021-02-04 01:09:57 +0200 Timo Sirainen (27c92f1d02) imapc: Add parent event M src/auth/passdb-imap.c M src/lib-imap-client/imapc-client-private.h M src/lib-imap-client/imapc-client.c M src/lib-imap-client/imapc-client.h M src/lib-imap-client/test-imapc-client.c M src/lib-storage/index/imapc/imapc-storage.c 2021-02-04 01:07:38 +0200 Timo Sirainen (132e9b08d6) pop3c: Add parent event M src/lib-storage/index/pop3c/pop3c-client.c M src/lib-storage/index/pop3c/pop3c-client.h M src/lib-storage/index/pop3c/pop3c-storage.c 2021-02-04 01:01:42 +0200 Timo Sirainen (3d7cd9a60e) global: Set dict_settings.event_parent when possible M src/auth/db-dict.c M src/auth/db-oauth2.c M src/lib-fs/fs-dict.c M src/lib-storage/index/index-attribute.c M src/plugins/acl/acl-lookup-dict.c M src/plugins/last-login/last-login-plugin.c M src/plugins/notify-status/notify-status-plugin.c M src/plugins/quota-clone/quota-clone-plugin.c M src/plugins/quota/quota-dict.c M src/plugins/quota/quota.c 2021-03-22 16:24:20 +0200 Aki Tuomi (26bfe7b6a7) lib-lua: dlua-threads - pop thread table after manipulation Forgot on a84bfdaf6df8fd6a4cbbf0845c18b09e6ceada36 M src/lib-lua/dlua-thread.c 2021-02-22 15:29:45 +0200 Aki Tuomi (80156c4f7b) auth: Fix Makefile variables for Lua Otherwise automake complains about touching the variables in many places. M src/auth/Makefile.am 2021-02-05 15:40:49 +0200 Aki Tuomi (8276f856d6) dovecot-config: Include used Lua details M Makefile.am M configure.ac M dovecot-config.in.in M m4/dovecot.m4 2021-02-05 15:21:46 +0200 Aki Tuomi (20660943f8) push-notification-driver-lua: Use dlua_pcall M src/plugins/push-notification/push-notification-driver-lua.c 2021-02-05 15:17:44 +0200 Aki Tuomi (96bd734b7a) mail-lua: Pop return values after use M src/plugins/mail-lua/mail-lua-plugin.c 2021-02-05 15:17:37 +0200 Aki Tuomi (bcf502353d) mail-lua: Use dlua_pcall M src/plugins/mail-lua/mail-lua-plugin.c 2021-02-05 15:13:26 +0200 Aki Tuomi (1265f55524) auth: db-lua - Use dlua_pcall M src/auth/db-lua.c 2021-02-16 09:21:58 +0200 Aki Tuomi (fcf86bb7b2) lib-lua: Fix script loading Handle error cases correctly. M src/lib-lua/dlua-script.c 2021-02-05 13:34:27 +0200 Aki Tuomi (fe1c3e670f) lib-lua: Use dlua_pcall M src/lib-lua/dlua-script.c M src/lib-lua/test-lua.c 2021-02-05 13:33:47 +0200 Aki Tuomi (b78bc8f862) lib-lua: Add dlua_pcall M src/lib-lua/dlua-script-private.h M src/lib-lua/dlua-script.c 2021-02-05 13:41:24 +0200 Aki Tuomi (95e6c3974e) lib-lua: dlua-dovecot - Ensure script is not NULL M src/lib-lua/dlua-dovecot.c 2021-02-16 12:47:17 +0200 Aki Tuomi (22d54c6e25) lib-lua: Define LUA_OK if missing It's defined since lua 5.2, and we support lua 5.1. M src/lib-lua/dlua-compat.h 2021-02-19 15:20:07 +0200 Aki Tuomi (5c3ec087bf) lib-lua: Reformat macros in dlua-script-private.h M src/lib-lua/dlua-script-private.h 2021-03-22 10:36:24 +0200 Aki Tuomi (12f0271e17) lib-lua: Add callback typecheck for dlua_pcall_yieldable M src/lib-lua/dlua-resume.c M src/lib-lua/dlua-script-private.h 2021-02-25 10:22:28 -0500 Josef 'Jeff' Sipek (1e67b93cc9) lib-dict: Expose dict and dict transactions to lua scripts M src/lib-dict/Makefile.am A src/lib-dict/dict-iter-lua.c A src/lib-dict/dict-lua-private.h A src/lib-dict/dict-lua.c A src/lib-dict/dict-lua.h A src/lib-dict/dict-txn-lua.c M src/lib-lua/Makefile.am 2021-02-25 15:35:26 -0500 Josef 'Jeff' Sipek (77cb890b16) lib-lua: Implement lua_seti() fallback for pre-5.3 support M m4/want_lua.m4 M src/lib-lua/dlua-compat.c M src/lib-lua/dlua-compat.h 2021-02-25 10:22:24 -0500 Josef 'Jeff' Sipek (21a2bddaeb) lib-lua: Add DLUA_WRAP_C_DATA macro to more easily expose C structures to lua M src/lib-lua/Makefile.am A src/lib-lua/dlua-wrapper.h 2021-02-24 13:57:10 -0500 Josef 'Jeff' Sipek (1dab5661cf) lib-lua: Add dlua_pcall_yieldable M configure.ac M m4/want_lua.m4 M src/lib-lua/Makefile.am A src/lib-lua/dlua-resume.c M src/lib-lua/dlua-script-private.h 2021-02-25 15:49:18 -0500 Josef 'Jeff' Sipek (2c4ebe2cc7) m4: want_lua - Check for lua_{resume,yieldk} M m4/want_lua.m4 2021-02-24 14:53:59 -0500 Josef 'Jeff' Sipek (c5478e9d2b) lib-lua: Add thread local storage API M src/lib-lua/dlua-script-private.h M src/lib-lua/dlua-thread.c M src/lib-lua/test-lua.c 2021-02-05 16:47:53 +0200 Aki Tuomi (a84bfdaf6d) lib-lua: Add new thread/close thread dlua wrappers Code rewritten to use lua registry, warn about unclosed threads, and moved to a separate file by Josef 'Jeff' Sipek M src/lib-lua/Makefile.am M src/lib-lua/dlua-script-private.h M src/lib-lua/dlua-script.c A src/lib-lua/dlua-thread.c 2021-03-12 02:58:37 +0200 Timo Sirainen (b2948c33c6) global: Avoid casting away const M src/auth/test-mech.c M src/doveadm/doveadm-dump-log.c M src/doveadm/dsync/dsync-ibc-pipe.c M src/imap-hibernate/imap-hibernate-client.c M src/imap/imap-master-client.c M src/lib-http/http-response-parser.c M src/lib-http/test-http-client.c M src/lib-ldap/ldap-search.c M src/lib-mail/test-message-address.c M src/lib-smtp/smtp-parser.c M src/lib-test/test-ostream.c M src/lib/test-array.c M src/lib/uri-util.c 2021-03-12 14:53:38 +0200 Timo Sirainen (8c153a6417) lib: iostreams - Use container_of() M src/lib/iostream-temp.c M src/lib/istream-base64-decoder.c M src/lib/istream-base64-encoder.c M src/lib/istream-callback.c M src/lib/istream-chain.c M src/lib/istream-concat.c M src/lib/istream-crlf.c M src/lib/istream-failure-at.c M src/lib/istream-file.c M src/lib/istream-hash.c M src/lib/istream-jsonstr.c M src/lib/istream-limit.c M src/lib/istream-multiplex.c M src/lib/istream-rawlog.c M src/lib/istream-seekable.c M src/lib/istream-sized.c M src/lib/istream-tee.c M src/lib/istream-timeout.c M src/lib/istream-try.c M src/lib/istream-unix.c M src/lib/istream.c M src/lib/ostream-buffer.c M src/lib/ostream-failure-at.c M src/lib/ostream-file.c M src/lib/ostream-hash.c M src/lib/ostream-multiplex.c M src/lib/ostream-rawlog.c M src/lib/ostream-unix.c M src/lib/ostream-wrapper.c M src/lib/ostream.c 2021-03-12 02:56:20 +0200 Timo Sirainen (2ca94e7ac9) lib: stats_dist_get_median(), stats_dist_get_percentile() - Remove const parameter They weren't really const, because they required modifying the stats to sort them. M src/lib/stats-dist.c M src/lib/stats-dist.h M src/lib/test-stats-dist.c 2021-02-27 00:04:54 +0100 Stephan Bosch (52d11b4eaf) login-common: sasl-server - Remove data transfered to post-login service from input stream. This prevents duplicating input when SSL is involved, causing commands pipelined after authenticate commands from being duplicated. This issue emerged when login proxy was changed to use the iostream pump/proxy. This means that the proxy uses streams rather than raw FDs, which means that data buffered in input stream before proxy is inherently forwarded to the post-login service... a second time. M src/login-common/sasl-server.c 2021-03-18 11:17:07 +0100 Timo Sirainen (cf768ecaf4) lib: test-cpu-limit - Test upper CPU limit only for user CPU, not for system CPU The system CPU check kept randomly failing with larger and larger limits, so there doesn't seem to be any point trying to test it at all. M src/lib/test-cpu-limit.c 2021-03-12 02:26:32 +0200 Timo Sirainen (c6ad2aea84) lib-index: Fix crash when cache record size is larger than file size This shouldn't happen unless the dovecot.index.cache file was corrupted. M src/lib-index/mail-cache.c M src/lib-index/test-mail-cache.c 2020-08-08 12:11:54 +0300 Timo Sirainen (219c619d8f) lib-index: mail_cache_map() - Fix handling huge size values correctly offset+size could have wrapped in 32bit systems. M src/lib-index/mail-cache.c 2021-03-15 12:53:19 +0200 Timo Sirainen (718e9c9fb1) auth: test-auth-cache - Fix auth_request_var_expand_static_tab[] Its size is explicitly set in .h file, so it should be in .c file as well. M src/auth/test-auth-cache.c 2021-03-15 12:02:32 +0000 Siavash Tavakoli (f29449c5c4) auth: userdb-passwd: Close the password database in iteration deinit Otherwise, next "getpwent()" will continue to return next entries in passwd database which results in unwanted skipping of entries. M src/auth/userdb-passwd.c 2021-03-09 21:35:15 +0200 Timo Sirainen (3382a7c0f4) doveconf: Don't print an error if $rundir/dovecot.conf symlink doesn't exist M src/config/doveconf.c 2020-04-15 17:57:43 +0300 Timo Sirainen (37089190bc) lib-storage: Set mail_index_* and mail_cache_* settings hidden It's not recommended to change these settings outside testing. M src/lib-storage/mail-storage-settings.c 2021-03-09 19:10:01 +0200 Timo Sirainen (df7fec2087) doveconf: Add -s parameter to show also hidden settings M src/config/doveconf.c 2020-04-15 17:50:42 +0300 Timo Sirainen (e4c710dd0a) doveconf: Don't show hidden settings unless they've been explicitly set M src/config/config-request.c M src/config/config-request.h M src/config/doveconf.c 2020-04-15 17:44:56 +0300 Timo Sirainen (a1339fbfe9) lib-settings: Add SET_FLAG_HIDDEN setting flag M src/lib-settings/settings-parser.h 2020-04-15 17:35:14 +0300 Timo Sirainen (0ce3e66e7b) global: Initialize struct setting_define fields with explicit names This allows changing the struct contents without breaking compiling. M src/auth/auth-settings.c M src/dict/dict-settings.c M src/doveadm/doveadm-settings.c M src/imap/imap-settings.c M src/lib-lda/lda-settings.c M src/lib-settings/test-settings-parser.c M src/lib-smtp/smtp-submit-settings.c M src/lib-storage/mail-storage-settings.c M src/master/master-settings.c M src/plugins/mail-crypt/fs-crypt-settings.c M src/pop3/pop3-settings.c M src/stats/stats-settings.c 2020-04-15 17:21:03 +0300 Timo Sirainen (44a37d2390) global: Use SETTING_DEFINE_STRUCT_*() macros when defining settings This adds type checking to them. M src/auth/auth-settings.c M src/dict/dict-settings.c M src/director/director-settings.c M src/doveadm/doveadm-settings.c M src/imap-login/imap-login-settings.c M src/imap-urlauth/imap-urlauth-settings.c M src/imap-urlauth/imap-urlauth-worker-settings.c M src/imap/imap-settings.c M src/lib-lda/lda-settings.c M src/lib-master/master-service-settings.c M src/lib-master/master-service-ssl-settings.c M src/lib-master/test-master-service-settings-cache.c M src/lib-smtp/smtp-submit-settings.c M src/lib-storage/index/dbox-multi/mdbox-settings.c M src/lib-storage/index/imapc/imapc-settings.c M src/lib-storage/index/maildir/maildir-settings.c M src/lib-storage/index/mbox/mbox-settings.c M src/lib-storage/index/pop3c/pop3c-settings.c M src/lib-storage/mail-storage-settings.c M src/lmtp/lmtp-settings.c M src/login-common/login-settings.c M src/master/master-settings.c M src/old-stats/stats-settings.c M src/plugins/quota/quota-status-settings.c M src/pop3/pop3-settings.c M src/replication/aggregator/aggregator-settings.c M src/replication/replicator/replicator-settings.c M src/stats/stats-settings.c M src/submission-login/submission-login-settings.c M src/submission/submission-settings.c 2020-04-15 17:20:20 +0300 Timo Sirainen (8d5c63c0e5) quota-status: Fix quota_status_settings.recipient_delimiter to be const M src/plugins/quota/quota-status-settings.h 2020-04-15 17:18:42 +0300 Timo Sirainen (f54fff4552) mail-crypt, master: Remove unused DEF & DEFLIST macros M src/master/master-settings.c M src/plugins/mail-crypt/fs-crypt-settings.c 2020-04-15 16:53:26 +0300 Timo Sirainen (e6c5b2c0cb) lib-settings: Rewrite and add missing SETTING_DEFINE_STRUCT_* macros These hadn't been used anywhere. M src/config/test-config-parser.c M src/lib-settings/settings-parser.h M src/lib-settings/test-settings-parser.c 2021-03-13 14:23:46 +0200 Timo Sirainen (6986a435e3) lib-smtp: fuzz-smtp-server - Fix compiling due to lib-smtp API change Forgotten from 2cdab962670df394c28fb7858cb0d4f90f70f71c M src/lib-smtp/fuzz-smtp-server.c 2021-03-16 17:09:11 +0200 Timo Sirainen (e0d7153999) submission: Remove dead assignment M src/submission/submission-client.c 2020-01-15 20:22:00 +0200 Timo Sirainen (b099d5eac6) login-common: Fix client_destroy_oldest() return value to be more exact Only return TRUE if a client connection is immediately destroyed. M src/login-common/client-common.c 2020-01-15 18:09:14 +0200 Timo Sirainen (56328e4da4) lib-master: Add a delay to calling avail_overflow_callback with client_limit=1 Without the delay all (or many/most) processes will call the callback, because the OS notifies all of the processes of the incoming connection. This results in all of the connections being killed instead of only a few of them. M src/lib-master/master-service-private.h M src/lib-master/master-service.c 2020-01-15 19:10:43 +0200 Timo Sirainen (3b43c181d8) lib-master: Change master_service_set_avail_overflow_callback() API Needed by the following changes. M src/lib-master/master-service-private.h M src/lib-master/master-service.c M src/lib-master/master-service.h M src/login-common/client-common.c M src/login-common/client-common.h 2020-01-15 19:06:32 +0200 Timo Sirainen (10746c5b85) login-common: Change struct client.created to timeval M src/login-common/client-common-auth.c M src/login-common/client-common.c M src/login-common/client-common.h 2020-01-15 17:49:52 +0200 Timo Sirainen (d905a4e96d) lib-master: Code cleanup to refreshing login state Unexpected seek offsets are now handled better. M src/lib-master/master-service.c 2020-01-15 16:30:34 +0200 Timo Sirainen (c39854c1fb) lib-master: Fix calling avail_overflow_callback with service_count=1 This is used by login processes to kill the oldest connection when all of the clients and processes for the service are taken. This wasn't working when service_count=1 because the listeners were closed already. It's not really useful anymore to even do this kind of a listener closing. It was originally added in 9217d2426b4f8ece47441357f35d8bb34d97c4eb to prevent restart problems with long-running login processes. However, nowadays listeners can be closed via SIGQUIT so this isn't necessary. M src/lib-master/master-service.c 2021-02-26 12:28:03 +0000 Siavash Tavakoli (5dd81d83d8) lib-storage: Correct escaping for list index lookups - Escape storage name when listing mailbox from index and unescape mailbox name when looking for sibling nodes. - Unescape when adding node to list index. - List index iteration is performed with storage name where separators must be escaped with storage_name_escape_char. Index lookup is done with storage_name which is escaped with storage_name_escape_char but node names are unescaped. M src/lib-storage/list/mailbox-list-index-iter.c M src/lib-storage/list/mailbox-list-index-sync.c M src/lib-storage/list/mailbox-list-index.c M src/lib-storage/list/mailbox-list-index.h 2021-02-22 15:37:19 +0000 Siavash Tavakoli (1feae5169f) lib-storage: Expose mailbox_list_name_{escape,unescape} functions in header To be used in mailbox-list-index. M src/lib-storage/mailbox-list.c M src/lib-storage/mailbox-list.h 2021-03-11 17:55:08 +0000 Siavash Tavakoli (b603f3284e) lib-storage: test-mail-storage: Separate test cases for "LAYOUT=INDEX" With default escaping for "INDEX" layout, more mailbox name are accepted. M src/lib-storage/test-mail-storage.c 2021-02-22 15:29:30 +0000 Siavash Tavakoli (d4e4892461) lib-storage: mailbox-list: Add default storage name escaping for index layout Add a default value for "storage_name_escape_char" when "LAYOUT=index". Needed for situations where mailbox name contains separator char (e.g. after migration to new separator) and listescape plugin is not active. M src/lib-storage/list/mailbox-list-index-backend.c M src/lib-storage/mailbox-list.c 2021-02-26 16:03:50 +0000 Siavash Tavakoli (2f2e20739a) lib-storage: Rename mailbox_list_index_node.name to raw_name To make it clear that the string is unescaped raw value, rename from generic "name" to "raw_name". M src/lib-storage/list/mailbox-list-index-iter.c M src/lib-storage/list/mailbox-list-index-sync.c M src/lib-storage/list/mailbox-list-index.c M src/lib-storage/list/mailbox-list-index.h M src/lib-storage/list/mailbox-list-notify-tree.c 2021-03-11 12:31:52 +0000 Siavash Tavakoli (42ae314198) lib-storage: Add mailbox list index alt separator To avoid collision with storage name escape character, use an alternative char ('^') if hierarchy separator for list index is the same char. M src/lib-storage/list/mailbox-list-index-backend.c M src/lib-storage/list/mailbox-list-index.h 2021-03-16 14:37:54 +0200 Timo Sirainen (e1dd685f1a) login-common: Finish freeing the client when anvil lookup is pending at destroy Broken by f32daf5ac9eaa886e28659965fc0156b52b60bda M src/login-common/client-common.c M src/login-common/sasl-server.c 2021-03-16 14:37:38 +0200 Timo Sirainen (be3cd60a1b) login-common: Assert-crash at deinit if there are still referenced clients M src/login-common/client-common.c 2021-03-16 14:36:35 +0200 Timo Sirainen (1c622cdbe0) login-common: Track referenced but destroyed clients in a linked list This helps debugging. M src/login-common/client-common.c 2021-03-11 13:00:56 +0200 Timo Sirainen (0e0519cd25) lib: test-cpu-limit - Increase ALLOW_MSECS_ABOVE further 1500 was still not enough to prevent random failures. M src/lib/test-cpu-limit.c 2021-03-15 18:18:07 +0200 Timo Sirainen (2133e37cfc) lib: cpu-limit - Redesign the API The new API no longer has a signal callback, just a cpu_limit_exceeded() function that needs to be periodically called to check if the limit has exceeded. The callback could be added back if really necessary, but it's just too easy to use signal handlers unsafely. The new API also supports separating limits for user and system CPU usage. It also attempts to guard against any unexpected kernel behavior resulting from unclear behavior on how exactly the getrlimit(), setrlimit() and XCPU signals interact. M src/lib/cpu-limit.c M src/lib/cpu-limit.h M src/lib/test-cpu-limit.c 2021-03-15 17:22:00 +0200 Timo Sirainen (db70cd7091) lib: cpu-limit - Split off cpu_limit_get_usage_msecs_with() M src/lib/cpu-limit.c 2021-03-15 17:21:03 +0200 Timo Sirainen (e83d620cb6) lib: cpu-limit - Move cpu_limit_get_usage_msecs() M src/lib/cpu-limit.c 2021-03-15 16:50:25 +0200 Timo Sirainen (66fb224ce9) lib: cpu-limit - Update comments related to nesting M src/lib/cpu-limit.h 2021-03-15 15:42:56 +0200 Timo Sirainen (337e29dee5) lib: cpu_limit_get_usage_[m]secs() - Add type parameter It can now return user CPU, system CPU or both usages. M src/lib/cpu-limit.c M src/lib/cpu-limit.h 2021-03-15 15:37:55 +0200 Timo Sirainen (fde5380485) lib: cpu-time - Use the original struct rusage as the initial_usage This will allow separation of user and system CPU usage tracking. They could have been tracked with two separate struct timevals, but the extra memory usage is small and it might be nice to have all the available data for debugging. M src/lib/cpu-limit.c 2021-03-15 18:00:55 +0200 Timo Sirainen (387bbf0bae) lib: test-cpu-limit - Fix nested limit asserts M src/lib/test-cpu-limit.c 2021-03-10 17:56:12 +0200 Timo Sirainen (586cca5769) lib-imap: Handle empty lists in IMAP BODYSTRUCTURE parsing as invalid They should be NIL instead of () if they're empty. M src/lib-imap/imap-bodystructure.c M src/lib-imap/test-imap-bodystructure.c 2021-03-10 17:40:47 +0200 Timo Sirainen (dd51ae09a8) lib-imap: Fix assert-crash if parsing invalid BODYSTRUCTURE with empty Content-Language list If there's no Content-Language, it should be NIL in the bodystructure. So if the value is (), it is invalid. This could in theory have happened when parsing corrupted dovecot.index.cache or receiving it from a broken remote IMAP server with imapc. The bug was found by fuzzing though. Fixes: Panic: file imap-bodystructure.c: line 98 (part_write_bodystructure_common): assertion failed: (*lang != NULL) M src/lib-imap/imap-bodystructure.c M src/lib-imap/test-imap-bodystructure.c 2021-03-10 17:39:48 +0200 Timo Sirainen (2e5ef7cd2c) lib-imap: test-imap-bodystructure - imap_bodystructure_parse() - Test returned error M src/lib-imap/test-imap-bodystructure.c 2021-03-11 13:13:24 -0500 Josef 'Jeff' Sipek (6960b0130c) lib-lua: Error out the build if using Lua 5.2 M src/lib-lua/dlua-compat.c 2021-03-11 13:13:03 -0500 Josef 'Jeff' Sipek (508a7f7566) Global: Remove support for Lua 5.2 It took far too much effort to keep compatible with it. Since every distro out there provides either Lua 5.1 or 5.3, it makes sense to give up on 5.2. M m4/want_lua.m4 M src/lib-lua/test-lua.c 2021-03-09 10:53:50 -0500 Josef 'Jeff' Sipek (62a94d2270) m4: Allow explict override of lua version It is possible that the system has several different versions of Lua installed. This change allows one to force a specific version of Lua during ./configure. For example: LUA_CFLAGS="`pkg-config lua51 --cflags`" \ LUA_LIBS="`pkg-config lua51 --libs`" \ ./configure \ --with-lua M m4/want_lua.m4 2021-03-09 18:40:32 +0200 Timo Sirainen (37fa8a945b) lib-storage: Preserve last-rename-stamp when rebuilding index M src/lib-storage/index/index-rebuild.c 2021-03-09 18:42:38 +0200 Timo Sirainen (4484e357fe) lib-storage: Don't trust last-rename-stamp that is too far into the future If the timestamp is in the future, autoexpunging stops working until the future time is passed. If this happened due to corruption, it could take a long time before the timestamp is reached. M src/lib-storage/mail-autoexpunge.c 2021-03-09 18:37:51 +0200 Timo Sirainen (e773308cb1) lib-storage: Preserve hdr-pop3-uidl when rebuilding index This prevents potentially expensive metadata lookups afterwards when trying to find out which mails have the POP3 UIDLs in their metadata. M src/lib-storage/index/index-rebuild.c 2021-03-09 18:36:35 +0200 Timo Sirainen (54eb5a9661) lib-storage: Convert index_rebuild_box_name_header() into generic index_rebuild_box_preserve_header() M src/lib-storage/index/index-rebuild.c 2020-05-11 17:41:24 +0300 Timo Sirainen (2c9d83a640) doveadm dump: Support hdr-pop3-uidl index header extension M src/doveadm/doveadm-dump-index.c 2020-05-11 17:40:29 +0300 Timo Sirainen (f879618dd8) doveadm dump: Include mail-storage-private.h to get easier access to some structs Avoids having to duplicate the structs. M src/doveadm/doveadm-dump-index.c 2021-03-10 22:08:24 +0200 Timo Sirainen (b0f498b692) auth: userdb_parse_[ug]id() - Fix error logging to use events properly If request is missing, use the global auth_event instead of hiding the error. M src/auth/userdb.c 2019-10-31 16:39:26 +0200 Timo Sirainen (fdc10a6c9c) auth: Use auth_request.event for logging whenever possible M src/auth/auth-cache.c M src/auth/auth-penalty.c M src/auth/auth-request.c M src/auth/db-checkpassword.c M src/auth/mech-winbind.c M src/auth/userdb-blocking.c M src/auth/userdb-ldap.c M src/auth/userdb-passwd.c M src/auth/userdb.c 2019-10-31 16:31:55 +0200 Timo Sirainen (66ddc39ad7) auth: auth-client-connection: Log all errors via events M src/auth/auth-client-connection.c 2019-10-31 16:29:22 +0200 Timo Sirainen (19a40f34d7) auth: auth-worker-server: Log errors via events M src/auth/auth-worker-server.c 2019-10-31 16:21:15 +0200 Timo Sirainen (0e06d67755) auth: auth-request-handler: Log errors via events M src/auth/auth-request-handler.c 2019-10-31 16:18:15 +0200 Timo Sirainen (5cd4850716) auth: authdb_event() - Use const pointer M src/auth/auth-request.h 2019-10-31 16:14:09 +0200 Timo Sirainen (6e004bf327) auth: Replace auth_master_log_error() with e_error() M src/auth/auth-master-connection.c M src/auth/auth-master-connection.h M src/auth/auth-request-handler.c 2019-10-31 16:21:35 +0200 Timo Sirainen (fc151df907) auth: auth-worker-client: Log errors via events M src/auth/auth-worker-client.c 2019-10-31 15:36:02 +0200 Timo Sirainen (82918227d8) auth: auth-worker-client: Fix setting process title to [idling] The existing code was completely wrong. It was set only when LIST command started running. For other commands it wasn't set at all. M src/auth/auth-worker-client.c 2019-10-31 15:34:06 +0200 Timo Sirainen (543ef9a5cc) auth: auth-worker-client: Move common code to auth_worker_request_finished() M src/auth/auth-worker-client.c 2019-10-31 15:31:57 +0200 Timo Sirainen (09de553954) auth: auth-worker-client: Move auth_worker_request_finished*() M src/auth/auth-worker-client.c 2019-10-31 15:27:49 +0200 Timo Sirainen (8077977b38) auth: auth-worker-client: Set "error" for all auth worker request failures Previously the error was set only for protocol errors. Now it's set for everything, including password mismatches. However, only the protocol errors are logged with error level, others are debug level. M src/auth/auth-worker-client.c 2019-10-31 15:23:01 +0200 Timo Sirainen (9e5c44af66) auth: auth-worker-client: Rename auth_worker_log_finished() to auth_worker_request_finished() M src/auth/auth-worker-client.c 2019-10-31 14:48:11 +0200 Timo Sirainen (0fbd856f28) auth: userdb iteration - Use event based logging M src/auth/userdb-dict.c M src/auth/userdb-passwd-file.c M src/auth/userdb-passwd.c M src/auth/userdb-sql.c 2019-10-31 14:41:56 +0200 Timo Sirainen (88d2e192fd) auth: db-passwd-file - Use event based logging M src/auth/db-passwd-file.c M src/auth/db-passwd-file.h 2019-10-31 14:34:48 +0200 Timo Sirainen (76c5f00362) auth: db-ldap - Use event based logging M src/auth/db-ldap.c M src/auth/db-ldap.h 2021-02-25 21:58:17 +0200 Timo Sirainen (f32daf5ac9) login-common: Fix assert-crash if client is destroyed during anvil lookup This could happen if the client gets disconnected due to "Connection queue full". Fixes: Panic: file client-common.c: line 323 (client_destroy): assertion failed: (!client->authenticating) M src/login-common/client-common.c M src/login-common/client-common.h M src/login-common/sasl-server.c 2021-03-10 13:50:00 +0200 Timo Sirainen (3a6ec2997a) lib: event_logv() - Make sure errno is preserved It already should have been, but this change makes it clearer and more future-safe. M src/lib/event-log.c M src/lib/test-event-log.c 2021-03-02 19:30:23 +0200 Timo Sirainen (e980325475) imap: Use internal error for logging FETCH failed disconnection message M src/imap/cmd-fetch.c 2021-03-02 18:58:54 +0200 Timo Sirainen (69069554be) submission-login: Fix logging "no auth attempts" at disconnection client.banner_sent wasn't set, which prevented this from being logged. M src/submission-login/client.c 2021-03-02 17:51:54 +0200 Timo Sirainen (1f926dd5d0) lib-smtp: smtp_server_connection_ssl_init() - Don't start SSL handshake If SSL handshaking fails, it shouldn't be logged as an error similarly to actual SSL initialization errors. M src/lib-smtp/smtp-server-connection.c 2021-03-02 17:44:37 +0200 Timo Sirainen (eee5cd271a) lib-smtp: Remove smtp_server_connection.disconnect_reason This isn't used anywhere and its purpose is a bit unclear. M src/lib-smtp/smtp-server-connection.c M src/lib-smtp/smtp-server-private.h 2021-03-02 17:33:30 +0200 Timo Sirainen (7a91266647) imap-urlauth: Change event_category_urlauth to be static M src/imap-urlauth/imap-urlauth-client.c 2021-03-02 17:30:52 +0200 Timo Sirainen (de3d7f4d0e) imap-urlauth: Replace i_info() and i_error() calls with e_info() and e_error() M src/imap-urlauth/imap-urlauth-client.c M src/imap-urlauth/imap-urlauth-login.c 2021-03-02 17:26:50 +0200 Timo Sirainen (e069e121fa) imap-urlauth: Don't change log prefix just before disconnection line It shouldn't be necessary. (And if it was, it should be done in init.) M src/imap-urlauth/imap-urlauth-client.c 2021-03-02 17:25:31 +0200 Timo Sirainen (33d03c7aa8) imap-urlauth: client_destroy() - Allow NULL reason only if client is disconnected M src/imap-urlauth/imap-urlauth-client.c 2021-03-02 17:24:14 +0200 Timo Sirainen (9354759519) imap-urlauth: Remove duplicate "Disconnected: " prefix It's already logged by client_destroy() M src/imap-urlauth/imap-urlauth-login.c 2021-03-02 17:19:13 +0200 Timo Sirainen (e0116a1bec) imap-urlauth: Add Username to log prefix M src/imap-urlauth/imap-urlauth-client.c 2021-03-02 17:15:45 +0200 Timo Sirainen (34543d8893) imap-urlauth: Fix event leak if worker can't be connected to M src/imap-urlauth/imap-urlauth-client.c 2021-03-02 15:15:09 +0200 Timo Sirainen (5e34090a35) lib-smtp: Standardize iostream error handling Use [io]_stream_get_disconnect_reason() for logging all errors. None of the iostream errors are logged as error level anymore. This way for example TLS connection problems caused by broken clients aren't logged as errors. M src/lib-smtp/smtp-command-parser.c M src/lib-smtp/smtp-server-cmd-auth.c M src/lib-smtp/smtp-server-cmd-data.c M src/lib-smtp/smtp-server-connection.c 2021-03-02 15:07:56 +0200 Timo Sirainen (a0a04a86fc) lib: Add o_stream_get_disconnect_reason() M src/lib/ostream.c M src/lib/ostream.h 2021-03-02 15:06:50 +0200 Timo Sirainen (170505ce06) lib: Clarify i[o]_stream_get_disconnect_reason() comment M src/lib/iostream.h M src/lib/istream.h 2021-03-02 14:51:48 +0200 Timo Sirainen (6ece37a1ca) lib-smtp: Remove EIO-specific error handling No such error should be seen by lib-smtp. M src/lib-smtp/smtp-command-parser.c 2021-03-02 13:15:56 +0200 Timo Sirainen (206d350e75) submission: Standardize "Disconnected:" log line Remote IP is no longer logged. If it's wanted, it can be added to mail_log_prefix just like with other protocols. M src/submission/submission-client.c 2021-03-02 13:13:52 +0200 Timo Sirainen (6d5e9dc47c) lib-smtp: Standardize QUIT logging Similar to POP3, use "Logged out" or "Aborted login by logging out". M src/lib-smtp/smtp-server-command.c 2021-03-01 16:47:54 +0200 Timo Sirainen (5fb3a030d7) pop3: Improve "inactivity" disconnection reason log messages M src/pop3/pop3-client.c 2021-03-01 16:46:16 +0200 Timo Sirainen (a5a8dad1f2) pop3: Add "Disconnected: " prefix to all disconnection log lines M src/pop3/pop3-client.c 2021-02-03 22:15:51 +0200 Timo Sirainen (7bce44b6af) login-common: Add and use client_destroy_iostream_error() This standardizes the disconnection log message. M src/login-common/client-common-auth.c M src/login-common/client-common.c M src/login-common/client-common.h 2021-02-03 21:59:55 +0200 Timo Sirainen (de71b89e54) *-login: Replace "Aborted login" with "Disconnected: Aborted login by logging out" M src/imap-login/imap-login-client.c M src/login-common/client-common.h M src/pop3-login/client.c 2021-02-03 21:58:15 +0200 Timo Sirainen (04440c6364) *-login: Add "Disconnected: " prefix to most disconnection log lines All except "Disconnected by proxy" disconnections. M src/imap-login/imap-login-client.c M src/login-common/client-common.c M src/login-common/client-common.h M src/login-common/login-proxy.c M src/login-common/main.c M src/submission-login/client.c 2021-02-03 21:18:41 +0200 Timo Sirainen (e72f10af89) imap-hibernate: Add "Disconnected: " prefix to all disconnection log lines M src/imap-hibernate/imap-client.c 2021-03-01 16:40:57 +0200 Timo Sirainen (28ac5a03c9) imap: Improve "inactivity" disconnection reason log messages M src/imap/imap-client.c 2021-02-03 21:13:13 +0200 Timo Sirainen (e81273bac4) imap: Improve client disconnection log line in APPEND M src/imap/cmd-append.c 2021-02-03 17:47:13 +0200 Timo Sirainen (7ca5d9e76d) imap: Add "Disconnected: " prefix to all disconnection log lines It's currently not very clear that all these different log lines are about the disconnection event. M src/imap/imap-client.c 2021-03-02 16:40:48 +0200 Timo Sirainen (e898f7bba9) lmtp: Simplify client_destroy() handling This is similar to the earlier submission commit. M src/lmtp/lmtp-client.c M src/lmtp/lmtp-client.h 2021-03-02 16:37:30 +0200 Timo Sirainen (578708f67d) lmtp: Simplify/clarify disconnection code flow This is similar to the earlier submission commit. M src/lmtp/lmtp-client.c M src/lmtp/lmtp-client.h 2021-03-02 16:09:38 +0200 Timo Sirainen (0244a63021) submission: Remove client.stats client.conn is no longer ever NULL, so this isn't needed. M src/submission/submission-client.c M src/submission/submission-client.h 2021-03-02 16:00:24 +0200 Timo Sirainen (d013b6fd8b) submission: Simplify client_destroy() handling Now it simply calls smtp_server_connection_terminate() and the conn_free() callback does the actual destroying. M src/submission/submission-backend.c M src/submission/submission-client.c M src/submission/submission-client.h 2021-03-02 15:46:11 +0200 Timo Sirainen (8d8676f61b) submission: Simplify/clarify disconnection code flow client_disconnect() is now removed. Instead, client_destroy() now calls smtp_server_connection_terminate() directly to cause a disconnection and smtp_server_callbacks.conn_disconnect() handles the disconnection directly. This same behavior happened earlier also, but it wasn't as clear. M src/submission/submission-client.c M src/submission/submission-client.h 2021-03-02 15:41:15 +0200 Timo Sirainen (453fd9e00e) submission: Move client_connection_disconnect|free() M src/submission/submission-client.c 2021-03-05 17:03:11 +0200 Timo Sirainen (c05c419c69) lib-smtp, lmtp, submission: Move adding "(state=%s)" in disconnection reason to lib-smtp The following changes will break this in submission and lmtp. The state will be reset before conn_disconnect() is called, so they would always log state=READY. M src/lib-smtp/smtp-server-connection.c M src/lib-smtp/smtp-server.c M src/lib-smtp/smtp-server.h M src/lmtp/lmtp-client.c M src/submission-login/client.c M src/submission/submission-client.c 2021-03-02 14:17:29 +0200 Timo Sirainen (691d92feb9) lib-smtp: Add "unfinished %s command" if client disconnected during command processing This also removes the need for special code path to differentiate between logging "Remote closed connection" and "Remote closed connection unexpectedly". M src/lib-smtp/smtp-server-connection.c 2021-03-02 15:23:46 +0200 Timo Sirainen (2cdab96267) lib-smtp: Rename conn_destroy() callback to conn_free() It's called when the final reference to connection is dropped, so this describes it better. M src/lib-smtp/smtp-server-connection.c M src/lib-smtp/smtp-server.h M src/lib-smtp/test-smtp-payload.c M src/lib-smtp/test-smtp-server-errors.c M src/lmtp/lmtp-client.c M src/submission-login/client.c M src/submission/submission-client.c 2021-03-02 10:57:08 +0000 Siavash Tavakoli (ae50fc29a4) indexer: Convert indexer-worker log info to event Emit an event named "indexer_worker_indexing_finished", with following extra fields: - message_count: Number of messages indexed - first_uid: First uid of the message indexed - last_uid: Last uid of the message indexed - user_cpu_usecs: Total user mode cpu time spent on indexing On successful indexing and on MAIL_ERROR_NOTFOUND error event is emitted with "e_debug()", in other error situations event is emitted with "e_error()". M src/indexer/master-connection.c 2021-03-04 23:26:52 +0000 Siavash Tavakoli (6b32c8b25a) lib: lib-event: Add event_enable_user_cpu_usecs - Add an internal rusage struct to events to keep track of resource usage. - "event_enable_user_cpu_usecs()" enables "user_cpu_usecs" field for the event If "user_cpu_usecs" field is enabled, user CPU time will be calculated at the time of sending the event and will be added to event fields. M src/lib/lib-event-private.h M src/lib/lib-event.c M src/lib/lib-event.h 2021-03-11 09:28:58 +0200 Aki Tuomi (b99dea5b81) m4: want_lua - Fix Lua function checks One has to use $LIBS variable to ensure libraries come after conftest.c in configure. Broken in af819cd2f43b8896d949a33f8099234ac57df6e5 M m4/want_lua.m4 2021-03-03 17:08:07 -0500 Josef 'Jeff' Sipek (61789ad382) lib-lua: Add table get helpers M src/lib-lua/Makefile.am M src/lib-lua/dlua-compat.c M src/lib-lua/dlua-script-private.h A src/lib-lua/dlua-table.c M src/lib-lua/test-lua.c 2021-03-04 17:05:45 -0500 Josef 'Jeff' Sipek (ea26d657e0) lib-lua: Check for function presence instead of Lua version in compat code M m4/want_lua.m4 M src/lib-lua/dlua-compat.c M src/lib-lua/dlua-compat.h 2021-03-04 17:03:03 -0500 Josef 'Jeff' Sipek (991e3c8cec) lib-lua: Reorder compat luaL_{setfuncs,setmetatable} Switch their order to keep them alphabetical. This will make the header changes in the next commit a little more consistent. Additionally, fix up the coding style. M src/lib-lua/dlua-compat.c 2021-03-04 16:51:46 -0500 Josef 'Jeff' Sipek (2354db8607) lib-lua: Move compat macros and prototypes to dlua-compat.h Additionally, fix -Wstrict-bool issue in luaL_newmetatable() compatibility wrapper. M src/lib-lua/dlua-compat.h M src/lib-lua/dlua-script-private.h 2021-03-04 16:38:50 -0500 Josef 'Jeff' Sipek (1bcc5f4a73) lib-lua: Remove unused compatibility macros These are never used since all supported Lua versions define LUA_VERSION_NUM. M src/lib-lua/dlua-script-private.h 2021-03-04 16:21:07 -0500 Josef 'Jeff' Sipek (32e963965c) lib-lua: Implement a Lua 5.1 & 5.2 compatibility wrapper for lua_isinteger M src/lib-lua/dlua-compat.c M src/lib-lua/dlua-compat.h M src/lib-lua/test-lua.c 2021-03-04 16:16:53 -0500 Josef 'Jeff' Sipek (af819cd2f4) m4: want_lua - Check for lua_isinteger M m4/want_lua.m4 2021-03-04 15:35:37 -0500 Josef 'Jeff' Sipek (cdf6260258) lib-lua: Implement a Lua 5.1 compatibility wrapper for lua_tointegerx M src/lib-lua/Makefile.am M src/lib-lua/dlua-compat.c A src/lib-lua/dlua-compat.h M src/lib-lua/dlua-script-private.h M src/lib-lua/test-lua.c 2021-03-04 15:31:29 -0500 Josef 'Jeff' Sipek (f86a94015f) m4: want_lua - Check for lua_tointegerx M m4/want_lua.m4 2021-02-12 13:11:53 +0100 Stephan Bosch (cd7e0ae51b) lib-smtp: test-smtp-client-errors - Amend early data reply test to verify that connection is still viable. Some problems only surface when the connection is reused for the next command. Before, the connection was terminated immediately after the transaction, which hides such issues. M src/lib-smtp/test-smtp-client-errors.c 2021-02-09 23:35:53 +0100 Stephan Bosch (e305a608bf) lib-smtp: smtp-client-connection - Hold reference to command that is sending a stream. This fixes a panic: Panic: file smtp-client-command.c: line 715 (smtp_client_command_do_send_more): assertion failed: (cmd->stream != NULL) M src/lib-smtp/smtp-client-command.c M src/lib-smtp/smtp-client-connection.c 2021-02-09 23:35:42 +0100 Stephan Bosch (4d03a50a50) lib-smtp: smtp-client-command - Make smtp_client_command_unref() return TRUE when the object persists. M src/lib-smtp/smtp-client-command.c M src/lib-smtp/smtp-client-command.h 2021-02-09 23:44:42 +0100 Stephan Bosch (09cd268754) lib-smtp: smtp-client-command - Make smtp_client_command_unref(NULL) a no-op. M src/lib-smtp/smtp-client-command.c 2021-03-06 17:58:53 +0200 Timo Sirainen (63bebe6103) imap: Fix logging garbage if imap-hibernate sends invalid VERSION M src/imap/imap-client-hibernate.c 2021-03-05 15:26:24 +0200 Timo Sirainen (d386b616c0) lib-mail: mail-html2text - Fix character signedness type mismatch Fixes ubsan complaints: mail-html2text.c:186:12: runtime error: implicit conversion from type 'unsigned char' of value 226 (8-bit, unsigned) to type 'char' changed the value to -30 (8-bit, signed) M src/lib-mail/mail-html2text.c 2021-03-05 12:44:42 +0200 Timo Sirainen (070f586350) fts-tika: Don't fail indexing if Tika returns 5xx error Broken by 8e1eaf849ce4668c0941338e3e3671db159da575, which changed 5xx to be retried once before it was ignored. However, it accidentally changed the second 5xx to return failure instead of being ignored. M src/plugins/fts/fts-build-mail.c 2021-03-02 17:10:03 +0200 Timo Sirainen (52d3c54afd) pop3: Change IO context earlier while shutting down This didn't practically cause any issues currently, but the new behavior is more correct and future-proof. M src/pop3/pop3-client.c 2021-03-02 17:08:53 +0200 Timo Sirainen (055a98fa40) imap: Fix using mail_log_prefix is used when client disconnects during server shutdown M src/imap/imap-client.c M src/imap/main.c 2021-03-02 17:02:32 +0200 Timo Sirainen (5f948f4079) submission: Fix using mail_log_prefix when client is disconnected due to server shutdown M src/submission/submission-client.c 2021-02-26 16:10:18 +0200 Timo Sirainen (47097c6d27) dict-sql: Add more comments M src/lib-dict-backend/dict-sql.c 2021-02-26 16:05:47 +0200 Timo Sirainen (27f28a1fde) dict-sql: Rename [extra_]values to pattern_values M src/lib-dict-backend/dict-sql.c 2021-02-26 16:03:35 +0200 Timo Sirainen (98dd0628a7) dict-sql: Rename dict_sql_map.max_field_count to max_pattern_fields_count M src/lib-dict-backend/dict-sql-settings.c M src/lib-dict-backend/dict-sql-settings.h M src/lib-dict-backend/dict-sql.c 2021-02-26 16:02:05 +0200 Timo Sirainen (94fbb67e34) dict-sql: Rename dict_sql_map.sql_fields to pattern_fields M src/lib-dict-backend/dict-sql-settings.c M src/lib-dict-backend/dict-sql-settings.h M src/lib-dict-backend/dict-sql.c 2021-02-26 15:40:41 +0200 Timo Sirainen (8abff720eb) dict-sql: Change char key1 to bool add_username M src/lib-dict-backend/dict-sql.c 2021-02-26 15:32:48 +0200 Timo Sirainen (00b313513f) dict-sql: Simplify sql_dict_maps_are_mergeable() and add comments M src/lib-dict-backend/dict-sql.c 2021-02-26 15:29:02 +0200 Timo Sirainen (70f6f640cc) lib: test-array - Use i_strcmp_p() instead of reimplementing it M src/lib/test-array.c 2021-02-26 15:02:02 +0200 Timo Sirainen (4810970ea6) dict-sql: Simplify set/inc flushing Especially the *_real() function names were confusing. M src/lib-dict-backend/dict-sql.c 2021-02-25 17:54:26 +0200 Timo Sirainen (3b46f12e9b) dict-sql: Support merging multiple atomic_inc fields M src/lib-dict-backend/dict-sql.c M src/lib-dict-backend/test-dict-sql.c 2021-02-25 17:40:22 +0200 Timo Sirainen (f6a4383d65) dict-sql: Support merging multiple set fields M src/lib-dict-backend/dict-sql.c M src/lib-dict-backend/dict.conf M src/lib-dict-backend/test-dict-sql.c 2021-02-25 17:19:49 +0200 Timo Sirainen (69a1c091d3) dict-sql: Keep trying to merge INSERT/UPDATE always to the previous key Previously if the first two couldn't be merged, it would flush both. Now it flushes only the first and attempts to merge the 2nd and 3rd. M src/lib-dict-backend/dict-sql.c 2021-02-25 17:10:01 +0200 Timo Sirainen (977346e1bf) dict-sql: Move prev_set_* and prev_inc_* to struct sql_dict_prev M src/lib-dict-backend/dict-sql.c 2021-02-25 15:50:45 +0200 Timo Sirainen (4d66f8f75b) lib-sql: driver-test - Use test_assert_strcmp() M src/lib-sql/driver-test.c 2021-02-25 15:49:47 +0200 Timo Sirainen (9a1ee0e316) lib-dict-backend: test-dict-sql - Use test_assert_strcmp*() M src/lib-dict-backend/test-dict-sql.c 2021-02-23 22:49:57 +0200 Timo Sirainen (6c92f46723) lib-fs: Add type safety to fs_file/iter_set_async_callback() callback context M src/lib-fs/fs-api.c M src/lib-fs/fs-api.h M src/lib-fs/fs-wrapper.c 2021-02-23 11:11:47 +0200 Timo Sirainen (2a79971244) lib-dict, global: Add type safety to dict_transaction_commit_async() callback context M src/dict/dict-commands.c M src/lib-dict/dict.c M src/lib-dict/dict.h M src/plugins/last-login/last-login-plugin.c M src/plugins/quota-clone/quota-clone-plugin.c M src/plugins/quota/quota-dict.c 2021-02-23 11:16:50 +0200 Timo Sirainen (02c3916fa3) lib-dict, quota: Add and use dict_transaction_commit_async_nocallback() M src/lib-dict/dict.c M src/lib-dict/dict.h M src/plugins/quota/quota-dict.c 2021-02-23 11:09:36 +0200 Timo Sirainen (2397fa2a40) lib-dict, global: Add type safety to dict_iterate_set_async_callback() callback context M src/dict/dict-commands.c M src/lib-dict/dict.c M src/lib-dict/dict.h 2021-02-23 11:08:03 +0200 Timo Sirainen (46cc92aa6c) lib-dict, global: Add type safety to dict_lookup_async() callback context M src/dict/dict-commands.c M src/doveadm/doveadm-dict.c M src/lib-dict/dict-client.c M src/lib-dict/dict.c M src/lib-dict/dict.h 2021-03-02 09:51:59 -0500 Josef 'Jeff' Sipek (1314743ca9) configure: Remove useless checks for luajit At one point, we considered supporting LuaJIT. While it turned out to be not worth it, the prototype removal accidentally left checks in the configure file. M configure.ac 2021-02-22 17:44:03 -0500 Josef 'Jeff' Sipek (16bc5913a0) global: dict_iterate_deinit(NULL) is a no-op A coccinelle/null-nop-dict_iterate_deinit.cocci M src/auth/userdb-dict.c M src/dict/dict-commands.c 2021-02-22 17:43:49 -0500 Josef 'Jeff' Sipek (d7446176ef) lib-dict: Make dict_iterate_deinit(NULL) a no-op M src/lib-dict/dict.c 2021-02-22 17:43:05 -0500 Josef 'Jeff' Sipek (dace16f540) global: dict_transaction_rollback(NULL) is a no-op A coccinelle/null-nop-dict_transaction_rollback.cocci M src/dict/dict-connection.c M src/lib-storage/index/index-transaction.c 2021-02-22 17:41:23 -0500 Josef 'Jeff' Sipek (955ba101dc) lib-dict: Make dict_transaction_rollback(NULL) a no-op M src/lib-dict/dict.c 2021-02-04 18:25:13 +0200 Timo Sirainen (ac9e117021) fts: Replace generic "transaction context" error with more specific ones M src/plugins/fts/fts-storage.c 2021-02-03 19:42:17 +0200 Timo Sirainen (33cc04ebb7) fts: Fix mail_precache() and related error handling The mail_precache() caller is now expected to stop on error, so there's no need for fts to stop the search internally anymore. And similarly the caller will log the mail_precache() error so the search or transaction don't need to fail. ft->failed is now used only for failures that are more specific to the transaction. M src/plugins/fts/fts-storage.c 2021-02-03 19:30:35 +0200 Timo Sirainen (2e19383b9f) fts: Use storage error logging when possible Use mail_storage_set_internal_error() only when it's required, because it loses the internal error string in storage. M src/plugins/fts/fts-build-mail.c M src/plugins/fts/fts-build-mail.h M src/plugins/fts/fts-storage.c 2021-02-03 19:27:08 +0200 Timo Sirainen (dc78357452) lib-fts, fts: fts_language_detect() - Return error string instead of logging it M src/lib-fts/fts-language.c M src/lib-fts/fts-language.h M src/lib-fts/test-fts-language.c M src/plugins/fts/doveadm-fts.c M src/plugins/fts/fts-build-mail.c 2021-02-03 21:00:22 +0200 Timo Sirainen (3c37ef3730) indexer: Include "attempted to index ... messages" also in all error messages After the following changes search or transaction won't always fail anymore. M src/indexer/master-connection.c 2021-02-04 18:07:45 +0200 Timo Sirainen (3f328ac9f5) global: Handle mail_precache() errors M src/doveadm/doveadm-mail-index.c M src/indexer/master-connection.c M src/plugins/fts/fts-storage.c 2021-02-04 18:05:39 +0200 Timo Sirainen (921fe06624) lib-storage: Change mail_precache() API to allow returning an error M src/lib-storage/fail-mail.c M src/lib-storage/index/index-mail.c M src/lib-storage/index/index-mail.h M src/lib-storage/mail-storage-private.h M src/lib-storage/mail-storage.h M src/lib-storage/mail.c M src/plugins/fts/fts-storage.c M src/plugins/virtual/virtual-mail.c 2021-02-23 16:32:39 +0200 Aki Tuomi (576d40df2c) Makefile: Always include dovecot.socket and dovecot.service M Makefile.am 2021-02-23 12:52:29 +0200 Aki Tuomi (21ca65f26d) lib-master: Always import systemd related variables with systemd Otherwise it is too easy to break systemd integration by forgetting these from import_environment. M src/lib-master/master-service.c 2021-02-22 16:14:14 +0200 Aki Tuomi (6e811f1aec) master: Improve systemd integration M src/master/main.c 2021-02-22 15:29:48 +0200 Aki Tuomi (a42bb363b4) master: Use libsystemd instead of local source M Makefile.am M configure.ac M src/lib-master/master-service-settings.c M src/master/Makefile.am M src/master/main.c D src/master/sd-daemon.c D src/master/sd-daemon.h M src/master/service-listen.c 2021-02-23 16:08:28 +0200 Aki Tuomi (19e05adc36) master: service-listen - Use dovecot coding standard for systemd code M src/master/service-listen.c 2021-02-22 16:01:49 +0200 Timo Sirainen (92f7801e67) lib-imap-client: Add asserts to make sure running commands always have a timeout M src/lib-imap-client/imapc-connection.c 2021-02-22 15:41:42 +0200 Timo Sirainen (e8da1037b9) lib-imap-client: Don't remove global command timeouts when mailbox is unselected M src/lib-imap-client/imapc-connection.c 2021-02-22 13:15:18 +0200 Timo Sirainen (ae48fa6fac) lib-imap-client: Fix busy-loop if server disconnects too early when trying to logout This can happen if: * imapc sends NOOP to break idle * remote server sends BYE, but doesn't immediately disconnect * session is stopped, which causes imapc to attempt to send LOGOUT * imapc waits for NOOP response first * remote server disconnects * imapc notices the disconnection, but does nothing with it, because it thinks it's already handled. This keeps busy-looping. * If there was a mailbox selected, this results in infinite busy-loop. If a mailbox wasn't selected, imapc_cmd_timeout aborts the NOOP command. M src/lib-imap-client/imapc-connection.c 2021-02-24 17:51:19 +0200 Timo Sirainen (eea988f038) lib-mail: message-parser - Always properly finish parsed input If the caller hadn't called message_parser_parse_next_block() after seeing EOF in the istream, the deinit could have crashed with: Panic: file message-parser.c: line 802 (message_parser_deinit_from_parts): assertion failed: (ctx->nested_parts_count == 0 || i_stream_have_bytes_left(ctx->input)) M src/lib-mail/message-parser.c 2021-03-01 12:03:45 +0200 Timo Sirainen (96626062da) lib: io_loop_context_new() - Fix memory leak Broken by fea09a415cf89223d8b17c5982257c9b3c357cbc M src/lib/ioloop.c 2021-02-18 14:43:06 +0200 Timo Sirainen (6b28234f3d) login-common: Fix implicit integer conversions when connect timeout is reached M src/login-common/login-proxy.c 2021-02-03 20:48:51 +0200 Timo Sirainen (e73be660c5) lmtp: Fix log prefix when autoexpunge is running The username was missing from the log prefix. M src/lmtp/lmtp-local.c 2021-02-03 20:42:50 +0200 Timo Sirainen (fea09a415c) lib: io_loop_context_new() no longer implicitly activates the context The new behavior requires explicitly activating the context. This change was needed, because an implicit creation activated the context but didn't call any of the callbacks. If ioloop wasn't run, the activation callbacks were never called. This meant that when context was deactivated, the deactivation callbacks weren't run either. M src/imap-hibernate/imap-client.c M src/lib-storage/mail-storage-service.c M src/lib/ioloop.c M src/lib/ioloop.h 2021-02-17 19:33:03 +0200 Timo Sirainen (b32b3f989d) lib-storage: Replace i_error() and i_warning() with e_error() and e_warning() This changes only the generic code. The driver-specific code still needs changing. M src/lib-storage/list/mailbox-list-fs-iter.c M src/lib-storage/list/mailbox-list-index-notify.c M src/lib-storage/list/mailbox-list-maildir-iter.c M src/lib-storage/list/mailbox-list-subscriptions.c M src/lib-storage/mail-autoexpunge.c M src/lib-storage/mail-storage-service.c M src/lib-storage/mail-storage.c M src/lib-storage/mail-user.c M src/lib-storage/mailbox-guid-cache.c M src/lib-storage/mailbox-list.c M src/lib-storage/mailbox-uidvalidity.c 2021-02-18 12:20:20 +0200 Timo Sirainen (26bf371412) lib-storage: test-mailbox-list - Initialize namespace, user and event Required by the following change. M src/lib-storage/test-mailbox-list.c 2021-02-17 19:28:03 +0200 Timo Sirainen (e9912fbbff) lib-storage: mail-duplicate - Replace i_error() with e_error() M src/lib-storage/mail-duplicate.c 2021-02-17 19:16:58 +0200 Timo Sirainen (ad13ab0702) lib-storage: Add functions to get log prefixes This changes the log prefixes to be stored even when MAIL_STORAGE_SERVICE_FLAG_NO_LOG_INIT is used. M src/lib-storage/mail-storage-service.c M src/lib-storage/mail-storage-service.h 2021-02-03 20:37:49 +0200 Timo Sirainen (d46404a323) lib-storage: Initialize service_user's logging before creating ioloop context Needed by the next change. M src/lib-storage/mail-storage-service.c 2021-02-03 20:35:02 +0200 Timo Sirainen (e5caac3a90) lib-storage: Add PID to the default log prefix M src/lib-storage/mail-storage-service.c 2021-02-16 13:39:02 +0200 Aki Tuomi (120f30fbd4) doc/example: 10-metrics.conf - Add metrics related settings A doc/example-config/conf.d/10-metrics.conf M doc/example-config/conf.d/Makefile.am 2021-02-16 13:25:40 +0200 Aki Tuomi (4bc2e75557) doc/eaxmple: 10-logging.conf - Update syntax example to point to online documentation M doc/example-config/conf.d/10-logging.conf 2021-02-18 18:58:29 +0200 Timo Sirainen (9d269602cb) lib: event_get_last_duration() - Change it to return uintmax_t It can't be negative, so unsigned return value makes more sense. Also clarify the function comment and parameter name. M src/lib/lib-event.c M src/lib/lib-event.h M src/lib/test-event-log.c M src/stats/stats-metrics.c 2021-02-18 16:25:50 +0000 Siavash Tavakoli (b811181069) stats: openmetrics: Do microsecond to seconds conversion only for duration values Other metrics should be exported with their values unchanged. M src/stats/stats-service-openmetrics.c 2021-02-16 21:06:50 +0100 Martin Michaelis (9efdef3083) stats: openmentrics: Change histogram bucket unit to seconds In ae678116a79fff609cdf4fb1eb7eb3db2975bf1c the unit of durations was changed from microseconds to seconds, but the `le` field in histograms is still in microseconds. M src/stats/stats-service-openmetrics.c 2021-02-18 21:39:09 +0000 Siavash Tavakoli (e73615a40f) stats: refactor duration field name into a macro M src/stats/stats-metrics.c M src/stats/stats-metrics.h 2021-02-16 15:39:24 +0200 Timo Sirainen (a48bab26c6) lib-master: If config reading via doveconf exec fails, show details in the error M src/lib-master/master-service-settings.c 2021-02-16 15:38:36 +0200 Timo Sirainen (d199f1369b) lib-master: Reset master_service.config_path_from_master if -c parameter is used This doesn't fix anything currently, but clarifies the behavior and is needed by the following commit. M src/lib-master/master-service.c 2019-01-04 09:57:37 +0100 Stephan Bosch (cd17ae1d77) plugins: fts-solr: Use a private HTTP client. This is a workaround for problems with the http_client_request_send_payload() API that occur when several shared HTTP clients use this API at the same time and payload sending gets interleaved. M src/plugins/fts-solr/solr-connection.c 2019-01-04 09:55:20 +0100 Stephan Bosch (0d24830967) plugins: fts: tika: Use a private HTTP client. This is a workaround for problems with the http_client_request_send_payload() API that occur when several shared HTTP clients use this API at the same time and payload sending gets interleaved. M src/plugins/fts/fts-parser-tika.c 2021-02-17 13:18:55 +0200 Timo Sirainen (dc5e992d33) lib: test-cpu-limit - Increase ALLOW_MSECS_BELOW to 500ms The test still randomly failed with 100ms. Maybe 500ms is enough? M src/lib/test-cpu-limit.c 2021-02-17 13:18:38 +0200 Timo Sirainen (3178728945) lib: test-cpu-limit - Use test_assert_cmp() M src/lib/test-cpu-limit.c 2021-02-18 14:23:50 +0200 Timo Sirainen (09cb1a7d08) lib-test: Add test_assert_ucmp[_idx]() These are the unsigned versions of test_assert_cmp*() M src/lib-test/test-common.c M src/lib-test/test-common.h 2021-02-17 13:17:43 +0200 Timo Sirainen (1bb6d7189b) lib-test: Add test_assert_cmp[_idx]() Similar to test_assert_strcmp() but for numbers: If the comparison fails, print the values and the used operator. M src/lib-test/test-common.c M src/lib-test/test-common.h 2021-02-17 11:49:44 +0100 Markus Valentin (02bec0cfeb) acl: acl_lookup_dict_rebuild_update() Initialize dict_transaction_context *dt with NULL. Due to the changes done in bfa7433bfcf538af7c4fdafe37a88bde6508c751 dt could be used uninitialized. M src/plugins/acl/acl-lookup-dict.c 2021-02-17 01:02:34 +0200 Timo Sirainen (bf86675d35) Makefile.am: Don't delete dovecot.socket in make clean Broken by 0650928f3e3728911d6bcea4daf743df02ec1b3d M Makefile.am 2020-12-21 21:02:23 -0700 Michael M Slusarz (d275fba32b) imap: Fix PREVIEW behavior to support RFC 8970 M README.md M configure.ac M src/imap/imap-fetch-body.c M src/imap/imap-fetch.h 2021-02-17 14:40:06 +0200 Timo Sirainen (1227b34da9) mbox: Fix potentially logging read error when there was no error Broken by 959385969388b2d4f6d3d0218fa175481cb46c8a M src/lib-storage/index/mbox/istream-raw-mbox.c 2021-02-10 13:13:34 +0200 Timo Sirainen (c4f4058d16) imap: NOTIFY - Fix crash if client disconnects while sending FETCH notification Fixes: Panic: Trying to close mailbox INBOX with open transactions M src/imap/imap-notify.c M src/imap/imap-sync.c 2021-02-03 17:38:08 +0200 Timo Sirainen (c09b7032c1) doveadm: Avoid duplicate error logging with doveadm_print_istream() M src/doveadm/doveadm-print.c M src/doveadm/doveadm-print.h 2021-02-03 17:34:01 +0200 Timo Sirainen (da7208fb96) lib-compression, global: Remove support for implicit error logging M src/doveadm/doveadm-zlib.c M src/lib-compression/bench-compression.c M src/lib-compression/compression.h M src/lib-compression/istream-bzlib.c M src/lib-compression/istream-decompress.c M src/lib-compression/istream-lz4.c M src/lib-compression/istream-lzma.c M src/lib-compression/istream-zlib.c M src/lib-compression/istream-zlib.h M src/lib-compression/istream-zstd.c M src/lib-compression/ostream-zstd.c M src/lib-compression/test-compression.c M src/plugins/imap-zlib/imap-zlib-plugin.c M src/plugins/zlib/zlib-plugin.c 2021-02-03 17:04:49 +0200 Timo Sirainen (1a388627f1) doveadm zlibconnect: Avoid duplicate error logging The istream errors are already logged with i_fatal(). There's no need for a duplicate error. M src/doveadm/doveadm-zlib.c 2021-02-03 17:04:16 +0200 Timo Sirainen (e58e57cb7e) doveadm dump -t imapzlib: Explicitly log compress istream errors M src/doveadm/doveadm-zlib.c 2021-02-03 16:57:30 +0200 Timo Sirainen (fb92b79819) zlib: Remove extra error logging for istream failures The error will nowadays be logged as the istream error anyway. M src/plugins/zlib/zlib-plugin.c 2021-02-03 17:32:11 +0200 Timo Sirainen (9593859693) mbox: istream-raw-mbox - Log parent istream read errors M src/lib-storage/index/mbox/istream-raw-mbox.c 2021-02-03 17:18:18 +0200 Timo Sirainen (1ae18869a5) mbox: Use mbox_ostream_set_syscall_error() M src/lib-storage/index/mbox/mbox-save.c M src/lib-storage/index/mbox/mbox-sync-rewrite.c 2021-02-03 17:24:14 +0200 Timo Sirainen (e884af64a7) mbox: Use mbox_istream_set_syscall_error() M src/lib-storage/index/mbox/mbox-sync.c 2021-02-03 17:18:09 +0200 Timo Sirainen (b00e7d5660) mbox: Add mbox_[io]stream_set_syscall_error() This allows logging the iostream-specific error rather than the more generic errno. M src/lib-storage/index/mbox/mbox-storage.c M src/lib-storage/index/mbox/mbox-storage.h 2020-04-23 15:26:22 +0300 Alex/AT (f753ea9b31) lib-master: Fix haproxy PROXY protocol LOCAL type connection behavior when header includes address information or TLVs PROXY protocol LOCAL type headers can actually include supplementary information (addresses, TLVs) which need to be skipped to correctly handle the header. Fixes Invalid TLV bug with haproxy 2.0.14 service checks. More info here: https://github.com/haproxy/haproxy/issues/511 And here: https://www.mail-archive.com/haproxy@formilux.org/msg36890.html M src/lib-master/master-service-haproxy.c 2021-02-16 16:40:35 +0200 Timo Sirainen (ded811b345) lib: cpu-limit - Don't round current CPU usage up when checking if rlim_max is reached The fatal error could trigger half a second too early. Also always increase the provided cpu_limit_sec by 1 second to make sure it won't trigger too early. Although even with this change it can still trigger a few milliseconds too early for some reason. M src/lib/cpu-limit.c 2021-02-16 16:42:54 +0200 Timo Sirainen (5b87dcaf94) lib: cpu-limit - Allow time comparisons to be more relaxed This should fix random failures. M src/lib/test-cpu-limit.c 2020-11-10 16:33:41 +0200 Timo Sirainen (7db69420cf) lib-storage: Fix assert-crash when parsing binary attachments EOF may not have been detected in the cur_block istream early enough, causing the calculation to go wrong. This happened at least with empty base64 bodies, but could have possibly happened in other situations also. Fixes: Panic: file index-mail-binary.c: line 357 (blocks_count_lines): assertion failed: (block_count == 0 || block_idx+1 == block_count) M src/lib-storage/index/index-mail-binary.c 2021-02-12 14:45:39 +0200 Aki Tuomi (1f135ee6d2) config: test-config-parser - Change filename to match .gitignore pattern M src/config/test-config-parser.c 2021-02-12 14:32:01 +0200 Aki Tuomi (412d9554e9) config: test-config-parser - Cleanup input file after test M src/config/test-config-parser.c 2021-02-01 15:38:49 +0100 Markus Valentin (bfa7433bfc) acl: acl_lookup_dict_rebuild_update() - Commit transaction after each [un]set When used with Cassandra an error can occur if multiple changes are included into one transaction: "Multiple changes in transaction not supported". Prevent these errors by committing every change on it's own. M src/plugins/acl/acl-lookup-dict.c 2020-12-16 00:13:19 +0200 Timo Sirainen (5d3d8e5dac) lib-storage: Fix assert-crash in shared namespace if storage has no directories This allows using imapc with shared namespaces. Fixes: Panic: file mailbox-list.c: line 1419: unreached M src/lib-storage/index/shared/shared-storage.c 2020-12-16 00:09:32 +0200 Timo Sirainen (32da598980) acl: Add acl_ignore_namespace* settings Ignore ACLs entirely for the listed namespaces. For example: plugin { acl_ignore_namespace = virtual/ acl_ignore_namespace2 = shared/* } M src/plugins/acl/acl-mailbox-list.c 2021-02-07 09:23:03 +0100 Simon Rupf (da1dad0097) util: health-check - Timeout the read via trap for POSIX shell compatibility M src/util/health-check.sh 2021-01-23 11:29:22 +0100 Simon Rupf (5510fd8854) util: health-check - Consistent variable style M src/util/health-check.sh 2021-01-23 11:07:36 +0100 Simon Rupf (ce3a0fdd36) util: health-check - Made bash script compatible with dash shell M src/util/health-check.sh 2020-05-24 23:15:53 +0200 Nis Martensen (0650928f3e) Makefile.am: fix typo and broken variable assignment M Makefile.am 2020-05-24 22:05:42 +0200 Nis Martensen (daee059866) systemd integration: notify service manager when ready With Type=simple or Type=forking, systemd does not really know when the service is ready to accept connections and might start depending services too early. Use Type=notify to explicitly tell the service manager when the service is ready. For a real problem caused by assuming readiness too early, please see https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=951722 For the meaning of the service type and details of the readiness protocol, see also the following links: https://www.freedesktop.org/software/systemd/man/systemd.service.html#Type= https://www.freedesktop.org/software/systemd/man/sd_notify.html As discussed in the last link, more elaborate state notifications are possible. This patch only implements the most basic part. Original patch prepared by Michael Biebl, with slight modification. M dovecot.service.in M src/lib-master/master-service-settings.c M src/master/main.c 2020-10-29 01:04:26 +0100 Stephan Bosch (ea851d0745) lib: Add API for limiting CPU usage of subroutines. M src/lib/Makefile.am A src/lib/cpu-limit.c A src/lib/cpu-limit.h A src/lib/test-cpu-limit.c M src/lib/test-lib.inc 2020-10-29 01:09:17 +0100 Stephan Bosch (3ce88c8669) lib: time-util - Add support for rounding off timeval to a time_t value. M src/lib/time-util.h 2020-10-29 01:06:57 +0100 Stephan Bosch (f3fff8e029) lib: time-util - Add support for calculating the sum of two timeval values. M src/lib/time-util.h 2021-02-01 12:33:02 +0000 Siavash Tavakoli (4341feba66) run-test-valgrind.supp: Add more suppressions M run-test-valgrind.supp 2021-01-28 23:09:00 +0000 Siavash Tavakoli (6e13107de7) dsync: Add namespace prefixes to mailbox tree Adds syncing selectable namespace prefixes, especially shared INBOXes with "mail_shared_explicit_inbox=yes". M src/doveadm/dsync/dsync-mailbox-tree-fill.c 2021-01-07 09:40:51 +0000 Siavash Tavakoli (6832759cf5) dsync: Check namespace prefix when syncing shared namespaces When iterating over namespaces, comparing namespace pointers doesn't work for shared namespaces. Instead, check the prefix and include all the mailboxes in the namespace for syncing. M src/doveadm/dsync/dsync-brain.c 2021-01-19 10:33:17 +0000 Siavash Tavakoli (cd0a0a4240) dsync: Don't send out of tree namespace parents for syncing For namespaces prefixes with multiple hierarchical names, we shouldn't send parents (i.e. first part/parts of the prefix) that are outside of syncing. M src/doveadm/dsync/dsync-brain-mailbox-tree.c 2021-02-04 20:54:14 +0000 Siavash Tavakoli (c452b7177e) lib-storage: Cache mailbox's namespace prefix if selectable If namespace prefix is a selectable mailbox, mailbox_guid_cache_refresh should add it to cache. M src/lib-storage/mailbox-guid-cache.c 2021-02-04 15:57:09 +0000 Siavash Tavakoli (fd350bc887) lib-storage: Add mailbox_guid_cache_add_mailbox() Refactored caching logic in mailbox_guid_cache_refresh to this new function. M src/lib-storage/mailbox-guid-cache.c 2021-02-04 20:52:19 +0000 Siavash Tavakoli (74005f66c0) lib-storage: Add mail_namespace_prefix_is_inbox() M src/lib-storage/mail-namespace.h 2021-02-04 01:42:52 +0000 Siavash Tavakoli (be9a813f05) lib-storage: Skip private server attributes for shared inboxes Private server attributes should be iterated only for user's own inbox. M src/lib-storage/mailbox-attribute.c 2021-02-01 17:53:59 +0000 Siavash Tavakoli (27b25d6942) lib-storage: mailbox-list-iter: Send delayed inbox after actually seeing the inbox Control delayed inbox listing with a flag in ns_list_iterate_context. Send only when the inbox is actually seen. M src/lib-storage/list/mailbox-list-iter.c 2021-02-02 12:43:50 +0000 Siavash Tavakoli (f137dce5b6) lib-index: Fix implicit integer truncation found by ubsan M src/lib-index/mail-index-transaction-view.c 2021-02-03 15:55:14 +0200 Timo Sirainen (9accb79b48) lib-index: Avoid a duplicate "missing middle file seq" warning. The previous changes fixed repeating warning, but it was still possible that the warning was logged twice. Now it's logged only once. M src/lib-index/mail-index-view-sync.c 2021-02-01 17:49:18 +0200 Timo Sirainen (f47f204636) lib-index: Change "missing middle file seq" error into warning It's not really an error, but it has been useful in finding performance problems. Possibly it should be changed into a named event at some point. M src/lib-index/mail-index-view-sync.c 2021-02-01 17:02:24 +0200 Timo Sirainen (c118345086) lib-index: view_sync_set_log_view_range() - Move error logging to parent M src/lib-index/mail-index-view-sync.c 2021-02-01 16:53:18 +0200 Timo Sirainen (c038c664ea) lib-index: Fix repetitive "missing middle file seq" error. If a view keeps being synced with MAIL_INDEX_VIEW_SYNC_FLAG_NOEXPUNGES, every sync regenerated the missing log files and logged this error. This could have resulted in lots of errors being logged about it, as well as unnecessary CPU usage. The view syncing was always syncing from the last "expunge log position", even when expunges weren't being synced. The new behavior is to do that only when expunges are synced, but otherwise use the "head log position" to sync only the new changes since the last view sync. The error is now logged once when the log is first noticed being lost. Another error is logged when pending expunges are synced. M src/lib-index/mail-index-view-sync.c 2021-01-26 09:30:42 +0200 Aki Tuomi (93014e52f8) m4: dovecot.m4 - Execute tests with libtool This allows libtool to do all the necessary preparations before test harness is used. M m4/dovecot.m4 2021-01-26 09:29:44 +0200 Aki Tuomi (c0b98d9284) m4: dovecot.m4 - Find out and use absolute path to valgrind M m4/dovecot.m4 2021-02-08 10:05:47 +0200 Aki Tuomi (a25fa78789) lib-settings: test-settings-parser - Use ULL suffix Some of the sizes do not fit to UL in 32 bit systems. M src/lib-settings/test-settings-parser.c 2021-01-22 14:00:21 -0500 Josef 'Jeff' Sipek (6e5ae5ef0f) lib-compression: Remove xz/lzma write support For now, we keep the read support to allow for a more gradual migration from lzma/xz. The code has bugs. Additionally, there is no benefit in keeping it around. bzip2 or zstd (at maximum compression level) are likely better choices for archival. For non-archival usecases, a light compression algorithm like zstd (at low to medium compression level) or lz4 are better choices. M configure.ac M run-test-valgrind.supp M src/lib-compression/Makefile.am M src/lib-compression/compression.c D src/lib-compression/ostream-lzma.c M src/lib-compression/ostream-zlib.h M src/lib-compression/test-compression.c 2021-01-28 17:04:37 +0200 Aki Tuomi (4b1c694608) lib-mail: test-message-snippet - Add unit tests for multipart messages M src/lib-mail/test-message-snippet.c 2021-02-03 17:22:07 +0200 Aki Tuomi (c8c1e9d840) lib-mail: test-message-snippet - Use test_assert_strcmp Makes it easier to see what failed. M src/lib-mail/test-message-snippet.c 2021-01-28 16:52:10 +0200 Aki Tuomi (5f9da73421) lib-mail: Reformat test-message-snippet.c M src/lib-mail/test-message-snippet.c 2021-01-28 17:01:38 +0200 Aki Tuomi (c276029aed) lib-mail: message-snippet - Stop building snippet on first non-empty part When we have gotten some snippet out of first eligible part, we can stop. M src/lib-mail/message-snippet.c 2021-01-28 16:48:05 +0200 Aki Tuomi (964e60417a) lib-mail: message-snippet - Do not stop on first non-text part Some mail structures would break snippet generation because the code would stop on multipart. M src/lib-mail/message-snippet.c 2021-01-28 11:07:32 +0200 Aki Tuomi (c5842d9cfe) lib-mail: message-snippet - Free html parser before making new If html parser has already been initialized, free it before restarting the parser. Fixes memory leak introduced by 7f7be2cbf68f8a202a688d5bc50f82483d461643 M src/lib-mail/message-snippet.c 2021-02-04 08:59:29 +0200 Aki Tuomi (bf8286ac5b) stats: stats-service-openmetrics - Use PRIdTIME_T for startup time M src/stats/stats-service-openmetrics.c 2021-02-04 08:57:24 +0200 Aki Tuomi (b97fa96434) login: login-proxy - Fix type conflict M src/login-common/login-proxy.c 2021-02-04 08:54:59 +0200 Aki Tuomi (77de43799e) lib-mail: test-message-header-decode - Use ptrdiff_t for rep_char_len The length is compared to a pointer difference, so using ptrdiff_t squashes a warning. M src/lib-mail/test-message-header-decode.c 2021-02-04 08:46:51 +0200 Aki Tuomi (e38c52558e) lib-settings: test-setting-parser - Use correct type in test SIZE uses uoff_t. M src/lib-settings/test-settings-parser.c 2021-02-04 08:45:37 +0200 Aki Tuomi (8aa7f840c6) lib: backtrace - Use correct format modifier Matches size_t correctly. M src/lib/backtrace-string.c 2021-02-04 08:44:46 +0200 Aki Tuomi (01366bd18e) lib: test-time-util - Use correct types for test case Fixes type mismatch on 32-bit systems. M src/lib/test-time-util.c 2021-01-19 19:11:47 +0100 Timo Sirainen (0ac71cbbc9) master: Fix reopening log files on SIGUSR1 M src/master/main.c 2021-01-19 19:11:20 +0100 Timo Sirainen (34f7b38b50) man: Clarify how doveadm log reopen works M doc/man/doveadm-log.1.in 2021-01-28 16:45:45 +0100 Timo Sirainen (260b49d7a3) dovecot.service.in: Update documentation URL M dovecot.service.in 2021-01-22 13:19:05 +0200 Timo Sirainen (264d67d6f0) lib-master: test-event-stats - Fix unit test when compiling using build directory When using build directory __FILE__ expands to "../../../src/lib-master/test-event-stats.c", which doesn't match "test-event-stats.c" what is normally used. M src/lib-master/test-event-stats.c 2021-01-18 18:14:47 +0200 Aki Tuomi (001d919b9d) lib-master: test-event-stats - Cast test value to uint64_t M src/lib-master/test-event-stats.c 2021-01-04 16:31:03 +0000 Paul Howarth (2cc1feca90) lib: Fix timeval_cmp_margin for 32-bit systems The test suite compares times with seconds values of -INT_MAX and INT_MAX. The result of this comparison does not fit in a value of type int and so the test suite fails on 32-bit systems where time_t is an int. To fix this, calculations on seconds values are done using long long integers. Broken by 16ab5542 M src/lib/time-util.c 2021-01-26 17:44:46 +0200 Timo Sirainen (195f6742c3) dsync: Use a better default vname escape character A control character was a bit unreadable in strings. M src/doveadm/doveadm-dsync.c 2021-01-26 18:55:22 +0200 Timo Sirainen (00c7664505) dsync: Replace escape characters in outgoing mailbox names with alt_char Especially when dsync is used for migration, we don't want to end up having invalid mUTF7 mailbox names locally. Also, remote might not even be configured to use the same escape character. M src/doveadm/dsync/dsync-brain-mailbox-tree.c 2021-01-26 18:54:53 +0200 Timo Sirainen (11b549e552) dsync: Send alt_char also to slave brain M src/doveadm/doveadm-dsync.c M src/doveadm/dsync/dsync-brain.c M src/doveadm/dsync/dsync-brain.h M src/doveadm/dsync/dsync-ibc-stream.c M src/doveadm/dsync/dsync-ibc.h M src/doveadm/dsync/dsync-mailbox-tree.c 2021-01-18 23:53:50 +0200 Timo Sirainen (ae3de56ed9) lib-storage: mailbox_list_escape_name_params() - Assert that escape_char isn't NUL M src/lib-storage/mailbox-list.c 2021-01-15 19:27:00 +0200 Timo Sirainen (d02d59d343) imapc: Add comment explaining various mailbox names M src/lib-storage/index/imapc/imapc-list.c 2021-01-18 23:31:28 +0200 Timo Sirainen (b4ae3a5fac) imapc: fs mailbox_list - Remove vname_escape_char This isn't necessary. M src/lib-storage/index/imapc/imapc-list.c 2021-01-18 23:30:28 +0200 Timo Sirainen (1535a2ddbb) imapc: Add IMAPC_LIST_FS_NAME_ESCAPE_CHAR This clarifies how the escape characters are used. M src/lib-storage/index/imapc/imapc-list.c M src/lib-storage/index/imapc/imapc-storage.h 2021-01-18 23:23:37 +0200 Timo Sirainen (2a42647297) imapc: Add a default vname_escape_char Having vname_escape_char guarantees that all the remote mailbox names are accessible by escaping them as necessary. M src/lib-storage/index/imapc/imapc-storage.c 2021-01-18 23:19:01 +0200 Timo Sirainen (6abcea7e0a) imapc: Fix local filesystem directory name escaping Use the remote mailbox name as the base. Convert the hierarchy separator and add escaping as necessary. The old method was based on storage_name, and it's a bit unclear if it worked correctly in all situations. M src/lib-storage/index/imapc/imapc-list.c 2021-01-16 17:20:46 +0200 Timo Sirainen (fc0be41d1d) imapc: Add imapc_list_remote_to_storage_name() M src/lib-storage/index/imapc/imapc-list.c 2021-01-16 15:03:59 +0200 Timo Sirainen (d8d1e4db34) imapc: Fix remote/storage mailbox name mismatches M src/lib-storage/index/imapc/imapc-storage.c 2021-01-16 15:00:06 +0200 Timo Sirainen (0e2c465f45) imapc: Use more explicit mailbox name variable names Clearly specify which type of a mailbox name it is to avoid misunderstandings. M src/lib-storage/index/imapc/imapc-list.c M src/lib-storage/index/imapc/imapc-storage.c 2021-01-16 14:44:00 +0200 Timo Sirainen (ec9ad14e8a) imapc: Rename imapc_list_get_fs_name() to imapc_list_storage_to_fs_name() M src/lib-storage/index/imapc/imapc-list.c 2021-01-16 14:41:24 +0200 Timo Sirainen (caa30d512b) imapc: Rename imapc_list_to_vname() to imapc_list_remote_to_vname() M src/lib-storage/index/imapc/imapc-list.c 2021-01-16 14:40:54 +0200 Timo Sirainen (b840f1fc1e) imapc: Rename imapc_list_to_remote() to imapc_list_storage_to_remote_name() M src/lib-storage/index/imapc/imapc-list.c M src/lib-storage/index/imapc/imapc-list.h M src/lib-storage/index/imapc/imapc-storage.c 2021-01-14 17:45:07 +0200 Timo Sirainen (bd8839f99c) lib-storage: mailbox_list_default_get_storage_name() - Escape ns_prefix/INBOX if possible If storage_name_escape_char is set, escape the "I" letter in the storage_name if the namespace also has inbox=yes. This way it's possible to distinguish between the actual INBOX and ns_prefix/INBOX. M src/lib-storage/mailbox-list.c M src/lib-storage/test-mailbox-list.c 2021-01-14 17:33:13 +0200 Timo Sirainen (a243cdb748) lib-storage: Update mailbox_list_settings.{vname|storage_name}_escape_char comments Also add the examples in the comments to unit tests to make sure they really work. M src/lib-storage/mailbox-list.h M src/lib-storage/test-mailbox-list.c 2021-01-14 17:27:03 +0200 Timo Sirainen (73364f0f2b) lib-storage: Fix mailbox name escape/unescape ordering This fixes some cases like not properly escaping '/' in storage_name if it was also the namespace separator. This also allows using the same character for both vname_escape_char and storage_name_escape_char. M src/lib-storage/mailbox-list.c M src/lib-storage/test-mailbox-list.c 2021-01-14 17:07:34 +0200 Timo Sirainen (6adcea35e5) lib-storage: mailbox_list_default_get_vname() - Fix escaping namespace separator in storage_name For example if { storage_name="foo/bar", storage_sep=".", ns_sep="/" } the "/" in the name shouldn't be treated as a namespace separator. If vname_escape_char is set, it should be returned escaped instead. M src/lib-storage/mailbox-list.c M src/lib-storage/test-mailbox-list.c 2021-01-14 16:38:04 +0200 Timo Sirainen (e3be8553d3) lib-storage: Use imap_escaped_utf8_to_utf7() M src/lib-storage/mailbox-list.c 2021-01-14 16:32:25 +0200 Timo Sirainen (c50fd4ddf1) lib-storage: Use imap_escaped_utf8_hex_to_char() M src/lib-storage/mailbox-list.c 2021-01-14 16:23:24 +0200 Timo Sirainen (9d41e00eda) lib-storage: Use mailbox_list_settings.vname_escape_char also with utf8 storage names mailbox_list_default_get_storage_name() was already unescaping with utf8, so mailbox_list_default_get_vname() should also be escaping with utf8. M src/lib-storage/mailbox-list.c M src/lib-storage/test-mailbox-list.c 2021-01-14 15:40:44 +0200 Timo Sirainen (6da08d8c61) lib-storage: mailbox_list_default_get_vname() - Use imap_utf7_to_utf8_escaped() This changes the output a bit for broken mUTF7 names. Previously if any part of the string had broken mUTF7 input, none of it was converted. Now it's instead trying to convert as much as it can. M src/lib-storage/mailbox-list.c M src/lib-storage/test-mailbox-list.c 2021-01-14 15:09:34 +0200 Timo Sirainen (5f858f84b9) lib-storage: mailbox_list_default_get_vname() - Escape each hierarchical name separately Same reasoning as for the similar change for mailbox_list_default_get_storage_name(). M src/lib-storage/mailbox-list.c 2021-01-14 12:47:55 +0200 Timo Sirainen (af18e441c9) lib-storage: Split off mailbox_list_storage_name_prepare() M src/lib-storage/mailbox-list.c 2021-01-14 12:34:48 +0200 Timo Sirainen (8f139ccc9f) lib-storage: mailbox_list_default_get_storage_name() - Escape each hierarchical name separately This makes it possible in the following commits to allow unescaping to write namespace hierarchy separator character without converting it into the mailbox_list separator. M src/lib-storage/mailbox-list.c 2021-01-14 12:30:54 +0200 Timo Sirainen (5fd5ad3a2b) lib-storage: mailbox_list_default_get_storage_name() - Cleanup shared namespace root handling M src/lib-storage/mailbox-list.c 2021-01-14 12:03:58 +0200 Timo Sirainen (0dc071a974) lib-storage: Split off mailbox_list_vname_prepare() This also slightly changes the code logic. mailbox_list_escape_name() is now called also for INBOX, but that doesn't actually matter. M src/lib-storage/mailbox-list.c 2021-01-14 15:22:20 +0200 Timo Sirainen (4224bb8302) lib-storage: Remove mailbox_list_unescape_name() by moving its code inline There was only a single caller for this function. It doesn't need to exist. M src/lib-storage/mailbox-list-private.h M src/lib-storage/mailbox-list.c 2021-01-14 15:20:13 +0200 Timo Sirainen (20e26b52d5) lib-storage: Remove mailbox_list_escape_name() by moving its code inline There was only a single caller for this function. It doesn't need to exist. M src/lib-storage/mailbox-list-private.h M src/lib-storage/mailbox-list.c 2021-01-13 20:55:43 +0200 Timo Sirainen (71877ef5e4) lib-storage: Add unit tests for mailbox_list_default_get_{storage_name|vname}() M src/lib-storage/test-mailbox-list.c 2021-01-13 18:50:38 +0200 Timo Sirainen (7b794d3070) lib-storage: Rename mailbox_list_settings.broken_char to vname_escape_char This clarifies that it's only used in vnames. M src/doveadm/doveadm-dsync.c M src/lib-storage/index/imapc/imapc-list.c M src/lib-storage/index/imapc/imapc-storage.h M src/lib-storage/mailbox-list.c M src/lib-storage/mailbox-list.h 2021-01-13 18:47:11 +0200 Timo Sirainen (5cfd6cec1d) lib-storage: Rename mailbox_list_settings.escape_char to storage_name_escape_char This clarifies that it's only used in storage_names. M src/lib-storage/index/imapc/imapc-list.c M src/lib-storage/index/imapc/imapc-storage.c M src/lib-storage/index/imapc/imapc-storage.h M src/lib-storage/mail-storage.c M src/lib-storage/mailbox-list.c M src/lib-storage/mailbox-list.h M src/plugins/listescape/listescape-plugin.c 2021-01-13 19:50:50 +0200 Timo Sirainen (bffa6a9c0c) lib-imap: Add imap_utf7_to_utf8_escaped() and imap_escaped_utf8_to_utf7() These can be used to convert invalid mUTF-7 to escaped UTF-8 and back to the original invalid input. M src/lib-imap/imap-utf7.c M src/lib-imap/imap-utf7.h M src/lib-imap/test-imap-utf7.c 2021-01-13 19:48:15 +0200 Timo Sirainen (db7054d86a) lib-imap: test-imap-utf7 - Simplify test_imap_utf7_non_utf16() M src/lib-imap/test-imap-utf7.c 2021-01-13 19:19:37 +0200 Timo Sirainen (40070778c0) lib-imap: Move unnecessary shift check to mbase64_decode_to_utf8() M src/lib-imap/imap-utf7.c 2021-01-13 19:17:18 +0200 Timo Sirainen (02f35f281e) lib-imap: test-imap-utf7 - Improve/clarify testing '&' & is never base64-encoded. M src/lib-imap/test-imap-utf7.c 2021-01-25 13:32:18 +0200 Aki Tuomi (aeea2ce10e) config: Add unit test for config parser M src/config/Makefile.am A src/config/test-config-parser.c 2021-01-20 10:07:56 +0200 Aki Tuomi (686c1f22a0) config: Extract sources to libconfig.la Makes unit testing possible M src/config/Makefile.am 2021-01-19 11:54:15 +0200 Aki Tuomi (8ab5ea3dd6) lib-settings: test-settings - Add tests for settings file M configure.ac M src/lib-settings/Makefile.am A src/lib-settings/test-settings.c 2021-01-18 15:43:06 +0200 Aki Tuomi (dc5600c988) test-settings-parser: Add test for size M src/lib-settings/test-settings-parser.c 2021-01-18 15:32:51 +0200 Aki Tuomi (c064eea80e) lib-settings: test-settings-parser - Add test for settings parser M src/lib-settings/test-settings-parser.c 2021-01-18 14:11:28 +0200 Aki Tuomi (4b0ffe1630) lib-settings: Add support for $ENV:name Expands into given environment variable M src/lib-settings/settings.c 2020-01-22 14:34:15 +0200 Aki Tuomi (479223dc56) config: Add support for $ENV:name Expands into given environment variable M src/config/config-parser.c 2020-01-22 14:33:38 +0200 Aki Tuomi (2edc5200f8) config: Expand multiple variables per line Needed to properly support environment variables. M src/config/config-parser.c 2021-01-20 10:49:23 +0200 Aki Tuomi (9c6bc94d9d) config: config-parser - Add config_write_keyvariable Move code handling key variable expansion to separate function. Simplifies next commit. M src/config/config-parser.c 2021-01-12 13:53:19 -0500 Josef 'Jeff' Sipek (18ddfa4eda) lib-storage: Make lua methods and functions use the passed in lua_State * directly M src/lib-storage/mail-user-lua.c M src/lib-storage/mailbox-lua.c 2021-01-12 14:27:31 -0500 Josef 'Jeff' Sipek (fd03e3c9a2) lib-storage: Make dlua_push_mail() take lua_State * directly M src/lib-storage/mail-lua.c M src/lib-storage/mail-storage-lua.h 2021-01-12 14:26:07 -0500 Josef 'Jeff' Sipek (fba66539f2) lib-storage: Make dlua_push_mail_user() take lua_State * directly M src/lib-storage/mail-storage-lua.h M src/lib-storage/mail-user-lua.c M src/plugins/mail-lua/mail-lua-plugin.c M src/plugins/push-notification/push-notification-driver-lua.c 2021-01-12 13:30:45 -0500 Josef 'Jeff' Sipek (8c77a11e89) lib-storage: Make lua_storage_cmp() take lua_State * directly M src/lib-storage/mail-storage-lua-private.h M src/lib-storage/mail-user-lua.c M src/lib-storage/mailbox-lua.c 2021-01-12 12:59:39 -0500 Josef 'Jeff' Sipek (9e2ceb472e) lib-storage: Make lua_check_storage_mailbox() take lua_State * directly M src/lib-storage/mailbox-lua.c 2021-01-12 12:02:05 -0500 Josef 'Jeff' Sipek (f15ca44e54) lib-storage: Make dlua_push_mailbox() take lua_State * directly M src/lib-storage/mail-lua.c M src/lib-storage/mail-storage-lua.h M src/lib-storage/mail-user-lua.c M src/lib-storage/mailbox-lua.c 2021-01-07 18:12:27 +0200 Timo Sirainen (7e98d506b0) master: Send instance_name setting to log process This way log process can use it for syslog ident M src/lib-master/master-service-settings.h M src/master/service-process.c 2020-12-07 15:58:00 +0200 Timo Sirainen (f1a97bdc3d) cassandra: Fix logging messages with LFs At least some trace level messages had them. M src/lib-sql/driver-cassandra.c 2020-04-18 12:56:14 +0200 Stephan Bosch (4a7f625eed) m4: Fix configuration of libunwind on i386 (and probably other systems). Use the standard libunwind-coredump instead of the system-dependent library. This way, all can be configured using pkg-config, without relying on a failed attempt to use the $build_cpu variable to find the system-dependent library. This fails on i386 and probably other systems as well. M m4/want_unwind.m4 M run-test-valgrind.supp 2020-03-25 16:20:08 +0200 Timo Sirainen (7036a7bfe1) lib-imap: imap_bodystructure_write() - Add asserts to check unexpected NULLs inside lists This just changes the assert that already triggers into a bit clearer assert. M src/lib-imap/imap-bodystructure.c 2020-03-25 15:52:29 +0200 Timo Sirainen (8818482ba6) lib-imap: Add unit test for invalid BODYSTRUCTUREs M src/lib-imap/test-imap-bodystructure.c 2020-03-25 15:52:02 +0200 Timo Sirainen (d749c280bf) lib-imap: imap_arg_get/as_nstring() - fail if input is an atom Atoms were wrongly allowed in these places. These have been used in very few places, so this change should be pretty safe to do. The only affected places are: * SETMETADATA - Backwards compatibility preserved by earlier commit * ID - It's not expected that any clients use atoms here * imapc - Server replies are parsed more strictly now M src/lib-imap/imap-arg.c M src/lib-imap/imap-bodystructure.c 2020-03-25 15:49:37 +0200 Timo Sirainen (dd43103e2a) lib-imap: Don't wrongly accept NILs or atoms when parsing BODYSTRUCTURE Especially NILs could cause crashes later on when some internal field is NULL when it's not expectedly to be. Fixes a crash when parsing BODYSTRUCTURE and writing it out with imap_bodystructure_write() when some of the parameter lists contained NILs. M src/lib-imap/imap-bodystructure.c 2020-03-25 15:47:51 +0200 Timo Sirainen (69be6e9a89) lib-imap: imap_body_parse_from_bodystructure() - Write size field as atom Following changes will break writing it as nstring. M src/lib-imap/imap-bodystructure.c 2020-03-25 16:00:08 +0200 Timo Sirainen (923362d27d) imap: SETMETADATA - Explicitly support using atoms for values Required to keep atoms working (and especially not assert-crashing) after the following imap_arg_get_nstring() change. M src/imap/cmd-setmetadata.c 2021-01-20 11:15:18 -0500 Josef 'Jeff' Sipek (429a12a38b) lib: event-filter - Implement event_filter_merge() unit test M src/lib/Makefile.am A src/lib/test-event-filter-merge.c M src/lib/test-lib.inc 2021-01-12 11:15:44 -0500 Josef 'Jeff' Sipek (ebb4a80f8e) lib: event-filter - Use p_strdup() instead of p_strdup_empty() to avoid NULLs The code used p_strdup_empty() in an (incorrect) attempt to avoid NULLs turning into empty strings (""). None of the strdup variants do this. However, p_strdup_empty() converts empty strings to NULLs. This caused a NULL pointer dereference later on. M src/lib/event-filter-parser.y M src/lib/event-filter.c 2021-01-21 09:15:10 +0200 Aki Tuomi (9577b94d55) lib: test-lib - Free event filters Fixes memory leak Forgotten from 01ccf687d660331ca3e483c90582156757cebb7f M src/lib/test-event-filter-expr.c 2021-01-19 13:46:13 -0500 Josef 'Jeff' Sipek (01ccf687d6) lib: event-filter - Implement filter boolean expression unit tests This is a exhaustive test of the boolean operators using field equality comparisons. This test code focuses on the boolean operators (AND, OR, NOT) and not on the comparison operators (=, <, >, <=, and >=) and their arguments (event names, source locations, categories). M src/lib/Makefile.am A src/lib/test-event-filter-expr.c M src/lib/test-lib.inc 2021-01-19 13:42:17 -0500 Josef 'Jeff' Sipek (7843020071) lib: event-filter - Correct a comment referring to old filter syntax M src/lib/event-filter.c 2021-01-19 13:41:45 -0500 Josef 'Jeff' Sipek (ae60143ac7) lib: event-filter - Add a helper function to get at the filter's boolean expression This is necessary for the soon-to-be-implemented unit tests. M src/lib/event-filter-private.h M src/lib/event-filter.c 2021-01-19 13:40:17 -0500 Josef 'Jeff' Sipek (586b2386e4) lib: event-filter - Expose internal functions to allow for unit testing We'll need these to avoid code duplication when unit testing the boolean expression evaluation logic. M src/lib/event-filter-private.h M src/lib/event-filter.c 2021-01-04 12:01:28 -0500 Josef 'Jeff' Sipek (abe9c7585d) lib: event-filter - Make NOT operator right associative and higher precedence For example, consider the filter: event=* AND NOT event=foo AND NOT event=bar AND NOT event=baz The "NOT" operator is supposed to be bound to the comparisons to the immediate right. That is, it supposed to be equivalent to: event=* AND (NOT event=foo) AND (NOT event=bar) AND (NOT event=baz) Both of these should produce the following parse tree: AND AND AND EQ EVENT '*' NOT EQ EVENT 'foo' NOT EQ EVENT 'bar' NOT EQ EVENT 'baz' Instead, before this commit, the NOTs were getting bound to the entire sub-expression to the right. Therefore, the original filter expression was being parsed as if it were: event=* AND NOT (event=foo AND NOT (event=bar AND NOT event=baz)) Which produced the following parse tree: AND EQ EVENT '*' NOT AND EQ EVENT 'foo' NOT AND EQ EVENT 'bar' NOT EQ EVENT 'baz' M src/lib/event-filter-parser.y 2021-01-14 20:31:18 +0100 Philippe Antoine (709727324b) lib-test: fuzzer - Don't crash in targets without ioloop M src/lib-test/fuzzer.c 2021-01-18 17:53:36 +0100 Timo Sirainen (93652abc5f) auth: Makefile.am - Use $(LIBDOVECOT_LUA) instead of redefining it M src/auth/Makefile.am 2021-01-18 17:53:07 +0100 Timo Sirainen (4d610d1664) auth: Fix building built-in lua It was working only when building as plugin. M src/auth/Makefile.am 2021-01-18 13:46:55 +0100 Timo Sirainen (77702eda2b) lib: test-buffer - Fix memory leak errors in fatal buffer tests M src/lib/test-buffer.c 2021-01-18 13:46:46 +0100 Timo Sirainen (45c915ec94) lib-test: Add test_fatal_set_callback() M src/lib-test/test-common.c M src/lib-test/test-common.h 2021-01-18 11:38:04 +0200 Aki Tuomi (2c84623c0a) lib-master: test-event-stats - Add test for large event id Ensure UPDATE command syntax is correct when event id is over 1 million M src/lib-master/test-event-stats.c 2020-12-21 10:45:32 +0000 Siavash Tavakoli (141766b24f) indexer: Remove worker-specific request queue - Each request is done in a single connection and indexer master disconnects from worker after indexing job is complete. - No need to keep a worker queue since it always have length of 1. Instead, keep a pointer to indexer_request for each worker connection. - If indexing is in progress for a user, don't try to use the same connection when a new request arrives for the same user. Instead, move the request to the back of the queue and wait for the in progress request to finish then create a new connection and submit request to worker. M src/indexer/indexer-queue.c M src/indexer/indexer-queue.h M src/indexer/indexer.c M src/indexer/worker-connection.c M src/indexer/worker-connection.h 2020-12-20 19:45:09 +0000 Siavash Tavakoli (9466769ab6) indexer: Cleanup idle_list from worker pool - Indexer always disconnects from worker process, no need to keep a list of idle processes. - The callback already calls worker_pool_release_connection every time worker updated percentage. Defer disconnecting from working to the callback. It checks if the request is completed and destroys connection. M src/indexer/worker-connection.c M src/indexer/worker-pool.c 2020-12-14 21:39:39 +0000 Siavash Tavakoli (1e8fc75ecf) indexer: Disconnect from indexer-worker after each request This allows indexer-worker to properly handle service configurations such as service_count and idle_kill time. M src/indexer/indexer-worker.c M src/indexer/master-connection.c M src/indexer/master-connection.h M src/indexer/worker-connection.c 2020-05-20 11:18:48 +0300 Timo Sirainen (0732cea98a) lib: array - Make sure it assert-crashes if trying to add more than UINT_MAX elements This is required, because array_count() returns unsigned int. M src/lib/array.h M src/lib/test-array.c 2020-05-20 11:16:29 +0300 Timo Sirainen (024d6f96b8) lib: Add buffer_create_dynamic_max() M src/lib/buffer.c M src/lib/buffer.h M src/lib/test-buffer.c M src/lib/test-lib.inc 2020-05-20 13:42:22 +0300 Timo Sirainen (d4ceac0f2a) lib: hash - Add assert to make sure hash table doesn't grow beyond UINT_MAX nodes hash_table_count() returns unsigned int, so the node count can't be larger. It's internally also tracked as unsigned int currently. It should be large enough for all practical use cases. M src/lib/hash.c 2020-12-17 17:48:37 -0500 Josef 'Jeff' Sipek (0da82cff36) auth: db-lua - Deref script in auth_lua_call_userdb_iterate_init() only once M src/auth/db-lua.c 2020-12-17 17:47:57 -0500 Josef 'Jeff' Sipek (650edc28f3) auth: db-lua - Deref script in auth_lua_call_userdb_lookup() only once M src/auth/db-lua.c 2020-12-17 17:47:03 -0500 Josef 'Jeff' Sipek (05a9dab949) auth: db-lua - Deref script in auth_lua_call_passdb_lookup() only once M src/auth/db-lua.c 2020-12-17 17:46:20 -0500 Josef 'Jeff' Sipek (724a9e18b1) auth: db-lua - Deref script in auth_lua_call_password_verify() only once M src/auth/db-lua.c 2020-12-17 17:44:16 -0500 Josef 'Jeff' Sipek (d556f2f4fe) auth: db-lua - Make auth_lua_dovecot_auth_register() take lua_State * directly M src/auth/db-lua.c 2020-12-17 17:43:36 -0500 Josef 'Jeff' Sipek (1e85955b59) auth: db-lua - Make auth_lua_auth_request_register() take lua_State * directly M src/auth/db-lua.c 2020-12-17 17:39:24 -0500 Josef 'Jeff' Sipek (4ea5c4ab95) auth: db-lua - Make auth_lua_call_lookup_finish() take lua_State * directly M src/auth/db-lua.c 2020-12-17 17:37:10 -0500 Josef 'Jeff' Sipek (5b48410b0f) auth: db-lua - Make auth_lua_export_passdb_table() take lua_State * directly M src/auth/db-lua.c 2020-12-17 17:35:21 -0500 Josef 'Jeff' Sipek (cf40467e30) auth: db-lua - Make auth_lua_call_lookup() take lua_State * directly M src/auth/db-lua.c 2020-12-17 17:32:50 -0500 Josef 'Jeff' Sipek (38fcb7885e) auth: db-lua - Make auth_lua_export_userdb_table() take lua_State * directly M src/auth/db-lua.c 2020-12-17 17:31:59 -0500 Josef 'Jeff' Sipek (86c185ed0c) auth: db-lua - Make auth_lua_export_table() take lua_State * directly M src/auth/db-lua.c 2020-12-17 17:30:38 -0500 Josef 'Jeff' Sipek (74a77410f1) auth: db-lua - Make auth_lua_push_auth_request() take lua_State * directly M src/auth/db-lua.c 2020-12-17 16:53:08 -0500 Josef 'Jeff' Sipek (4114a88fc2) auth: db-lua - Make lua methods and functions use the passed in lua_State * directly M src/auth/db-lua.c 2020-12-17 16:50:50 -0500 Josef 'Jeff' Sipek (e2e7790dd5) auth: db-lua - Make auth_lua_check_auth_request() take lua_State * directly M src/auth/db-lua.c 2020-12-17 16:43:19 -0500 Josef 'Jeff' Sipek (4a1e9db35e) lib-lua: Use dlua_register() M src/lib-lua/test-lua.c 2020-12-17 16:41:21 -0500 Josef 'Jeff' Sipek (31570c8b44) lib-lua: Add dlua_register() M src/lib-lua/dlua-script-private.h M src/lib-lua/dlua-script.c 2020-12-16 19:54:10 -0500 Josef 'Jeff' Sipek (d62387e4d2) lib-storage: Make lua methods and functions use the passed in lua_State * directly M src/lib-storage/mail-lua.c M src/lib-storage/mail-user-lua.c 2020-12-16 20:01:30 -0500 Josef 'Jeff' Sipek (56c07b8e2d) lib-storage: Make lua_storage_mail_user_set_metadata_unset() take lua_State * directly M src/lib-storage/mail-user-lua.c 2020-12-16 19:59:13 -0500 Josef 'Jeff' Sipek (bee28ca65e) lib-storage: Make lua_check_storage_mail_user() take lua_State * directly M src/lib-storage/mail-user-lua.c 2020-12-16 19:51:57 -0500 Josef 'Jeff' Sipek (57bfc584f6) lib-storage: Make lua_check_storage_mail() take lua_State * directly M src/lib-storage/mail-lua.c 2020-12-17 13:07:52 -0500 Josef 'Jeff' Sipek (451be24cb2) lib-lua: Make dlua_dump_stack() take lua_State * directly M src/lib-lua/dlua-script-private.h M src/lib-lua/dlua-script.c 2020-12-17 13:06:57 -0500 Josef 'Jeff' Sipek (8ec0595125) lib-lua: Move dlua_dump_stack() prototype to private header M src/lib-lua/dlua-script-private.h M src/lib-lua/dlua-script.h 2020-12-17 13:00:10 -0500 Josef 'Jeff' Sipek (b693164bc7) lib-lua: Make dlua_check_event() take lua_State * directly M src/lib-lua/dlua-dovecot.c M src/lib-lua/dlua-script-private.h 2020-12-17 13:00:00 -0500 Josef 'Jeff' Sipek (072e385983) lib-lua: Make dlua_push_event() take lua_State * directly M src/auth/db-lua.c M src/lib-lua/dlua-dovecot.c M src/lib-lua/dlua-script-private.h 2020-12-17 12:57:26 -0500 Josef 'Jeff' Sipek (5999db7250) lib-lua: Move dlua_{check,push}_event() prototypes to private header M src/lib-lua/dlua-script-private.h M src/lib-lua/dlua-script.h 2020-12-17 12:55:25 -0500 Josef 'Jeff' Sipek (79e5cb9496) lib-lua: Make dlua_getdovecot() take lua_State * directly M src/auth/db-lua.c M src/lib-lua/dlua-dovecot.c M src/lib-lua/dlua-script-private.h M src/lib-storage/mail-storage-lua.c 2020-12-17 12:53:44 -0500 Josef 'Jeff' Sipek (c753146df2) lib-lua: Make dlua_setmembers() take lua_State * directly M src/auth/db-lua.c M src/lib-lua/dlua-script-private.h M src/lib-lua/dlua-script.c M src/lib-storage/mail-storage-lua.c 2020-12-16 19:23:13 -0500 Josef 'Jeff' Sipek (b093dd2ba1) lib-lua: Make lua methods and functions use the passed in lua_State * directly M src/lib-lua/dlua-dovecot.c 2020-12-16 19:33:55 -0500 Josef 'Jeff' Sipek (baf231eb0e) lib-lua: Make dlua_push_event_passthrough() take lua_State * directly M src/lib-lua/dlua-dovecot.c 2020-12-16 19:32:19 -0500 Josef 'Jeff' Sipek (33aac3bd10) lib-lua: Make dlua_check_event_passthrough() take lua_State * directly M src/lib-lua/dlua-dovecot.c 2020-12-16 19:18:33 -0500 Josef 'Jeff' Sipek (fca6435452) lib-lua: Make dlua_event_log() take lua_State * directly M src/lib-lua/dlua-dovecot.c 2020-12-16 19:16:44 -0500 Josef 'Jeff' Sipek (f41f7aa669) lib-lua: Make dlua_get_file_line() take lua_State * directly M src/lib-lua/dlua-dovecot.c 2020-12-16 19:05:04 -0500 Josef 'Jeff' Sipek (2e60aba389) lib-lua: Make DLUA_REQUIRE_ARGS*() take the lua_State * directly This is the first in a series of commits that convert a number of functions to pass around the lua_State pointer directly and to use it instead of using the lua_State pointed to by the struct dlua_script. This change is needed to eventually support the 'yield' functionality and "sequential looking, but async behind the scenes" lua scripts. To support this, the C code needs to instantiate multiple lua_States and then operate on the correct one - whichever one is passed back by the lua runtime. This lays the ground work for that. M src/lib-lua/dlua-dovecot.c M src/lib-lua/dlua-script-private.h M src/lib-storage/mail-lua.c M src/lib-storage/mail-user-lua.c M src/lib-storage/mailbox-lua.c 2021-01-13 12:54:09 +0200 Timo Sirainen (dbcd7610b5) imap: test-imap-client-hibernate - Remove dead assignment M src/imap/test-imap-client-hibernate.c 2020-10-09 21:07:40 +0200 Geert Hendrickx (f8ac63a3f2) util: dovecot-sysreport: Use "uname -n" instead of "hostname" for portability hostname is not defined by POSIX, so not guaranteed to work. M src/util/dovecot-sysreport 2020-12-23 12:50:33 +0000 Siavash Tavakoli (cf887a3250) lib-mail: mail-html2text: HTML entity lookup must be case-sensitive HTML entities are case-sensitive. M src/lib-mail/mail-html2text.c 2020-01-30 13:50:30 +0200 Timo Sirainen (15fd25955e) lib-storage: Add unit test for mailbox-list error handling This is exactly the same test as what mail-storage has for its error handling. M src/lib-storage/Makefile.am M src/lib-storage/test-mail-storage.c A src/lib-storage/test-mailbox-list.c 2020-02-22 12:01:45 +0200 Timo Sirainen (369be49d06) lib-storage: test-mail-storage - Split overlong lines M src/lib-storage/test-mail-storage.c 2020-01-30 13:48:26 +0200 Timo Sirainen (6e0031ebf4) lib-storage: Change mailbox_list_set_error/critical() to work the same as storage's The storage ones had various fixes to different situations. Just make the mailbox list ones exactly the same to get the same fixes. M src/lib-storage/mailbox-list.c 2020-01-24 13:50:50 +0200 Timo Sirainen (dde65e0ec9) lib-storage: mailbox_list_get_last_error() - Handle unexpected situations better Change the logic to be similar as in mail_storage_get_last_error() if the mail_error or error_string unexpectedly isn't set. M src/lib-storage/mailbox-list.c 2020-10-22 22:49:56 +0300 Timo Sirainen (4735c12bb1) lib-storage: Detect corrupted mail size when calculating body size When body size is calculated from message size - header size, make sure that the message size is at least as large as the header size. Otherwise treat the message size as corrupted. M src/lib-storage/index/index-mail.c 2020-11-22 19:16:03 +0000 Siavash Tavakoli (6d9008af1d) stats: openmetrics: Do not duplicate counter and duration metrics for histograms Histograms generate "_count" and "_sum" metrics either for each quantile or for the whole distribution. This patch prevents creating a duplicate metric with type counter which results in metric name collision. M src/stats/stats-service-openmetrics.c 2020-11-23 18:22:22 +0000 Manuel Rüger (ae678116a7) stats: Make exported metrics compliant with OpenMetrics standards Commit based on github PR: https://github.com/dovecot/core/pull/136 Fix issues raised by promtool and prometheus client library parser. Cleanup and code fixes by Siavash Tavakoli. M src/stats/stats-service-openmetrics.c 2020-12-22 13:23:45 +0200 Timo Sirainen (c98cf39bac) indexer, auth: Set indexer-worker and auth-worker services' type=worker M src/auth/auth-settings.c M src/indexer/indexer-worker-settings.c 2020-12-21 21:24:50 +0200 Timo Sirainen (58aa56e033) lib-master, master: Add "worker" service type The worker services are expected to reach their process_limit regularly. There shouldn't be a warning logged about temporarily reaching the limit, since it can happen due to race conditions. M src/lib-master/service-settings.h M src/master/master-settings.c M src/master/service-monitor.c M src/master/service-process.c M src/master/service.h 2020-12-21 21:23:32 +0200 Timo Sirainen (0a2428d9b1) master: Split off service_log_drop_warning() M src/master/service-monitor.c 2020-01-16 15:03:28 +0200 Timo Sirainen (6a267b61a6) master: Update comment to service_process.total_count It's not an exact value. Making it exact would require changing the IPC protocol to master, which isn't worth it just for this. M src/master/service-process.h 2020-01-16 14:58:21 +0200 Timo Sirainen (b95a60b44e) lib-master: Notify master immediately when process can accept more clients Instead of delaying it for 1 second. Otherwise the master might be complaining about process/client limit being reached or creating more processes unnecessarily. M src/lib-master/master-service.c 2020-12-28 10:26:07 +0000 Siavash Tavakoli (96cae05285) lib-mail: message-snippet: Fix expected number of leading non-whitespace chars If message body starts with a single char + space (e.g. "I am"), the space is wrongly removed (i.e. snippet would be "Iam") because at least two non-whitespace characters are expected. Fix the minimum to 1 to fix this. M src/lib-mail/message-snippet.c M src/lib-mail/test-message-snippet.c 2021-01-07 14:57:23 +0200 Aki Tuomi (225e2e040c) auth: Log failure before freeing up request The request got free'd before logging, causing use-after-free access. Broken in cec5a9c92d094d639c49bb83eeb9383ebb231c6f M src/auth/auth-request.c 2020-12-09 01:31:30 +0000 Siavash Tavakoli (58668e1611) imap: cmd-setmetadata: Do not open mailbox Set metadata without actually opening the mailbox. As a side-effect this changes SETMETADATA command response when ACL rules are present and user only has lookup right. For non-existing mailboxes, command fails with "Mailbox doesn't exist" message instead of "Permission denied" error. M src/imap/cmd-setmetadata.c 2020-12-01 17:21:03 +0000 Siavash Tavakoli (51b5b63b75) imap: cmd-getmetadata: Retrieve metadata values without opening the mailbox No need to actually opening the mailbox, only check for its existence. This also makes GETMETADATA command behave more in line with RFC 5464 when acls are preset. Changes to command results for different cases: - User with only "l" right: - for non-existing mailbox command failure error changed from "Permission denied" to "Mailbox doesn't exist" - User with "l" right and one of "s", "w", "i", and "p" rights: - for INBOX, command result changed from "Permission denied" failure to "OK" - for existing mailboxes, command result changed from "Permission denied" failure to "OK" - for non-existing mailboxes, command failure error changed from "Permission denied" to "Mailbox doesn't exist" - for autocreated mailboxes, command result changed from "Permission denied" failure to "OK" - User with "l" right and one of "x", "c", "d", and "a" rights: - for non-existing mailboxes, command failure error changed from "Permission denied" to "Mailbox doesn't exist" - User with only "r" right: - for INBOX, command result changed from "OK" to "Mailbox doesn't exist" - for existing mailboxes, command result changed from "OK" to "Mailbox doesn't exist" - for autocreated mailboxes, command result changed from "OK" to "Mailbox doesn't exist" M src/imap/cmd-getmetadata.c 2020-12-09 01:08:30 +0000 Siavash Tavakoli (f096b20f6f) imap: cmd-getmetadata: Do not ignore NOTFOUND and PERM when handling errors Don't ignore MAIL_ERROR_NOTFOUND MAIL_ERROR_PERM in cmd_getmetadata_handle_error and fail GETMETADATA command properly. This code was added in the initial GETMETADATA implementation commit. It doesn't seem like it has ever done anything useful. M src/imap/cmd-getmetadata.c 2020-12-01 17:23:31 +0000 Siavash Tavakoli (466bf85d64) doveadm mailbox metadata: Don't open mailbox for get and list commands M src/doveadm/doveadm-mail-mailbox-metadata.c 2020-12-16 10:08:11 +0000 Siavash Tavakoli (9dc72c3091) lib-storage: Move checking autocreated boxes to storage backends This allows acl plugin to check ACLs for autocreated mailboxes as well. M src/lib-storage/index/imapc/imapc-storage.c M src/lib-storage/index/index-storage.c M src/lib-storage/index/maildir/maildir-storage.c M src/lib-storage/index/pop3c/pop3c-storage.c M src/lib-storage/list/mailbox-list-index-backend.c M src/lib-storage/mail-storage.c 2020-12-09 00:58:17 +0000 Siavash Tavakoli (2eec12bb32) lib-storage: index-attribute: Fix typo M src/lib-storage/index/index-attribute.c 2020-12-01 10:11:40 +0000 Siavash Tavakoli (2cbc917523) doveadm: doveadm-mail-mailbox-metadata: Add flag for prefixes in metadata list Add an optional "-p" flag for metadata list command. Keys should have been listed with "/private" or "/shared" prefixes from the get-go but for the sake of not breaking users' workflow put this behind a flag. M src/doveadm/doveadm-mail-mailbox-metadata.c 2020-12-16 16:50:43 +0200 Timo Sirainen (0eb35dc578) lib-mail: test-message-search - Avoid static analyzer warnings about NULL pointers M src/lib-mail/test-message-search.c 2020-12-16 16:47:38 +0200 Timo Sirainen (41056265f7) dsync: Add assert to help static analyzers M src/doveadm/dsync/dsync-mailbox-import.c 2020-12-16 16:21:40 +0200 Timo Sirainen (46df1de0ec) cassandra: Fix error handling on SSL initialization failure M src/lib-sql/driver-cassandra.c 2021-01-11 11:04:57 +0200 Aki Tuomi (daa7f7d285) lib: istream-file,ostream-file - Mark close failure as unlikely File descriptor close failure is unlikely to happen. M src/lib/istream-file.c M src/lib/ostream-file.c 2020-12-21 11:51:36 +0200 Aki Tuomi (09a41a815b) lib: istream-file,ostream-file - Ignore ECONNRESET This happens e.g. on FreeBSD when closing a socket that has not been fully flushed to client. Since we can't do anything about that, we might as well just ignore it. M src/lib/istream-file.c M src/lib/ostream-file.c 2020-12-21 11:50:51 +0200 Aki Tuomi (921bb0008a) lib: fd-util - Ignore ECONNRESET when closing fd This happens e.g. on FreeBSD when closing a socket that has not been fully flushed to client. Since we can't do anything about that, we might as well just ignore it. M src/lib/fd-util.c 2020-12-17 09:21:38 -0500 Josef 'Jeff' Sipek (d14330716a) lib-lua: Log an error when lua deinit function failed M src/lib-lua/dlua-script.c 2020-12-11 14:43:17 -0500 Josef 'Jeff' Sipek (3ef9218202) lib-lua: Move init/deinit function invocation into helper functions This moves them out of the way and keeps them close to each other. M src/lib-lua/dlua-script.c 2020-12-10 16:22:20 -0500 Josef 'Jeff' Sipek (b95b0f34f7) lib-lua: Warn if threading was detected M src/lib-lua/dlua-script.c 2020-09-24 09:22:38 +0300 Aki Tuomi (64cd461ab6) lib-lua: Store script pointer in LUA_REGISTRY This will allow us to translate any lua thread to a script pointer. This is not meant to allow multi-threaded lua scripts, but it is necessary to allow yields to work. M src/lib-lua/dlua-script.c 2020-12-30 10:05:17 +0000 Siavash Tavakoli (3ad00b770a) imap-hibernate: Add variable aliases Accept new aliases "local_ip" (="lip") and "remote_ip" (="rip") when expanding variables. M src/imap-hibernate/imap-client.c 2020-12-30 10:02:56 +0000 Siavash Tavakoli (754d5017a2) login-storage: Add variable aliases Accept new aliases "local_ip" (="lip") and "remote_ip" (="rip") when expanding variables. M src/lib-storage/mail-storage-service.c M src/lib-storage/mail-user.c 2020-12-30 10:00:43 +0000 Siavash Tavakoli (ef0d9b1945) login-common: Add variable aliases Accept new aliases such as "local_ip" (="lip") and "original_user" (="orig_user"), etc. M src/login-common/client-common.c M src/login-common/login-settings.c 2020-12-29 11:18:32 +0200 Aki Tuomi (daea0c1078) .gitignore: Ignore fuzzers M .gitignore 2020-12-29 11:19:38 +0200 Aki Tuomi (171f2af20e) lib-imap: Add fuzz-imap-bodystructure M src/lib-imap/Makefile.am A src/lib-imap/fuzz-imap-bodystructure.c 2020-09-11 15:02:57 +0300 Aki Tuomi (ec11aedaef) lib-mail: Add fuzz-message-parser Fuzzer for message parser M src/lib-mail/Makefile.am A src/lib-mail/fuzz-message-parser.c 2020-09-11 15:02:17 +0300 Aki Tuomi (d1bfe5ff51) AUTHORS: Add catena cyber M AUTHORS 2020-03-20 16:00:21 +0100 Philippe Antoine (9622c5646a) lib-smtp: Add fuzz target for smtp server M src/lib-smtp/Makefile.am A src/lib-smtp/fuzz-smtp-server.c 2020-03-23 18:33:18 +0200 Timo Sirainen (62a53d17e7) lib-imap: Add fuzz-imap-utf7 M src/lib-imap/Makefile.am A src/lib-imap/fuzz-imap-utf7.c 2020-03-23 18:29:16 +0200 Timo Sirainen (48114f39d8) lib-test: Add fuzzing framework M src/lib-test/Makefile.am A src/lib-test/fuzzer.c A src/lib-test/fuzzer.h 2020-03-23 18:28:34 +0200 Timo Sirainen (715d3aca5a) configure: Add --with-fuzzer=clang to use clang fuzzer M configure.ac M m4/dovecot.m4 2020-11-18 21:22:45 +0200 Timo Sirainen (a912198bdc) lib-imap: Fix writing BODYSTRUCTURE for truncated multipart/digest part Fixes error while parsing BODYSTRUCTURE: message_part message/rfc822 flag doesn't match lines in BODYSTRUCTURE M src/lib-imap/imap-bodystructure.c M src/lib-imap/test-imap-bodystructure.c 2020-11-18 20:48:11 +0200 Timo Sirainen (ec2c5ffde7) lib-imap: Fix writing BODYSTRUCTURE for truncated multipart/ part If the max nesting limit is reached, write the last part out as application/octet-stream. The original content-type could be confusing IMAP clients when they don't see any child parts. M src/lib-imap/imap-bodystructure.c M src/lib-imap/test-imap-bodystructure.c 2020-11-18 18:55:34 +0200 Timo Sirainen (530c1e950a) lib-imap: Fix writing BODYSTRUCTURE for truncated message/rfc822 part If the max nesting limit is reached, write the last part out as application/octet-stream instead of dummy message/rfc822. Fixes error while parsing BODYSTRUCTURE: message_part message/rfc822 flag doesn't match BODYSTRUCTURE M src/lib-imap/imap-bodystructure.c M src/lib-imap/test-imap-bodystructure.c 2020-12-12 17:39:54 +0200 Aki Tuomi (93ce6ac94e) NEWS: Add news for 2.3.13 M NEWS 2020-09-11 10:57:51 +0300 Timo Sirainen (266e54b7b8) lib-imap: Don't generate invalid BODYSTRUCTURE when reaching MIME part limit If the last MIME part was message/rfc822 and its child was truncated away, BODYSTRUCTURE was missing the ENVELOPE and BODY[STRUCTURE] parts. Fixed by writing empty dummy ones. M src/lib-imap/imap-bodystructure.c 2020-09-11 09:53:03 +0300 Timo Sirainen (fb97a1cddb) lib-mail: message-parser - Fix assert-crash when enforcing MIME part limit The limit could have been exceeded with message/rfc822 parts. M src/lib-mail/message-parser.c M src/lib-mail/test-message-parser.c 2020-08-24 19:12:21 +0300 Timo Sirainen (f8114a20e4) imap: Add unit test for imap-client-hibernate M src/imap/Makefile.am A src/imap/test-imap-client-hibernate.c 2020-08-24 19:10:43 +0300 Timo Sirainen (1a27cfa8e3) imap: imap_client_hibernate() - Return reason string on failure This helps writing a unit test for it. M src/imap/cmd-idle.c M src/imap/imap-client-hibernate.c M src/imap/imap-client.h 2020-08-24 19:10:10 +0300 Timo Sirainen (c7d158681f) imap: Delay initializing client IO until client_create_finish() This helps writing unit tests. M src/imap/imap-client.c 2020-08-24 16:58:16 +0300 Timo Sirainen (73937b5fe7) imap: Fix crash if imap-hibernate socket can't be connected to The error was supposed to be returned to caller, not logged directly. M src/imap/imap-client-hibernate.c 2020-08-17 18:33:20 +0300 Timo Sirainen (68165c8acc) imap: Escape tag when sending it to imap-hibernate process M src/imap/imap-client-hibernate.c 2020-08-17 18:26:01 +0300 Timo Sirainen (7a70f01fe8) lib-imap: Add imap_parser_client_read_tag() M src/lib-imap/imap-parser.c M src/lib-imap/imap-parser.h 2020-08-17 18:22:42 +0300 Timo Sirainen (9d3ecff3de) imap-login: Use imap_parser_read_tag() and _read_command_name() M src/imap-login/imap-login-client.c 2020-08-17 18:15:35 +0300 Timo Sirainen (62061e8cf6) imap-login: Split off client_invalid_command() M src/imap-login/imap-login-client.c 2020-08-17 18:11:36 +0300 Timo Sirainen (0386140f61) imap: Use imap_parser_read_tag() and _read_command_name() M src/imap/imap-client.c 2020-08-17 17:59:19 +0300 Timo Sirainen (eea57c8683) imap: Split off client_command_failed_early() M src/imap/imap-client.c 2020-08-17 17:32:11 +0300 Timo Sirainen (b9a2f18466) lib-imap: Add imap_parser_read_tag() and _read_command_name() M src/lib-imap/imap-parser.c M src/lib-imap/imap-parser.h M src/lib-imap/test-imap-parser.c 2020-03-11 14:36:10 +0200 Timo Sirainen (6862dfcab9) lib-master: Add 5 second timeout when waiting for stats-writer handshake Previously the wait was infinite and nothing was logged, making it difficult to know that the problem is with a hanging stats process. M src/lib-master/stats-client.c 2020-12-22 10:22:38 +0200 Timo Sirainen (941668f5a0) lib-master, stats: Fix sending and parsing UPDATE commands These commands were parsed completely wrong, resulting in errors like: Client sent invalid input for UPDATE: Invalid tv_created: Invalid timeval microseconds parameter M src/lib-master/stats-client.c M src/lib-master/test-event-stats.c M src/stats/client-writer.c 2020-12-03 10:21:47 -0500 Josef 'Jeff' Sipek (4a07b3622a) lib-lua: Install libdovecot-lua binaries This turns this into a full-fledged library. This addresses the issue where libdovecot-lua is completely included in anything that uses it, which caused unnecessarily bloat and could have caused linker problems with multiple definitions of the same symbol. M src/auth/Makefile.am M src/lib-lua/Makefile.am 2020-12-01 12:16:04 -0500 Josef 'Jeff' Sipek (ba7b64712e) lib-storage: Split off the mail user lua code Move the code into a separate file to mirror the native C code layout. M src/lib-storage/Makefile.am M src/lib-storage/mail-storage-lua-private.h M src/lib-storage/mail-storage-lua.c A src/lib-storage/mail-user-lua.c 2020-12-01 12:13:31 -0500 Josef 'Jeff' Sipek (53e62982d3) lib-storage: Split off the mailbox attribute lua code Move the code into a separate file to mirror the native C code layout. M src/lib-storage/Makefile.am M src/lib-storage/mail-storage-lua.c A src/lib-storage/mailbox-attribute-lua.c 2020-12-01 12:05:59 -0500 Josef 'Jeff' Sipek (fcbf6da47f) lib-storage: Split off the struct mailbox lua code Move the code into a separate file to mirror the native C code layout. M src/lib-storage/Makefile.am M src/lib-storage/mail-storage-lua-private.h M src/lib-storage/mail-storage-lua.c A src/lib-storage/mailbox-lua.c 2020-12-01 11:47:26 -0500 Josef 'Jeff' Sipek (bf42611743) lib-storage: Split off the struct mail lua code Move the code into a separate file to mirror the native C code layout. M src/lib-storage/Makefile.am A src/lib-storage/mail-lua.c A src/lib-storage/mail-storage-lua-private.h M src/lib-storage/mail-storage-lua.c 2020-12-01 11:14:02 -0500 Josef 'Jeff' Sipek (bf1c270fa3) lib-storage: Move storage related lua code into libdovecot-storage-lua.la This keeps all the storage code in one place. M src/lib-storage/Makefile.am R100 src/plugins/mail-lua/mail-storage-lua.c src/lib-storage/mail-storage-lua.c R100 src/plugins/mail-lua/mail-storage-lua.h src/lib-storage/mail-storage-lua.h M src/plugins/mail-lua/Makefile.am 2020-11-16 20:55:14 +0100 Marvin W (2c57a92661) auth: db-lua - Fix invalid stack empty check 3e11b97 introduced assertions to ensure the lua stack is empty after execution. In auth_lua_call_password_verify() this check was inserted *before* popping the error message from the stack, ultimately causing the assertion to fail every time the lua script has a runtime error, leading to process crashing. M src/auth/db-lua.c 2020-03-06 15:45:47 +0200 Josef 'Jeff' Sipek (0113cf0012) lib-storage: Remove cydir storage format support M configure.ac M src/lib-storage/Makefile.am M src/lib-storage/index/Makefile.am D src/lib-storage/index/cydir/Makefile.am D src/lib-storage/index/cydir/cydir-mail.c D src/lib-storage/index/cydir/cydir-save.c D src/lib-storage/index/cydir/cydir-storage.c D src/lib-storage/index/cydir/cydir-storage.h D src/lib-storage/index/cydir/cydir-sync.c D src/lib-storage/index/cydir/cydir-sync.h M src/lib-storage/mail-storage-register.c 2019-10-11 14:53:26 +0300 Timo Sirainen (5dc69d900a) lib-storage: Fix potential assert-crash fetching BODY[STRUCTURE] when mail's size is cached wrong This happened only after mail's size was detected to be different than the mail's cached size. Fixes: Panic: file index-mail.c: line 1140 (index_mail_parse_body_finish): assertion failed: (mail->data.parts != NULL) M src/lib-storage/index/index-mail.c 2020-12-09 09:42:19 -0500 Josef 'Jeff' Sipek (727f9adc5c) plugins: Remove expire plugin The autoexpunge functionality should be used instead. M configure.ac M doc/example-config/dovecot-dict-sql.conf.ext M doc/example-config/dovecot.conf M src/plugins/Makefile.am D src/plugins/expire/Makefile.am D src/plugins/expire/doveadm-expire.c D src/plugins/expire/expire-plugin.c D src/plugins/expire/expire-plugin.h D src/plugins/expire/expire-set.c D src/plugins/expire/expire-set.h 2020-12-09 09:20:54 -0500 Josef 'Jeff' Sipek (26a6a90baf) plugins: Remove mail-filter plugin M configure.ac M src/plugins/Makefile.am D src/plugins/mail-filter/Makefile.am D src/plugins/mail-filter/istream-ext-filter.c D src/plugins/mail-filter/istream-ext-filter.h D src/plugins/mail-filter/mail-filter-plugin.c D src/plugins/mail-filter/mail-filter-plugin.h D src/plugins/mail-filter/ostream-ext-filter.c D src/plugins/mail-filter/ostream-ext-filter.h 2020-12-09 09:32:29 -0500 Josef 'Jeff' Sipek (a02076a2c0) plugins: Remove snarf plugin M configure.ac M src/plugins/Makefile.am D src/plugins/snarf/Makefile.am D src/plugins/snarf/snarf-plugin.c D src/plugins/snarf/snarf-plugin.h 2020-12-09 09:50:10 -0500 Josef 'Jeff' Sipek (9d48f0dd05) plugins: Remove autocreate plugin Automatic mailbox creation should be done via the autocreate namespace option. M configure.ac M src/plugins/Makefile.am D src/plugins/autocreate/Makefile.am D src/plugins/autocreate/autocreate-plugin.c D src/plugins/autocreate/autocreate-plugin.h 2020-12-11 11:05:50 -0500 Josef 'Jeff' Sipek (4d731ccc49) lib-lua: Stop sharing lua states based on the script file name Instead of all instances of the same lua script sharing the same stack and globals, make them completely separate instances. Removing this optimization will make support of yielding possible. M src/lib-lua/dlua-script.c 2020-12-11 11:22:44 -0500 Josef 'Jeff' Sipek (c9f42ff404) lib-lua: Use lua_register() instead of open-coding it M src/lib-lua/test-lua.c 2020-07-29 11:28:50 +0300 Aki Tuomi (89179afd2e) NEWS: Add NEWS for 2.3.11.3 M NEWS 2020-07-28 11:02:06 +0300 Aki Tuomi (6d8f355105) NEWS: Add NEWS for 2.3.11.2 M NEWS 2020-06-30 11:50:26 +0300 Aki Tuomi (c837ead073) NEWS: Add news for 2.3.11 M NEWS 2020-12-10 19:31:28 +0100 Timo Sirainen (ad8c186cc0) man: doveadm-proxy - Minor fixes to doveadm proxy kick M doc/man/doveadm-proxy.1.in 2020-12-09 09:43:42 +0200 Aki Tuomi (078dfa8fbf) lib: test-file-cache - Assert map is not null before memcmp M src/lib/test-file-cache.c 2020-12-08 09:51:30 +0200 Aki Tuomi (f2c15393f9) lib-mail: test-message-search - Assert ret Found by static analysis M src/lib-mail/test-message-search.c 2020-12-08 09:45:20 +0200 Aki Tuomi (73b307d6ff) lib-mail: test-message-search - Assert that found value is not NULL Satisfies static analysers M src/lib-mail/test-message-search.c 2020-12-08 09:42:13 +0200 Aki Tuomi (6d454342a8) lib-mail: test-message-decoder - Assert ret Found by static analysis M src/lib-mail/test-message-decoder.c 2020-11-30 22:10:28 +0200 Timo Sirainen (8b750e924e) lib-storage: Fix potential assert-crash when fetching body snippet This happened only in a rather special condition. Added unit test to reproduce it. Fixes: Panic: file message-part-data.c: line 28 (message_part_data_is_plain_7bit): assertion failed: (data != NULL) M src/lib-storage/index/index-mail-headers.c M src/lib-storage/test-mail.c 2020-11-30 20:37:46 +0200 Timo Sirainen (67b6027028) lib-storage: Fix potential assert-crash when adding missing attachment flags This happened only in a rather special condition. Added unit test to reproduce it. Fixes: Panic: file index-mail-headers.c: line 298 (index_mail_parse_header): assertion failed: (part != NULL) M src/lib-storage/index/index-mail.c M src/lib-storage/test-mail.c 2020-12-07 13:09:50 +0200 Timo Sirainen (8b40060bf3) lib-dcrypt: istream-decrypt - Assert that max_buffer_size > 0 Otherwise all reads return -2, which will just result in assert-crash in i_stream_read(). M src/lib-dcrypt/istream-decrypt.c 2020-12-07 13:07:35 +0200 Timo Sirainen (103cb028e3) lib: istream-error - Set max_buffer_size Although nothing is actually read from the stream, some filter istreams don't behave properly with max_buffer_size=0. Currently at least istream-decrypt returns -2 for reads instead of -1. Fixes: Panic: file istream.c: line 320 (i_stream_read_memarea): assertion failed: (_stream->skip != _stream->pos) M src/lib/istream.c 2020-12-07 12:40:22 +0200 Timo Sirainen (200eb973c2) lib-storage: test_mail_storage_deinit() - Don't try to clear freed memory ctx was already freed. Trying to memset() into it will just result in writing to already freed memory. M src/lib-storage/test-mail-storage-common.c 2020-12-03 16:37:55 +0200 Aki Tuomi (4ba0954ca0) lib-oauth2: test-oauth2-jwt - Add tests for HS384 and HS512 M src/lib-oauth2/test-oauth2-jwt.c 2020-12-02 13:37:05 +0200 Aki Tuomi (530eb2cee2) lib-oauth2: Fix whitespace in test-oauth2-jwt.c M src/lib-oauth2/test-oauth2-jwt.c 2020-12-02 14:54:05 +0200 Aki Tuomi (1c6c689c1b) lib: test-hmac - Add tests for hmac sha384 M src/lib/test-hmac.c 2020-12-02 14:53:55 +0200 Aki Tuomi (6ae5b035ff) lib: test-hash-method - Add tests for sha2 M src/lib/test-hash-method.c 2020-12-02 14:53:39 +0200 Aki Tuomi (79bc83dad7) lib: hash-method - Add sha384 support M src/lib/hash-method.c M src/lib/sha-common.h M src/lib/sha2.c M src/lib/sha2.h 2020-12-02 14:37:02 +0200 Aki Tuomi (c424c9054e) lib: Fix whitespace in sha2.c M src/lib/sha2.c 2020-11-24 10:20:05 -0500 Downtown Allday (bcfd1071f3) lib: test-hmac - Add HMAC 512 test M src/lib/test-hmac.c 2020-12-03 16:33:06 +0200 Aki Tuomi (df5989562f) lib: hmac - Support different hash algorithms Code was hardcoded for MD4,MD5,SHA-1. M src/lib/hmac.c 2020-11-24 10:19:43 -0500 Downtown Allday (0acf019110) lib: hmac - Adjust HMAC_MAX_CONTEXT_SIZE to accommodate HMAC512 M src/lib/hmac.h 2020-12-03 16:28:40 +0200 Aki Tuomi (7381c12be2) lib: hash-method - Add block size This is needed for HMAC M src/lib/hash-method.c M src/lib/hash-method.h M src/lib/md4.c M src/lib/md5.c M src/lib/sha1.c M src/lib/sha2.c M src/lib/sha3.c 2020-12-03 16:24:52 +0200 Aki Tuomi (d111a18e6c) lib: hash-method - Use named initializers M src/lib/hash-method.c M src/lib/md4.c M src/lib/md5.c M src/lib/sha1.c M src/lib/sha2.c M src/lib/sha3.c 2020-06-05 21:29:44 +0200 Stephan Bosch (512739f51f) lib-oauth2: Remove unused include from oauth2.c. M src/lib-oauth2/oauth2.c 2020-06-05 21:16:58 +0200 Stephan Bosch (905a944955) lib-oauth2: Make oauth2_request_set_headers() static. M src/lib-oauth2/oauth2-private.h M src/lib-oauth2/oauth2-request.c 2020-06-05 21:13:39 +0200 Stephan Bosch (d33c15dcfe) lib-oauth2: Rename oauth2_request_free_internal() to oauth2_request_free(). And make it static. M src/lib-oauth2/oauth2-private.h M src/lib-oauth2/oauth2-request.c 2020-06-05 21:06:30 +0200 Stephan Bosch (6d0f74d0db) lib-oauth2: Rename oauth2_parse_json() to oauth2_request_parse_json(). M src/lib-oauth2/oauth2-private.h M src/lib-oauth2/oauth2-request.c M src/lib-oauth2/test-oauth2-json.c 2020-06-05 21:15:47 +0200 Stephan Bosch (cd3b73910f) lib-oauth2: Move oauth2_request_set_headers() to oauth2-request.c. M src/lib-oauth2/oauth2-request.c M src/lib-oauth2/oauth2.c 2020-06-05 21:11:20 +0200 Stephan Bosch (febd427325) lib-oauth2: Move oauth2_request_abort() to oauth2-request.c. M src/lib-oauth2/oauth2-request.c M src/lib-oauth2/oauth2.c 2020-06-05 21:09:39 +0200 Stephan Bosch (a08d19b449) lib-oauth2: Move oauth2_request_free_internal() to oauth2-request.c. M src/lib-oauth2/oauth2-request.c M src/lib-oauth2/oauth2.c 2020-06-05 21:00:03 +0200 Stephan Bosch (72db70205f) lib-oauth2: Move oauth2_parse_json() to oauth2-request.c. M src/lib-oauth2/oauth2-request.c M src/lib-oauth2/oauth2.c 2020-06-05 20:51:34 +0200 Stephan Bosch (d61b5dc49f) lib-oauth2: Reformat test-oauth2-jwt.c. M src/auth/db-oauth2.c M src/lib-oauth2/test-oauth2-jwt.c 2020-06-05 20:51:19 +0200 Stephan Bosch (19dd872008) lib-oauth2: Reformat oauth2-jwt.c. M src/lib-oauth2/oauth2-jwt.c 2020-06-05 20:50:55 +0200 Stephan Bosch (0cd5624352) lib-oauth2: Reformat oauth2-key-cache.c. M src/lib-oauth2/oauth2-key-cache.c 2020-06-05 20:50:34 +0200 Stephan Bosch (ec0ed35e30) lib-oauth2: Reformat oauth2-request.c. M src/lib-oauth2/oauth2-request.c 2020-06-05 20:49:34 +0200 Stephan Bosch (e2e5d906dc) lib-oauth2: Reformat oauth2.c. M src/lib-oauth2/oauth2.c 2020-06-05 20:49:58 +0200 Stephan Bosch (eba983d328) lib-oauth2: Reformat oauth2-private.h. M src/lib-oauth2/oauth2-private.h 2020-06-05 20:49:09 +0200 Stephan Bosch (c599bd5cca) lib-oauth2: Reformat oauth2.h. M src/lib-oauth2/oauth2.h 2020-05-27 01:49:52 +0300 Timo Sirainen (f3ec003404) auth: db-oauth2 - Add consistent prefix for all error messages M src/auth/db-oauth2.c 2020-05-27 01:36:41 +0300 Timo Sirainen (cb327481b1) auth: db-oauth2 - Fix debug logging Don't log a debug message when the callback is going to be logging exactly the same message as info/error. M src/auth/db-oauth2.c 2020-05-27 01:25:41 +0300 Timo Sirainen (98988c187e) auth: db-oauth2 - Call db_oauth2_lookup_continue_valid() after valid grant No need to check for error/validity again in db_oauth2_lookup_continue(). M src/auth/db-oauth2.c 2020-05-27 01:22:13 +0300 Timo Sirainen (8d07269115) auth: db-oauth2 - db_oauth2_lookup_continue() - Minor cleanup to avoid variables M src/auth/db-oauth2.c 2020-05-27 01:20:36 +0300 Timo Sirainen (be894aaf8b) auth: db-oauth2 - Split off db_oauth2_lookup_continue_valid() M src/auth/db-oauth2.c 2020-05-27 01:03:44 +0300 Timo Sirainen (34f9f30799) auth: db-oauth2 - db_oauth2_lookup_passwd_grant() - Reorder error handling code flow M src/auth/db-oauth2.c 2020-05-27 01:03:11 +0300 Timo Sirainen (c29ebbaf0f) auth: db-oauth2 - Improve "Internal error" message for grant lookups M src/auth/db-oauth2.c 2020-05-27 00:59:49 +0300 Timo Sirainen (e0895ff34c) auth: db-oauth2 - Add and use db_oauth2_field_find() M src/auth/db-oauth2.c 2020-05-27 00:57:24 +0300 Timo Sirainen (06157f5331) auth: db-oauth2 - Don't set db_oauth2_request.token for grant lookups The grant lookup sets the token. There's no need to set it before that. M src/auth/db-oauth2.c 2020-05-27 00:50:07 +0300 Timo Sirainen (fd15e2e61f) auth: db-oauth2 - db_oauth2_lookup_passwd_grant() - Reorder code flow No behavioral changes. M src/auth/db-oauth2.c 2020-05-27 00:44:16 +0300 Timo Sirainen (062b6fa34d) auth: db-oauth2 - Refactor "OAuth2 token missing from reply" code path It can be NULL only when coming from db_oauth2_lookup_passwd_grant(), so handle it there. M src/auth/db-oauth2.c 2020-05-27 00:36:44 +0300 Timo Sirainen (72e4a833ed) auth: db-oauth2 - db_oauth2_template_export() - Make var_expand() error handling consistent Other var_expand() errors include the original string in the error message, so this one should also. M src/auth/db-oauth2.c 2020-05-27 00:30:45 +0300 Timo Sirainen (2cb1fde47e) lib-oauth2: Improve error message when server returns unexpected result If the result isn't 2xx or 4xx, use the HTTP response message as the error message. M src/lib-oauth2/oauth2-request.c 2020-05-27 00:27:15 +0300 Timo Sirainen (1455a6fa77) lib-oauth2: Don't fail if oauth response payload is NULL oauth2_parse_json() is happy with with empty payload (Content-Length: 0), so it should be happy also when payload is NULL (Content-Length is missing). M src/lib-oauth2/oauth2-request.c 2020-05-27 00:21:24 +0300 Timo Sirainen (a434131fea) lib-oauth2: Remove unused oauth2-passwd-grant.c D src/lib-oauth2/oauth2-passwd-grant.c 2020-05-27 00:19:42 +0300 Timo Sirainen (f2755d5188) lib-oauth2, auth: Remove redundant oauth2_request_result.success success is the same as (error == NULL) M src/auth/db-oauth2.c M src/lib-oauth2/oauth2-request.c M src/lib-oauth2/oauth2.h 2020-05-27 00:12:49 +0300 Timo Sirainen (7db7eb3caa) lib-oauth2: json_parsed_cb() - Remove redundant success parameter success is the same as (error == NULL) M src/lib-oauth2/oauth2-private.h M src/lib-oauth2/oauth2-request.c M src/lib-oauth2/oauth2.c M src/lib-oauth2/test-oauth2-json.c 2020-10-01 16:02:26 +0300 Timo Sirainen (aad5e2d5ec) fs-compress: Use istream-decompress M src/plugins/fs-compress/fs-compress.c 2020-10-01 15:59:37 +0300 Timo Sirainen (fbe6a63b53) lib-compression: Fix detecting if input is bzip2 compressed The detection was broken at least for empty bzip2 input. M src/lib-compression/compression.c M src/lib-compression/test-compression.c 2020-10-01 15:36:08 +0300 Timo Sirainen (8b6142f9ba) lib-compression: Add istream-decompress This stream detects the compression format and creates the proper istream afterwards. This is more efficient than creating each compression istream and using istream-try. M src/lib-compression/Makefile.am M src/lib-compression/compression.h A src/lib-compression/istream-decompress.c M src/lib-compression/test-compression.c 2020-11-19 17:50:22 +0200 Timo Sirainen (d680014059) lib-storage: Add test-mail unit test Initially it just accesses the mail randomly. M src/lib-storage/Makefile.am A src/lib-storage/test-mail.c 2020-11-19 15:56:17 +0200 Timo Sirainen (b5c3c78594) mail-crypt: test-mail-crypt - Use test-mail-storage API M src/plugins/mail-crypt/test-mail-key.c 2020-11-19 15:37:54 +0200 Timo Sirainen (9d40291c59) lib-storage: Add a public test-mail-storage-common.h API Moved the public functions into test-mail-storage-common.c M src/lib-storage/Makefile.am A src/lib-storage/test-mail-storage-common.c A src/lib-storage/test-mail-storage-common.h M src/lib-storage/test-mail-storage.c 2020-11-19 16:13:53 +0200 Timo Sirainen (4c75927a47) lib-storage: test-mail-storage - Die on test_mail_init_user() failure This way the caller won't need to do error handling. The errors were being handled inconsistently. M src/lib-storage/test-mail-storage.c 2020-11-19 15:35:07 +0200 Timo Sirainen (c34c37f8de) lib-storage: test-mail-storage - Remove randomness from test home directory Also rename test_mail_storage_ctx.mail_home to home_root to better describe it. M src/lib-storage/test-mail-storage.c 2020-11-19 15:32:20 +0200 Timo Sirainen (8dd863cf2e) lib-storage: test-mail-storage - Change test_mail_init() to allocate the struct M src/lib-storage/test-mail-storage.c 2020-11-19 15:29:01 +0200 Timo Sirainen (56845ea6a3) lib-storage: test-mail-storage - Use settings struct for test_mail_init_user() M src/lib-storage/test-mail-storage.c 2020-10-22 12:22:40 +0300 Timo Sirainen (8299232acb) lib: i_stream_read() - Don't create empty snapshots This allows the read() implementation to read data into the existing memarea. Otherwise a new memarea might have to be created because the old one is referenced by the snapshot. M src/lib/istream.c 2020-10-29 13:35:35 +0200 Timo Sirainen (bfb013491a) imap: Process title wrongly shows connections are "corked" The flush callback in ostream-file always corks the connection, so the process title needs to be delayed until it's no longer in that callback. Add a 0-timeout to update the process title. M src/imap/imap-client.c M src/imap/imap-common.h M src/imap/main.c 2020-11-25 11:03:57 -0500 Josef 'Jeff' Sipek (dd8f5d776e) lib-lua: Rewrite arg checking macros to use STMT_{START,END} This makes it safer to use. Additionally, this commit adds some newlines to the macro definition to make it more readable. M src/lib-lua/dlua-script-private.h 2020-11-10 16:10:05 +0200 Timo Sirainen (30c453c8d9) login-proxy: Use persistent istream buffers Constantly freeing and allocating the memory is a bit slow, but because Dovecot allocates all memory with calloc() the memory cleaing is especially slow. With this change proxying lots of data in a plaintext connection takes about 50% less CPU. The downside is that it uses about 4 kB more memory per istream (8 kB total, for both client and server connections), but that shouldn't be too bad for proxies since they don't use much memory otherwise. M src/login-common/login-proxy.c 2020-12-02 06:06:59 +0200 Martti Rannanjärvi (e2f3a23190) lib-mail: test-istream-qp-decoder.c - Free input_data_limited M src/lib-mail/test-istream-qp-decoder.c 2020-12-01 10:25:09 +0100 Stephan Bosch (043d111cea) lib-http: http-client-request - Fix payload assertions in http_client_request_send_more(). When the request payload is finished, both req->payload_input and req->payload_output could be NULL, so the assertions on those being not NULL need to happen after the check for req->payload_finished. This particularly causes problems with the blocking http_client_request_send/finish_payload() API, which constantly modifies req->payload_input and sets it to NULL to finish the output. This caused a panic: Panic: file http-client-request.c: line 1232 (http_client_request_send_more): assertion failed: (req->payload_input != NULL) M src/lib-http/http-client-request.c 2018-04-04 15:18:51 +0200 Stephan Bosch (3d9e01ccb2) lib-http: test-http-payload - Add test for blocking client output payload. M src/lib-http/test-http-payload.c 2018-04-04 03:02:24 +0200 Stephan Bosch (e3b3155131) lib-http: test-http-payload - Implement reference counting for client request. M src/lib-http/test-http-payload.c 2020-06-27 18:48:40 +0200 Stephan Bosch (7a853719d6) lib-http: Reformat http-client-request.c. M src/lib-http/http-client-request.c 2020-02-25 13:08:21 +0200 Martti Rannanjärvi (15a4c057eb) notify: Free notify_mail_txn when a plugin does not define mail_transaction_commit M src/plugins/notify/notify-plugin.c 2020-11-06 11:47:18 +0100 Markus Valentin (362ebb22c1) lib-mail: Add tests for message-size functions Integrate testing of header and body size to existing tests and add new tests specifically for message-size. M src/lib-mail/Makefile.am M src/lib-mail/test-message-header-parser.c M src/lib-mail/test-message-parser.c A src/lib-mail/test-message-size.c 2020-11-09 12:35:09 +0100 Markus Valentin (c06349db1c) lib-mail: Extend quoted-printable encoding tests M src/lib-mail/test-istream-qp-encoder.c M src/lib-mail/test-qp-encoder.c 2020-11-04 14:38:10 +0100 Markus Valentin (e3b45a1e30) lib-mail: Extend quoted-printable decoding tests M src/lib-mail/test-istream-qp-decoder.c M src/lib-mail/test-qp-decoder.c M src/lib-mail/test-quoted-printable.c 2020-11-19 13:30:54 +0100 Markus Valentin (78b86e7859) lib-mail: qp-encoder: Ensure trailing white space is followed by printable In case a qp-encoded line ends with space or tab append a soft line break to prevent white space being cut off by decoding instance. M src/lib-mail/qp-encoder.c 2020-11-19 15:32:00 +0200 Aki Tuomi (12d3ac4d88) lib-mail: test-message-parser - Convert to signed when calculating variance Satisfies runtime analyser, broken in 6b60e5ed490 M src/lib-mail/test-message-parser.c 2020-11-18 09:43:07 +0200 Aki Tuomi (2e100e4531) lib-mail: message-decoder - Fix CTE parser to accept only syntaxically valid values M src/lib-mail/message-decoder.c M src/lib-mail/test-message-decoder.c 2020-11-17 09:29:30 +0200 Aki Tuomi (0f3bbb5bf4) lib-mail: test-rfc822-parser - Add tests for content-type full parsing M src/lib-mail/test-rfc822-parser.c 2020-11-18 09:31:03 +0200 Aki Tuomi (49aab3624e) lib-mail: message-decoder - Constify message_decoder_parse_cte parameter M src/lib-mail/message-decoder.c M src/lib-mail/message-decoder.h 2020-11-16 16:20:30 +0200 Aki Tuomi (e29c697e03) lib-mail: rfc822-parser - Fix content-type parser to accept only valid values M src/lib-mail/rfc822-parser.c M src/lib-mail/test-rfc822-parser.c 2020-10-29 12:55:21 +0200 Timo Sirainen (6fad5cd6fc) imap: Fix potential hang if client disconnects with pipelined ambiguous commands For example if client pipelines FETCH+LOGOUT commands and disconnects during a large FETCH output, the LOGOUT command is processed as waiting for unambiguity. This code path however doesn't detect a client disconnection, and input IO handler is removed so it can't detect it either. So the imap process hangs. M src/imap/imap-client.c 2020-10-29 12:52:16 +0200 Timo Sirainen (4eb35e2268) imap: Move disconnected-check inside client_continue_pending_input() This way all of its callers don't have to check if the client is disconnected. M src/imap/cmd-append.c M src/imap/cmd-idle.c M src/imap/imap-client.c M src/imap/imap-search.c M src/imap/main.c 2020-11-19 11:00:43 +0200 Timo Sirainen (e540d0dda6) lib-storage: Update comments about mail_search_args_init() and refcount handling M src/lib-storage/mail-search.h 2020-11-23 12:17:52 +0000 Siavash Tavakoli (8582882204) doveadm: Add timestamp prefixes for debug output But still allow overriding from env by setting LOG_STDERR_TIMESTAMP. M src/doveadm/doveadm.c 2020-11-23 18:15:57 +0200 Timo Sirainen (6b0a59f00c) lib-dict: dict_iterate() - Fix segfault with DICT_ITERATE_FLAG_NO_VALUE Broken by cf0d196c2b373a37bc1ab4e10fde89fb61089f3c M src/lib-dict/dict.c 2020-11-23 16:49:49 +0200 Timo Sirainen (ca225869b1) dict-cdb: Fix to use new dict.iterate() API Forgot in 65b7f04f945781cd042f5ad2f6f104f532143ee7 M src/lib-dict-backend/dict-cdb.c 2019-11-22 01:17:32 +0000 rofl0r (090feba9c3) m4: size_t_signed.m4 - use static assertion instead of run test a small step towards cross-compile-ability. M m4/size_t_signed.m4 2020-08-10 20:18:48 +0300 Timo Sirainen (26fe1e277c) lib-index: Improve debug logging M src/lib-index/mail-index-map-read.c M src/lib-index/mail-index-write.c M src/lib-index/mail-transaction-log.c 2020-08-10 20:16:30 +0300 Timo Sirainen (f2a0fe95ed) lib-index: Handle rapidly rotating transaction logs without unnecessary fsck M src/lib-index/mail-index-map-read.c 2020-08-10 18:00:09 +0300 Timo Sirainen (83a06c785f) lib-index: mail_index_reopen_if_changed() - Add reopened_r parameter M src/lib-index/mail-index-map-read.c M src/lib-index/mail-index-private.h M src/lib-index/mail-index.c 2020-08-10 17:53:08 +0300 Timo Sirainen (5c45509554) lib-index: mail_index_sync_map() - Move corruption handling to caller M src/lib-index/mail-index-map-read.c M src/lib-index/mail-index-sync-private.h M src/lib-index/mail-index-sync-update.c 2020-08-10 17:45:08 +0300 Timo Sirainen (264f583a46) lib-index: mail_index_map_latest_sync() - Minor refactoring M src/lib-index/mail-index-map-read.c 2020-08-10 17:43:50 +0300 Timo Sirainen (dd5ee8e233) lib-index: Split off mail_index_map_latest_sync() M src/lib-index/mail-index-map-read.c 2020-08-10 17:33:07 +0300 Timo Sirainen (32ab929a9d) lib-index: mail_index_sync_map() - Always return -1 on I/O failures Even though with force=FALSE in theory it would be possible to work around it, but more likely it will just cause another I/O error. This simplifies the code for the following changes. M src/lib-index/mail-index-sync-update.c 2020-08-10 17:31:27 +0300 Timo Sirainen (050668ef37) lib-index: Move calling mail_index_sync_map_want_index_reopen() to mail_index_map() M src/lib-index/mail-index-map-read.c M src/lib-index/mail-index-sync-private.h M src/lib-index/mail-index-sync-update.c 2020-08-10 17:29:44 +0300 Timo Sirainen (efc9c13e73) lib-index: Split off mail_index_sync_map_want_index_reopen() M src/lib-index/mail-index-sync-update.c 2020-08-10 20:02:22 +0300 Timo Sirainen (268de25bd4) lib-index: mail_transaction_log_indexid_changed() - Clarify refcount handling Although the old code worked as well, it wasn't so obvious since the behavior was slightly different when the log->head had extra references. Clarify the behavior by always unreferencing after the new log file is created. M src/lib-index/mail-transaction-log.c 2020-08-10 20:09:41 +0300 Timo Sirainen (9f46e634c0) lib-index: mail_transaction_log_file_free() - Assert that refcount=0 M src/lib-index/mail-transaction-log-file.c 2020-08-10 19:59:36 +0300 Timo Sirainen (f388a47038) lib-index: mail_index_write() - Make sure index is rewritten after log rotation Otherwise the index will point to .log.2 file, which could become deleted before the index is rewritten again. M src/lib-index/Makefile.am M src/lib-index/mail-index-write.c A src/lib-index/test-mail-index-write.c 2020-08-10 19:54:55 +0300 Timo Sirainen (8eea1e5c8c) lib-index: mail_transaction_log_view_set() - Make sure log files aren't freed too early It's possible that mail_transaction_log_find_file() frees one of the files that are already in the linked list. Avoid it by referencing the file immediately when it's added to the list. M src/lib-index/mail-transaction-log-view.c M src/lib-index/test-mail-transaction-log-view.c 2020-11-12 18:01:18 +0200 Timo Sirainen (8e6fab92e6) lib-index: test-mail-transaction-log-view - Move test_transaction_log_file_add() M src/lib-index/test-mail-transaction-log-view.c 2020-08-10 17:12:32 +0300 Timo Sirainen (327da2aa8a) lib-index: mail_transaction_log_view_set() - Return -1 only on I/O error The callers that care about the difference: * mail_index_sync_map() already assumes that -1 means I/O error * mail_index_sync_set_log_view() handles 0 by logging an error and fscking the index, which is likely better than just returning failure. * view_sync_set_log_view_range()'s caller handles 0 by rebuilding the missing changes in memory. So returning 0 makes it work better. * dsync_log_set() and mailbox_get_expunges_init() have fallbacks for handling 0, while -1 would just return an error. M src/lib-index/mail-transaction-log-view.c M src/lib-index/mail-transaction-log.h M src/lib-index/test-mail-transaction-log-view.c 2020-08-10 17:06:05 +0300 Timo Sirainen (39e2477b7c) lib-index: mail_transaction_log_file_get_highest_modseq_at() - Separate I/O errors from corruption M src/lib-index/mail-transaction-log-file.c M src/lib-index/mail-transaction-log-private.h M src/lib-index/mail-transaction-log-view.c M src/lib-index/test-mail-transaction-log-file.c M src/lib-index/test-mail-transaction-log-view.c 2020-11-13 19:30:29 +0200 Timo Sirainen (2aedf5afa7) lib: Add data_stack_get_used_size() Mainly for debugging purposes. M src/lib/data-stack.c M src/lib/data-stack.h 2020-11-17 17:26:28 +0200 Timo Sirainen (a13d1c6c23) doveadm dict iter: Support printing multiple values M src/doveadm/doveadm-dict.c 2020-11-17 14:41:31 +0200 Timo Sirainen (bd6caf4f54) dict-sql: Support dict_iterate_values() M src/lib-dict-backend/dict-sql.c 2020-11-17 14:24:57 +0200 Timo Sirainen (1c4cef0099) dict, dict-client: Support dict_iterate_values() This doesn't change the dict client protocol in an incompatible way, so it's possible to mix old/new client/server. M src/dict/dict-commands.c M src/lib-dict/dict-client.c 2020-11-17 14:20:40 +0200 Timo Sirainen (cf0d196c2b) lib-dict: Add dict_iterate_values() M src/lib-dict/dict.c M src/lib-dict/dict.h 2020-11-17 14:09:30 +0200 Timo Sirainen (65b7f04f94) lib-dict: Change dict.iterate() API to support returning multiple values This requires changes to all dict drivers. M src/lib-dict-backend/dict-sql.c M src/lib-dict-extra/dict-fs.c M src/lib-dict/dict-client.c M src/lib-dict/dict-fail.c M src/lib-dict/dict-file.c M src/lib-dict/dict-private.h M src/lib-dict/dict.c 2020-11-17 14:30:27 +0200 Timo Sirainen (028f46875b) lib-dict: dict_iterate() - Always return NULL if DICT_ITERATE_FLAG_NO_VALUE is used This way it behaves more consistently across backends. M src/lib-dict-backend/dict-sql.c M src/lib-dict-extra/dict-fs.c M src/lib-dict/dict-private.h M src/lib-dict/dict.c 2020-11-20 12:52:47 +0100 Markus Valentin (0d9e962605) doveadm: mail: doveadm_mail_failed_error() - Set specific exit code for MAIL_ERROR_INUSE Set exit code DOVEADM_EX_NOTPOSSIBLE in case MAIL_ERROR_INUSE is set via doveadm_mail_failed_error(). This exit code is used to indicate that a operation cannot be done because another session prevents it. M src/doveadm/doveadm-mail.c 2020-11-20 12:15:18 +0200 Timo Sirainen (4b93cff3d8) doveadm: When sending server logs to client, make sure ioloop isn't set to NULL This could have happened if there was any logging done outside command handling. For example a doveadm command used http-client, which has a timeout that triggers logging only after the command is finished. Fixes segfault and: Panic: file http-client.c: line 642 (http_client_context_close): assertion failed: (cctx->clients_list == NULL) M src/doveadm/client-connection-tcp.c 2020-11-20 12:23:21 -0500 Josef 'Jeff' Sipek (2dac245580) lib-lua: Don't add system libs to libdovecot_lua_la_DEPENDENCIES This confuses the build system, causing it to think that it needs to build those. This manifests itself as: make: *** No rule to make target '-L/usr/lib/x86_64-linux-gnu', needed by 'libdovecot-lua.la'. Stop. M src/lib-lua/Makefile.am 2020-11-19 22:07:37 +0200 sergey.kitov (4f4cb20134) imap: Fix memory leak in get_expunges_fallback() M src/imap/imap-fetch.c 2020-09-11 16:06:46 +0300 Aki Tuomi (8d52452a58) lib: test-file-cache - Use memcmp Data is not null-terminated, so use memcmp. M src/lib/test-file-cache.c 2020-09-11 14:11:55 +0300 Aki Tuomi (5c49871511) lib: test-file-cache - Assert map value Satisfies static analyser M src/lib/test-file-cache.c 2020-11-12 14:15:54 -0500 Josef 'Jeff' Sipek (2434131b41) lib: event-filter-parser - Test simple but invalid input M src/lib/test-event-filter-parser.c 2020-11-12 13:49:49 -0500 Josef 'Jeff' Sipek (a19514bbd3) lib: event-filter - Do not assert that there in no output on error When the input is a simple (but invalid) expression (e.g., a=b=c) the output variable may be set. This is perfectly fine. The assertion (and the associated failure) come from when event filter parsing was switched to the new filter syntax (fcba1d530737813de11d9d730d5db6496e2e574b). M src/lib/event-filter.c 2020-10-19 13:47:10 -0400 Josef 'Jeff' Sipek (bfe9533c2e) stats: openmetrics - Include submetric name only when present Otherwise we SIGSEGV. M src/stats/stats-service-openmetrics.c 2020-11-11 00:11:35 +0200 Timo Sirainen (7a6f9517c5) dsync: Fix UID renumbering when GUIDs aren't used Mails that have local UIDs won't be in import_uids hash table, so they're not otherwise being iterated at the end and checked if they need renumbering. M src/doveadm/dsync/dsync-mailbox-import.c 2020-11-10 19:57:26 +0200 Timo Sirainen (68685ba621) dsync: Incremental sync sometimes missed messages when GUIDs weren't available GUIDs aren't available when using imapc, so this affected migrations. M src/doveadm/dsync/dsync-mailbox-import.c 2020-11-09 09:04:36 +0200 Aki Tuomi (0725865f9c) .gitignore: Ignore coverage and temp files M .gitignore 2020-11-05 12:08:38 +0200 Aki Tuomi (6139812246) lib-mail: test-message-part-serialize - Add tests M src/lib-mail/Makefile.am A src/lib-mail/test-message-part-serialize.c 2020-11-04 15:10:04 +0200 Aki Tuomi (9f94c71897) lib-mail: test-message-header-parser - Validate header value M src/lib-mail/test-message-header-parser.c 2020-11-04 15:09:45 +0200 Aki Tuomi (8ce92ceb22) lib-mail: test-message-header-parser - Test NUL bytes in header M src/lib-mail/test-message-header-parser.c 2020-11-04 12:35:16 +0200 Aki Tuomi (2b602c96e4) lib-mail: test-message-header-decode - Add more tests M src/lib-mail/test-message-header-decode.c 2020-11-04 12:34:57 +0200 Aki Tuomi (fcf197ebcc) lib-mail: test-message-header-decode - Use libcharset Otherwise we can only test utf-8 M src/lib-mail/Makefile.am M src/lib-mail/test-message-header-decode.c 2020-11-03 15:17:45 +0200 Aki Tuomi (b3713a072d) lib-mail: test-message-search - Add more message searching tests M src/lib-mail/test-message-search.c 2020-11-02 20:59:18 +0200 Aki Tuomi (3490e6b472) lib-mail: test-mail-user-hash - Add tests for mail_user_hash M src/lib-mail/Makefile.am A src/lib-mail/test-mail-user-hash.c 2020-11-02 20:06:28 +0200 Aki Tuomi (f0ff6527a0) lib-mail: test-message-decoder - Add charset conversion test M src/lib-mail/test-message-decoder.c 2020-11-02 18:38:32 +0200 Aki Tuomi (233081353c) lib-mail: test-message-decoder - Test Content-Transfer-Encoding M src/lib-mail/test-message-decoder.c 2020-11-02 13:46:12 +0200 Aki Tuomi (6b60e5ed49) lib-mail: test-message-parser - Add tests for MIME-Version header M src/lib-mail/test-message-parser.c 2020-11-09 09:29:26 +0200 Aki Tuomi (3c137ff3ad) lib-mail: test-* - Add missing test_assert Need to ensure stream did not fail during parsing. M src/lib-mail/test-message-decoder.c M src/lib-mail/test-message-parser.c M src/lib-mail/test-message-part.c 2020-11-09 09:22:28 +0200 Aki Tuomi (8f8558f6d0) lib-mail: test-message-parser - Use message_part_is_equal Replace msg_parts_cmp with message_part_is_equal. M src/lib-mail/test-message-parser.c 2020-11-02 13:15:24 +0200 Aki Tuomi (fd7711d150) lib-mail: test-message-parser - Refactor message parsing to utility function Makes next changes easier. M src/lib-mail/test-message-parser.c 2020-11-09 09:16:27 +0200 Aki Tuomi (34a2b76343) lib-mail: Add message_part_is_equal Returns TRUE if two parts are equal. M src/lib-mail/message-part.c M src/lib-mail/message-part.h 2020-11-11 11:09:02 +0200 Timo Sirainen (7c14211f94) configure.ac: Finish removing vpopmail support M configure.ac 2020-10-27 15:12:19 +0200 Timo Sirainen (12da020f5f) lib-storage: Add prefix to failed mailbox list index rebuild error messages This makes it clearer that the failure is happening because index was being rebuilt. M src/lib-storage/list/mailbox-list-index.c 2020-10-27 15:13:39 +0200 Timo Sirainen (152214f576) lib-storage: Fix error message when mailbox list index rebuild fails The error needs to be copied to mailbox_list, otherwise it's just "Unknown internal list error". M src/lib-storage/list/mailbox-list-index.c 2020-10-27 15:11:12 +0200 Timo Sirainen (80de9f5b66) lib-storage: Fix mailbox list iteration error handling for INBOX If INBOX isn't in the first namespace, the error wasn't correctly set for it. M src/lib-storage/list/mailbox-list-iter.c 2020-10-27 15:08:15 +0200 Timo Sirainen (2fbc6c3478) lib-storage: Use mailbox_get_last_mail_error() for mailbox_get_path_to() errors mailbox_list_get_last_error() happens to work currently, but it's accidental. M src/lib-storage/index/index-storage.c 2020-11-02 18:55:16 +0200 Timo Sirainen (58f5d604b5) lib-index: Fix detecting if index is undeleted It was possible that mail_index_is_deleted() kept returning that the index was deleted, even if it was marked as undeleted. This happened when the deletion was in dovecot.index.log.2, undeletion in dovecot.index.log and dovecot.index pointed to the .log.2 file. This caused the .log file to be read first, which sees the undeletion. Later on the .log.2 was parsed and it marked the index back as deleted. M src/lib-index/mail-index-private.h M src/lib-index/mail-transaction-log-file.c 2020-11-10 01:30:06 +0200 Timo Sirainen (1a96ec2fae) lib-fts: Avoid NULL pointer arithmetic Even though it was only doing +0. Fixes: runtime error: applying zero offset to null pointer M src/lib-fts/fts-tokenizer-generic.c M src/lib-fts/fts-tokenizer.c 2020-11-09 18:10:21 +0200 Timo Sirainen (8e65d366a2) lib-smtp: smtp_address_init_from_msg() - Avoid implicit char to unsigned char conversion Fixes calling smtp_char_is_qpair() with ubsan: runtime error: implicit conversion from type 'char' of value -61 (8-bit, signed) to type 'unsigned char' changed the value to 195 (8-bit, unsigned) M src/lib-smtp/smtp-address.c 2020-11-09 17:52:51 +0200 Timo Sirainen (ddf77cf384) lib-index: Add explicit wrapping to 8bit variable increments Fixes ubsan errors: runtime error: implicit conversion from type 'int' of value 256 (32-bit, signed) to type 'uint8_t' (aka 'unsigned char') changed the value to 0 (8-bit, unsigned) M src/lib-index/mail-cache-lookup.c M src/lib-index/mail-cache-purge.c 2020-11-09 17:38:26 +0200 Timo Sirainen (e416d0c6f9) lib: istream-concat - Avoid NULL pointer arithmetic Even though it was only doing +0. Fixes: runtime error: applying zero offset to null pointer M src/lib/istream-concat.c 2020-11-09 17:35:15 +0200 Timo Sirainen (73ade3503a) lib: istream-chain - Avoid NULL pointer arithmetic Even though it was only doing +0. Fixes: runtime error: applying zero offset to null pointer M src/lib/istream-chain.c 2020-11-09 16:55:06 +0200 Timo Sirainen (ec07ca4262) lib: MODULE_CONTEXT_SET*() - Avoid NULL pointer arithmetic Even though it was only doing +0. Fixes: runtime error: applying zero offset to null pointer M src/lib/module-context.h 2020-11-09 16:09:05 +0200 Timo Sirainen (7068d53e8d) lib: Add and use TYPE_CHECKS() macro to standardize type checking for functions This helps especially to avoid adding COMPILE_ERROR_*() macros to NULL pointers, which results in ubsan errors: runtime error: applying zero offset to null pointer These changes also remove the use of gcc-specific ({...}) code in the macros, making them slightly more portable. M src/lib/array.h M src/lib/buffer.h M src/lib/hash.h M src/lib/macros.h 2020-11-09 15:39:57 +0200 Timo Sirainen (876a22a195) lib: COMPILE_ERROR_IF_TRUE() - Return FALSE instead of 0 This will be needed for the following changes to avoid warnings with -Wstrict-bool. M src/lib/macros.h 2020-11-09 13:04:43 +0200 Timo Sirainen (ce132c38c1) lib-fs: fs_file_init_parent() - Keep mode and flags parameters separated Internally cast them both to (int) before ORing them together for the fs_file_init_with_event() call. This avoids compiler warnings with -Wenum-enum-conversion: warning: bitwise operation between different enumeration types ('enum fs_open_mode' and 'enum fs_open_flags') M src/lib-fs/fs-api-private.h M src/lib-fs/fs-api.c M src/lib-fs/fs-metawrap.c M src/lib-fs/fs-randomfail.c M src/lib-fs/fs-sis-queue.c M src/lib-fs/fs-sis.c M src/plugins/fs-compress/fs-compress.c M src/plugins/mail-crypt/fs-crypt-common.c 2020-10-23 16:24:09 -0400 Josef 'Jeff' Sipek (bf7952d33e) auth: Remove ntlm mechanism & the LANMAN and NTLM password schemes M COPYING M configure.ac M src/Makefile.am M src/auth/Makefile.am D src/auth/mech-ntlm.c M src/auth/mech.c M src/auth/password-scheme.c M src/auth/test-libpassword.c M src/auth/test-mech.c M src/doveadm/Makefile.am D src/lib-ntlm/Makefile.am D src/lib-ntlm/ntlm-des.c D src/lib-ntlm/ntlm-des.h D src/lib-ntlm/ntlm-encrypt.c D src/lib-ntlm/ntlm-encrypt.h D src/lib-ntlm/ntlm-flags.h D src/lib-ntlm/ntlm-message.c D src/lib-ntlm/ntlm-message.h D src/lib-ntlm/ntlm-types.h D src/lib-ntlm/ntlm.h 2020-10-16 09:18:31 -0400 Josef 'Jeff' Sipek (d3d02fdd71) auth: Remove vpopmail user & pass db support M configure.ac M doc/example-config/conf.d/10-auth.conf M doc/example-config/conf.d/Makefile.am D doc/example-config/conf.d/auth-vpopmail.conf.ext D m4/want_vpopmail.m4 M src/auth/Makefile.am M src/auth/db-checkpassword.c D src/auth/passdb-vpopmail.c M src/auth/passdb.c D src/auth/userdb-vpopmail.c D src/auth/userdb-vpopmail.h M src/auth/userdb.c M src/master/main.c 2020-10-16 09:01:19 -0400 Josef 'Jeff' Sipek (8b5f5f78e2) auth: Remove S/Key mechanism & password scheme M doc/example-config/conf.d/10-auth.conf M src/auth/Makefile.am M src/auth/main.c R089 src/auth/mech-otp-skey-common.c src/auth/mech-otp-common.c R074 src/auth/mech-otp-skey-common.h src/auth/mech-otp-common.h M src/auth/mech-otp.c D src/auth/mech-skey.c M src/auth/mech.c M src/auth/password-scheme.c M src/auth/test-libpassword.c M src/auth/test-mech.c 2020-10-16 08:50:21 -0400 Josef 'Jeff' Sipek (01ad604b77) auth: Remove RPA mechanism & password scheme M src/auth/Makefile.am D src/auth/mech-rpa.c M src/auth/mech.c D src/auth/password-scheme-rpa.c M src/auth/password-scheme.c M src/auth/password-scheme.h M src/auth/test-libpassword.c M src/auth/test-mech.c 2020-10-16 08:31:34 -0400 Josef 'Jeff' Sipek (37af563917) auth: Remove postmap socket type M src/auth/main.c 2020-10-16 08:28:12 -0400 Josef 'Jeff' Sipek (0cf4e1e13c) auth: Remove support for SIA passdb M configure.ac D m4/want_sia.m4 M src/auth/Makefile.am D src/auth/passdb-sia.c M src/auth/passdb.c 2020-10-23 10:56:08 -0400 Josef 'Jeff' Sipek (7eaf9b0c6d) lib: Be less verbose in event filter tests Only print the input string if the test failed. M src/lib/test-event-filter-parser.c 2020-10-27 23:16:44 +0100 Stephan Bosch (184a9526e5) lib-smtp: smtp-server-connection - Make sure output stream errors are handled. M src/lib-smtp/smtp-server-connection.c 2020-10-26 10:19:46 +0100 Stephan Bosch (75ab810591) lib-ssl-iosteam: ostream-openssl - Make sure error on plaintext streams is propagated. M src/lib-ssl-iostream/iostream-openssl.c M src/lib-ssl-iostream/iostream-openssl.h M src/lib-ssl-iostream/ostream-openssl.c 2020-10-26 22:04:53 +0100 Stephan Bosch (5b4e8e9819) lib-ssl-iostrea: ostream-openssl - Add local variable for ssl_io in o_stream_ssl_flush_buffer(). M src/lib-ssl-iostream/ostream-openssl.c 2020-11-05 13:25:19 +0200 Aki Tuomi (98798b85a1) auth: db-oauth2 - Do not allow empty active_value or active_attribute, when other is set M src/auth/db-oauth2.c 2020-10-29 11:37:22 +0200 Aki Tuomi (0ce1f34957) auth: db-oauth2 - If active attribute is present in request, check it If the attribute is missing, do not assume it's false. M src/auth/db-oauth2.c 2020-10-29 11:36:00 +0200 Aki Tuomi (3330dbe12b) auth: db-oauth2 - Check active attribute by default M src/auth/db-oauth2.c 2020-10-22 11:42:23 +0300 Aki Tuomi (fd8ae5027a) auth: db-oauth2 - Change active:false to mean invalid token Specifications say that invalid token, expired token and any other reason why the token can be considered invalid should return {"active":false} reply with no other fields. Thus, we need to consider this as invalid token. M src/auth/db-oauth2.c 2020-10-22 11:41:16 +0300 Aki Tuomi (bec575990c) auth: db-oauth2 - Allow active:false without username M src/auth/db-oauth2.c 2020-10-13 17:34:12 +0300 sergey.kitov (17813e78b0) lib-storage: Skip setting log view in mailbox_get_expunges_init when box->view is outdated. This fixes assert-crash when IMAP client uses QRESYNC and lots of changes happen between syncing points. Fixes: Panic: file mail-transaction-log-view.c: line 144 (mail_transaction_log_view_set): assertion failed: (min_file_seq <= max_file_seq) M src/lib-storage/mailbox-get.c 2020-10-29 12:34:57 +0200 Timo Sirainen (28301c44d0) lib-fts: test-fts-filter - Fix clang suspicious concatenation of string literals warning Fixes: warning: suspicious concatenation of string literals in an array initialization; did you mean to separate the elements with a comma? [-Wstring-concatenation] M src/lib-fts/test-fts-filter.c 2020-10-29 12:33:14 +0200 Timo Sirainen (9e72e39d52) lib: Standardize STMT_BEGIN and STMT_END do .. while(0) should work everywhere. This also fixes warnings given by new clang: warning: '}' and ')' tokens terminating statement expression appear in different macro expansion contexts [-Wcompound-token-split-by-macro] M src/lib/macros.h 2020-10-29 12:32:44 +0200 Timo Sirainen (e7342877f8) lib: test-istream - Don't try to return void M src/lib/test-istream.c 2020-10-28 12:45:09 +0200 Aki Tuomi (05a491eebb) lib: test-file-cache - Add asserts for initial return value of file_cache_get M src/lib/test-file-cache.c 2020-10-28 12:23:40 +0200 Aki Tuomi (57c63983d9) lib-lda: Update mail sizes to event only if they are known M src/lib-lda/mail-deliver.c 2020-10-28 12:22:58 +0200 Aki Tuomi (edb32ea0e8) lib-storage: raw-mail - Cast st_size to uoff_t mbox->size is unsigned field, and st_size will be -1 is the stat target is not regular file or symbolic link. This can happen if it's stream like stdin. M src/lib-storage/index/raw/raw-mail.c 2020-10-23 14:54:22 +0300 Timo Sirainen (005a3d3b52) lib-fs: iteration - Fix crash when overwriting iteration error Can't use fs_file_path() because file is NULL. Instead, add the path to struct fs_iter directly so it can be used in the error. Broken by eaaf40ca4e8994824abff89fc617c3cc737d83a5 M src/lib-fs/fs-api-private.h M src/lib-fs/fs-api.c 2020-10-22 20:21:41 +0300 Aki Tuomi (7a97dfb74f) quota: Avoid implicit integer conversion to unsigned in quota calculation Deducting negative number from unsigned integer causes signed integer conversion to unsigned int, which results a too large positive number. Do calculations using int64 instead. This did not cause any visible problems, found by clang integer sanitization. M src/plugins/quota/quota.c 2020-10-22 18:53:34 +0300 Aki Tuomi (408a4323ac) global: Fix overzealous use of ENUM_NEGATE M src/lib-index/mail-transaction-log-file.c M src/lib-ssl-iostream/iostream-openssl-context.c 2020-10-22 22:46:35 +0300 Timo Sirainen (d1808bf2dd) lib: istream-seekable - Fix returning stream size The returned size may have been truncated. M src/lib/istream-seekable.c M src/lib/test-istream-seekable.c 2020-10-16 11:21:51 +0300 Timo Sirainen (966140ac53) lib-fs: Add assert to make sure we never log "(null)" as the old error M src/lib-fs/fs-api.c 2020-10-16 11:20:04 +0300 Timo Sirainen (8a094bf121) lib-fs: Fix logging old error when an unlogged error is replaced by new error The old error was logged as "(null)" if the error happened in a non-root (filter) file. M src/lib-fs/fs-api.c 2020-10-16 10:19:59 +0300 Timo Sirainen (eaaf40ca4e) lib-fs: Include file's path when logging pending error messages Otherwise it may not be known which file the error is about. This happens when a file is freed without the last error being logged. Also when an unlogged error is being replaced with a new error. M src/lib-fs/fs-api.c 2020-09-24 13:44:58 -0400 Josef 'Jeff' Sipek (23645222de) lib: event-filter-parser - Disallow non-equals comparators on non-fields Non-equals comparisons (<, <=, >, and >=) aren't well defined for anything other than fields. Therefore, if we encounter one of these comparators with an event name, category name, or source location, we should error out and avoid confusing the user. M src/lib/event-filter-parser.y M src/lib/test-event-filter-parser.c 2020-10-15 20:34:05 +0300 Timo Sirainen (81e2119bf7) lib-storage: Delay recreating event when closing mail If the mail isn't reused, the event is unnecessary. M src/lib-storage/index/index-mail.c 2020-10-19 13:49:29 +0300 Aki Tuomi (fb6aa64435) global: Explicitly wrap values to fit target M src/lib-compression/test-compression.c M src/lib-imap/imap-utf7.c M src/lib/base64.c M src/lib/test-array.c M src/lib/test-data-stack.c M src/lib/test-istream-concat.c M src/lib/test-istream-seekable.c 2020-09-01 09:44:04 +0300 Aki Tuomi (48b2c8cfaf) global: Add explicit casts where needed Squash implicit conversion complains from sanitizer. M src/auth/crypt-blowfish.c M src/lib-index/mail-index-sync-keywords.c M src/lib-index/mail-index-sync-update.c M src/lib-lua/dlua-dovecot.c M src/lib-master/master-service.c M src/lib-storage/index/mbox/mbox-sync-rewrite.c M src/lib-storage/index/mbox/mbox-sync-update.c M src/lib-storage/index/mbox/mbox-sync.c M src/lib/test-array.c M src/lib/test-failures.c M src/lib/test-unichar.c 2020-08-13 11:36:08 +0300 Aki Tuomi (fd35a7baa7) global: Disable undefined behaviour sanitization for select locations M src/auth/crypt-blowfish.c M src/lib-http/http-client-peer.c M src/lib-otp/otp-parse.c M src/lib/bits.h M src/lib/buffer.c M src/lib/data-stack.c M src/lib/hash.c M src/lib/md4.c M src/lib/md5.c M src/lib/strnum.c M src/lib/test-bits.c 2020-08-20 08:39:26 +0300 Aki Tuomi (f4cca6a5c6) global: Fix negation with constants to match target type M src/doveadm/doveadm-dump-log.c M src/lib-index/mail-cache-transaction.c M src/lib-index/mail-index-private.h M src/lib-index/mail-index-sync-update.c M src/lib-index/mail-index-util.c M src/lib-storage/index/index-mail.h M src/lib-storage/index/mbox/mbox-lock.c M src/lib-storage/list/mailbox-list-index-notify.c M src/lib/hash.c M src/lib/md4.c M src/lib/md5.c M src/lib/test-bits.c M src/plugins/fts-squat/squat-uidlist.c 2020-08-20 08:35:59 +0300 Aki Tuomi (4684a4a0e8) global: Use ENUM_NEGATE() macro where necessary M src/auth/auth-fields.c M src/doveadm/doveadm-dump-index.c M src/doveadm/doveadm-mail-mailbox-cache.c M src/doveadm/doveadm-mail-mailbox-status.c M src/doveadm/dsync/dsync-brain.c M src/doveadm/dsync/dsync-ibc-stream.c M src/doveadm/dsync/dsync-transaction-log-scan.c M src/imap-login/imap-proxy.c M src/imap/cmd-list.c M src/imap/imap-search.c M src/imap/imap-sync.c M src/lib-dict-backend/dict-cdb.c M src/lib-fs/fs-api.c M src/lib-fs/fs-metawrap.c M src/lib-index/mail-cache-decisions.c M src/lib-index/mail-cache-fields.c M src/lib-index/mail-cache-purge.c M src/lib-index/mail-cache-transaction.c M src/lib-index/mail-index-map-hdr.c M src/lib-index/mail-index-sync-update.c M src/lib-index/mail-index-sync.c M src/lib-index/mail-index-transaction-update.c M src/lib-index/mail-index-transaction-view.c M src/lib-index/mail-index-view-sync.c M src/lib-index/mail-transaction-log-file.c M src/lib-index/mail-transaction-log-view.c M src/lib-index/test-mail-cache-purge.c M src/lib-index/test-mail-index-transaction-update.c M src/lib-mail/message-decoder.c M src/lib-mail/message-parser.c M src/lib-smtp/smtp-server-connection.c M src/lib-ssl-iostream/iostream-openssl-context.c M src/lib-storage/index/cydir/cydir-save.c M src/lib-storage/index/cydir/cydir-storage.c M src/lib-storage/index/dbox-common/dbox-save.c M src/lib-storage/index/dbox-multi/mdbox-mail.c M src/lib-storage/index/dbox-multi/mdbox-storage.c M src/lib-storage/index/dbox-single/sdbox-copy.c M src/lib-storage/index/dbox-single/sdbox-storage.c M src/lib-storage/index/imapc/imapc-list.c M src/lib-storage/index/imapc/imapc-mail-fetch.c M src/lib-storage/index/imapc/imapc-mailbox.c M src/lib-storage/index/imapc/imapc-save.c M src/lib-storage/index/imapc/imapc-storage.c M src/lib-storage/index/index-mail-headers.c M src/lib-storage/index/index-mail.c M src/lib-storage/index/index-search.c M src/lib-storage/index/index-status.c M src/lib-storage/index/index-storage.c M src/lib-storage/index/maildir/maildir-filename-flags.c M src/lib-storage/index/maildir/maildir-mail.c M src/lib-storage/index/maildir/maildir-save.c M src/lib-storage/index/maildir/maildir-sync-index.c M src/lib-storage/index/maildir/maildir-uidlist.c M src/lib-storage/index/mbox/mbox-save.c M src/lib-storage/index/mbox/mbox-sync-update.c M src/lib-storage/index/mbox/mbox-sync.c M src/lib-storage/index/pop3c/pop3c-storage.c M src/lib-storage/index/raw/raw-storage.c M src/lib-storage/list/mailbox-list-fs-iter.c M src/lib-storage/list/mailbox-list-index-backend.c M src/lib-storage/list/mailbox-list-index-iter.c M src/lib-storage/list/mailbox-list-index-status.c M src/lib-storage/list/mailbox-list-index-sync.c M src/lib-storage/list/mailbox-list-index.c M src/lib-storage/list/mailbox-list-iter.c M src/lib-storage/list/mailbox-list-maildir-iter.c M src/lib-storage/list/mailbox-list-subscriptions.c M src/lib-storage/mail-storage-service.c M src/lib-storage/mail-storage.c M src/lib-storage/mailbox-attribute.c M src/lib/askpass.c M src/lib/fd-util.c M src/lib/ioloop-poll.c M src/lib/iostream-temp.c M src/lib/net.c M src/plugins/acl/acl-cache.c M src/plugins/acl/acl-mailbox-list.c M src/plugins/acl/acl-mailbox.c M src/plugins/fs-compress/fs-compress.c M src/plugins/fts-lucene/fts-backend-lucene.c M src/plugins/fts-solr/fts-backend-solr.c M src/plugins/lazy-expunge/lazy-expunge-plugin.c M src/plugins/mail-crypt/fs-crypt-common.c M src/plugins/quota/quota-storage.c M src/plugins/replication/replication-plugin.c M src/plugins/virtual/virtual-storage.c M src/plugins/virtual/virtual-sync.c M src/util/rawlog.c 2020-09-23 14:51:53 +0300 Aki Tuomi (38a1c8fc8d) global: Use UOFF_T_MAX instead of (uoff_t)-1 M src/anvil/anvil-settings.c M src/auth/auth-settings.c M src/config/config-settings.c M src/dict/dict-settings.c M src/director/director-settings.c M src/dns/dns-client-settings.c M src/doveadm/doveadm-settings.c M src/doveadm/dsync/dsync-mail.h M src/doveadm/dsync/dsync-mailbox-export.c M src/doveadm/dsync/dsync-mailbox-import.c M src/doveadm/dsync/dsync-transaction-log-scan.c M src/imap-hibernate/imap-hibernate-settings.c M src/imap-login/imap-login-settings.c M src/imap-urlauth/imap-urlauth-login-settings.c M src/imap-urlauth/imap-urlauth-settings.c M src/imap-urlauth/imap-urlauth-worker-settings.c M src/imap/cmd-append.c M src/imap/imap-fetch-body.c M src/imap/imap-settings.c M src/indexer/indexer-settings.c M src/indexer/indexer-worker-settings.c M src/ipc/ipc-settings.c M src/lda/main.c M src/lib-compression/istream-bzlib.c M src/lib-compression/istream-lzma.c M src/lib-compression/istream-zlib.c M src/lib-fs/fs-api.c M src/lib-fs/fs-metawrap.c M src/lib-fs/fs-posix.c M src/lib-http/http-client-connection.c M src/lib-http/http-header-parser.c M src/lib-http/http-response-parser.c M src/lib-http/http-server-request.c M src/lib-http/test-http-payload.c M src/lib-imap-storage/imap-msgpart-url.c M src/lib-imap-storage/imap-msgpart.c M src/lib-imap-storage/imap-msgpart.h M src/lib-index/mail-index-map-hdr.c M src/lib-index/mail-index-map-read.c M src/lib-index/mail-index-sync-update.c M src/lib-index/mail-index-sync.c M src/lib-index/mail-index-view-sync.c M src/lib-index/mail-transaction-log-file.c M src/lib-index/mail-transaction-log-private.h M src/lib-index/mail-transaction-log-view.c M src/lib-index/mail-transaction-log.c M src/lib-index/test-mail-transaction-log-view.c M src/lib-mail/istream-attachment-connector.c M src/lib-mail/istream-attachment-connector.h M src/lib-mail/istream-header-filter.c M src/lib-mail/test-istream-attachment.c M src/lib-settings/settings-parser.c M src/lib-smtp/smtp-command-parser.c M src/lib-smtp/smtp-server-connection.c M src/lib-smtp/smtp-server-reply.c M src/lib-smtp/test-smtp-payload.c M src/lib-storage/index/dbox-common/dbox-file-fix.c M src/lib-storage/index/dbox-common/dbox-file.c M src/lib-storage/index/dbox-common/dbox-mail.c M src/lib-storage/index/dbox-multi/mdbox-file.c M src/lib-storage/index/imapc/imapc-mail-fetch.c M src/lib-storage/index/imapc/imapc-mail.c M src/lib-storage/index/index-mail-binary.c M src/lib-storage/index/index-mail.c M src/lib-storage/index/istream-mail.c M src/lib-storage/index/maildir/maildir-copy.c M src/lib-storage/index/maildir/maildir-mail.c M src/lib-storage/index/maildir/maildir-save.c M src/lib-storage/index/maildir/maildir-uidlist.c M src/lib-storage/index/mbox/istream-raw-mbox.c M src/lib-storage/index/mbox/istream-raw-mbox.h M src/lib-storage/index/mbox/mbox-mail.c M src/lib-storage/index/mbox/mbox-save.c M src/lib-storage/index/mbox/mbox-sync-parse.c M src/lib-storage/index/mbox/mbox-sync-rewrite.c M src/lib-storage/index/mbox/mbox-sync-update.c M src/lib-storage/index/mbox/mbox-sync.c M src/lib-storage/index/pop3c/pop3c-mail.c M src/lib-storage/index/raw/raw-mail.c M src/lib-storage/index/raw/raw-storage.c M src/lib/file-cache.c M src/lib/istream-concat.c M src/lib/istream-failure-at.c M src/lib/istream-limit.c M src/lib/istream-private.h M src/lib/istream-seekable.c M src/lib/istream-tee.c M src/lib/istream.c M src/lib/ostream-file.c M src/lib/ostream.h M src/lib/strnum.c M src/lib/test-iostream-temp.c M src/lib/test-istream-concat.c M src/lib/test-istream-sized.c M src/lib/test-istream.c M src/lmtp/lmtp-client.c M src/lmtp/lmtp-proxy.c M src/lmtp/lmtp-settings.c M src/log/log-settings.c M src/master/master-settings.c M src/master/service.c M src/old-stats/stats-settings.c M src/plugins/fts-squat/squat-uidlist.c M src/plugins/mail-crypt/mail-crypt-plugin.c M src/plugins/pop3-migration/pop3-migration-plugin.c M src/plugins/quota/quota-maildir.c M src/plugins/zlib/zlib-plugin.c M src/pop3-login/pop3-login-settings.c M src/pop3/pop3-commands.c M src/pop3/pop3-settings.c M src/replication/aggregator/aggregator-settings.c M src/replication/replicator/replicator-settings.c M src/stats/stats-settings.c M src/submission-login/submission-login-settings.c M src/submission/submission-settings.c M src/util/health-check-settings.c M src/util/tcpwrap-settings.c 2020-09-23 14:43:29 +0300 Aki Tuomi (e80cfb62b6) global: Use SIZE_MAX instead of (size_t)-1 M src/anvil/anvil-connection.c M src/auth/auth-client-connection.c M src/auth/auth-master-connection.c M src/auth/auth-settings.c M src/auth/auth-worker-client.c M src/auth/auth-worker-server.c M src/auth/db-passwd-file.c M src/auth/mech-gssapi.c M src/auth/mech-winbind.c M src/auth/userdb-passwd-file.c M src/config/config-connection.c M src/config/config-parser.c M src/config/config-request.c M src/dict/dict-settings.c M src/director/auth-connection.c M src/director/director-settings.c M src/director/director-test.c M src/director/director.c M src/director/doveadm-connection.c M src/director/login-connection.c M src/dns/dns-client.c M src/doveadm/client-connection-tcp.c M src/doveadm/doveadm-director.c M src/doveadm/doveadm-dsync.c M src/doveadm/doveadm-dump-dbox.c M src/doveadm/doveadm-dump-log.c M src/doveadm/doveadm-log.c M src/doveadm/doveadm-oldstats.c M src/doveadm/doveadm-penalty.c M src/doveadm/doveadm-replicator.c M src/doveadm/doveadm-settings.c M src/doveadm/doveadm-stats.c M src/doveadm/doveadm-who.c M src/doveadm/doveadm-zlib.c M src/doveadm/server-connection.c M src/imap-hibernate/imap-hibernate-client.c M src/imap-hibernate/imap-master-connection.c M src/imap-login/imap-login-settings.c M src/imap-urlauth/imap-urlauth-client.c M src/imap-urlauth/imap-urlauth-login-settings.c M src/imap-urlauth/imap-urlauth-settings.c M src/imap-urlauth/imap-urlauth-worker-settings.c M src/imap-urlauth/imap-urlauth-worker.c M src/imap/cmd-getmetadata.c M src/imap/cmd-urlfetch.c M src/imap/imap-client.c M src/imap/imap-fetch-body.c M src/imap/imap-master-client.c M src/imap/imap-settings.c M src/indexer/indexer-client.c M src/indexer/master-connection.c M src/indexer/worker-connection.c M src/ipc/client.c M src/ipc/ipc-connection.c M src/lib-auth/auth-client-connection.c M src/lib-charset/charset-iconv.c M src/lib-dcrypt/dcrypt-openssl.c M src/lib-dcrypt/ostream-encrypt.c M src/lib-dict/dict-client.c M src/lib-dict/dict-file.c M src/lib-dict/dict-memcached-ascii.c M src/lib-dict/dict-memcached.c M src/lib-dict/dict-redis.c M src/lib-dns/dns-lookup.c M src/lib-dns/dns-util.c M src/lib-fs/fs-test.c M src/lib-http/http-client-connection.c M src/lib-http/http-client-request.c M src/lib-http/http-message-parser.c M src/lib-http/http-server-connection.c M src/lib-http/http-server-response.c M src/lib-http/test-http-client-errors.c M src/lib-http/test-http-payload.c M src/lib-http/test-http-server-errors.c M src/lib-imap-client/imapc-client.h M src/lib-imap-client/imapc-connection.c M src/lib-imap-client/test-imapc-client.c M src/lib-imap-storage/imap-msgpart.c M src/lib-imap-urlauth/imap-urlauth-connection.c M src/lib-imap/imap-bodystructure.c M src/lib-imap/imap-envelope.c M src/lib-imap/imap-id.c M src/lib-index/mail-cache-transaction.c M src/lib-index/mail-index-fsck.c M src/lib-index/mail-index-strmap.c M src/lib-index/mail-index-transaction-update.c M src/lib-index/mail-transaction-log-append.c M src/lib-index/mail-transaction-log-file.c M src/lib-lda/lda-settings.c M src/lib-mail/istream-header-filter.c M src/lib-mail/qp-decoder.c M src/lib-mail/test-istream-dot.c M src/lib-master/anvil-client.c M src/lib-master/ipc-client.c M src/lib-master/ipc-server.c M src/lib-master/master-instance.c M src/lib-master/master-login-auth.c M src/lib-master/master-login.c M src/lib-master/master-service-settings-cache.c M src/lib-master/master-service-settings.c M src/lib-master/master-service-ssl-settings.c M src/lib-master/stats-client.c M src/lib-master/test-event-stats.c M src/lib-master/test-master-service-settings-cache.c M src/lib-oauth2/test-oauth2-jwt.c M src/lib-program-client/program-client.c M src/lib-program-client/test-program-client-net.c M src/lib-program-client/test-program-client-unix.c M src/lib-settings/settings-parser.c M src/lib-settings/settings.c M src/lib-smtp/smtp-client-command.c M src/lib-smtp/smtp-client-connection.c M src/lib-smtp/smtp-client.h M src/lib-smtp/smtp-reply-parser.c M src/lib-smtp/smtp-server-connection.c M src/lib-smtp/smtp-submit-settings.c M src/lib-smtp/test-smtp-client-errors.c M src/lib-smtp/test-smtp-server-errors.c M src/lib-smtp/test-smtp-submit.c M src/lib-sql/sql-api.c M src/lib-ssl-iostream/istream-openssl.c M src/lib-storage/index/dbox-common/dbox-file.c M src/lib-storage/index/dbox-multi/mdbox-purge.c M src/lib-storage/index/dbox-multi/mdbox-settings.c M src/lib-storage/index/imapc/imapc-settings.c M src/lib-storage/index/maildir/maildir-settings.c M src/lib-storage/index/maildir/maildir-uidlist.c M src/lib-storage/index/mbox/istream-raw-mbox.c M src/lib-storage/index/mbox/mbox-settings.c M src/lib-storage/index/mbox/mbox-sync-parse.c M src/lib-storage/index/mbox/mbox-sync-rewrite.c M src/lib-storage/index/mbox/mbox-sync-update.c M src/lib-storage/index/pop3c/pop3c-client.c M src/lib-storage/index/pop3c/pop3c-settings.c M src/lib-storage/mail-storage-settings.c M src/lib-test/test-istream.c M src/lib-test/test-ostream.c M src/lib/array.c M src/lib/array.h M src/lib/buffer.c M src/lib/buffer.h M src/lib/file-cache.c M src/lib/istream-data.c M src/lib/istream-seekable.c M src/lib/istream-tee.c M src/lib/mempool-system.c M src/lib/ostream-buffer.c M src/lib/ostream-wrapper.c M src/lib/strfuncs.c M src/lib/test-buffer-istream.c M src/lib/test-buffer.c M src/lib/test-connection.c M src/lib/test-file-cache.c M src/lib/test-iostream-pump.c M src/lib/test-istream-multiplex.c M src/lib/test-multiplex.c M src/lib/test-ostream-buffer.c M src/lib/test-ostream-multiplex.c M src/lib/unichar.c M src/lib/uri-util.c M src/lmtp/lmtp-settings.c M src/log/doveadm-connection.c M src/login-common/login-proxy.c M src/login-common/login-settings.c M src/master/master-settings.c M src/master/test-auth-client.c M src/master/test-auth-master.c M src/master/test-master-login-auth.c M src/old-stats/client.c M src/old-stats/global-memory.c M src/old-stats/stats-settings.c M src/plugins/acl/acl-backend-vfile-acllist.c M src/plugins/acl/acl-backend-vfile.c M src/plugins/acl/acl-global-file.c M src/plugins/fts-squat/squat-test.c M src/plugins/fts/fts-expunge-log.c M src/plugins/mail-crypt/fs-crypt-common.c M src/plugins/mail-crypt/fs-crypt-settings.c M src/plugins/quota/quota-status-settings.c M src/plugins/quota/quota-status.c M src/plugins/trash/trash-plugin.c M src/plugins/virtual/virtual-config.c M src/pop3-login/pop3-login-settings.c M src/pop3/pop3-client.c M src/pop3/pop3-settings.c M src/replication/aggregator/aggregator-settings.c M src/replication/aggregator/notify-connection.c M src/replication/aggregator/replicator-connection.c M src/replication/replicator/doveadm-connection.c M src/replication/replicator/dsync-client.c M src/replication/replicator/notify-connection.c M src/replication/replicator/replicator-queue.c M src/replication/replicator/replicator-settings.c M src/stats/client-reader.c M src/stats/client-writer.c M src/stats/stats-settings.c M src/stats/test-client-reader.c M src/stats/test-client-writer.c M src/submission-login/submission-login-settings.c M src/submission/submission-settings.c M src/util/rawlog.c 2020-08-11 08:41:54 +0300 Aki Tuomi (3698334932) lib: macros - Add ENUM_NEGATE Handles enumeration flag negation. M src/lib/macros.h 2020-07-28 13:42:01 +0300 Aki Tuomi (55c6d609aa) configure: Add ubsan support M m4/dovecot.m4 M src/lib/macros.h 2020-09-23 14:39:36 +0300 Aki Tuomi (15318d2780) lib-mail: test-message-header-hash: Fix type issue Satisfies runtime analyzer. M src/lib-mail/test-message-header-hash.c 2020-09-22 14:39:41 +0300 Aki Tuomi (e32650c399) doveadm: mailbox status - Handle first_save_date correctly If first_save_date is -1 it means no save has been done. M src/doveadm/doveadm-mail-mailbox-status.c 2020-08-20 08:57:35 +0300 Aki Tuomi (309b3ceba0) lib: unichar - Change uni_utf8_char_bytes to accept unsigned char M src/lib-imap/imap-utf7.c M src/lib/unichar.h 2020-09-01 09:57:04 +0300 Aki Tuomi (fa3b53798c) lib-index: Use SIZE_MAX with str_sanitize M src/lib-index/mail-index-map.c M src/lib-index/mail-index.c 2020-09-01 09:57:23 +0300 Aki Tuomi (b8c83f6061) auth: password-scheme - Use UINT_MAX when calling password_generate_otp M src/auth/password-scheme.c 2020-09-01 11:54:50 +0300 Aki Tuomi (3aed1e852a) lib: mempool-allocfree - Do not use PTR_OFFSET with negative offset Avoids undefined behaviour sanitization error. M src/lib/mempool-allocfree.c 2020-09-01 11:56:42 +0300 Aki Tuomi (f5af22d2c8) lib-fts: test-fts-tokenizer - Change test_chars to unsigned char M src/lib-fts/test-fts-tokenizer.c 2020-08-20 09:46:24 +0300 Aki Tuomi (f2e4eed824) lib: str - Ensure str_append_c gets unsigned char parameter M src/lib/str.h 2020-10-01 11:37:24 +0300 Timo Sirainen (f4ab2fc962) lib: seq-range-array - Assert-crash if array becomes 0..(uint32_t)-1 M src/lib/seq-range-array.c M src/lib/seq-range-array.h M src/lib/test-lib.inc M src/lib/test-seq-range-array.c 2020-10-01 11:19:33 +0300 Timo Sirainen (588c3b9637) lib: seq_range_array_add() - Reorder code flow M src/lib/seq-range-array.c 2020-10-01 11:18:04 +0300 Timo Sirainen (1c7ae79d97) lib: seq-range-array - Split off seq_range_array_add_slow_path() M src/lib/seq-range-array.c 2020-10-01 11:04:56 +0300 Timo Sirainen (1203cd16ad) lib: seq-range-array - Use seq_range_length() internally M src/lib/seq-range-array.c 2020-10-01 11:04:36 +0300 Timo Sirainen (c1a5cbb9da) lib: seq_range_length() - Use const pointer M src/lib/seq-range-array.h 2020-10-20 15:02:24 +0300 Martti Rannanjärvi (6752ab40f6) doc: Include dovecot-oauth2.conf.ext in dist tarball M doc/example-config/Makefile.am 2020-10-12 23:29:02 +0200 Stephan Bosch (7f1738a772) doveadm-server: Fix STARTTLS support. M src/doveadm/main.c 2020-10-13 22:56:25 +0200 Stephan Bosch (4b90fbfcc3) lib-master: master-service-ssl - Make context initialization error more useful. This improves the error in case SSL is disabled; other causes still yield a rather unhelpful error message. M src/lib-master/master-service-ssl.c 2020-10-12 23:18:09 +0200 Stephan Bosch (c2e5d7fdfb) lib: ostream-multiplex - Fix dead assignment by adding an assertion on the result. Found by Clang scan-build. M src/lib/ostream-multiplex.c 2020-10-07 00:06:08 +0200 Stephan Bosch (904d96418a) global: Fix dead assignments in expressions. Found by Clang scan-build. M src/auth/db-lua.c M src/lib-sql/driver-cassandra.c M src/lib/ostream-wrapper.c M src/plugins/mail-lua/mail-lua-plugin.c M src/plugins/mail-lua/mail-storage-lua.c M src/plugins/push-notification/push-notification-driver-lua.c 2020-10-08 13:48:45 +0200 raphael-walther <48209673+raphael-walther@users.noreply.github.com> (9a8ebce905) man: Update doveadm-search-query.7 TEXT searches also from headers, not just body. M doc/man/doveadm-search-query.7 2020-10-07 17:48:06 +0200 jonmoesli <69861248+jonmoesli@users.noreply.github.com> (f0c15f2d6c) director: Fix error message when director_username_hash expansion fails M src/director/director.c 2020-10-09 14:58:54 +0300 Timo Sirainen (787cc98cf8) lib-storage: Fix potential assert-crash when adding missing attachment keywords Broken by aab71c35259f542d9ba46b4b5b24eff0016b802e Fixes: Panic: file index-mail.c: line 1241 (index_mail_parse_body): assertion failed: (data->parser_ctx != NULL) M src/lib-storage/index/index-mail-headers.c M src/lib-storage/index/index-mail.c 2020-10-08 10:41:52 +0300 Timo Sirainen (4c4377e82e) lib: json-parser - Fix skipping strings with non-blocking input The skipping could have accessed memory outside the allocated string. This might have resulted in a crash, or caused JSON parsing to fail. M src/lib/json-parser.c 2020-09-16 05:06:12 +0200 Stephan Bosch (8608c26908) lib-mail: test-message-header-decode - Add random encode/decode tests for 8 bit data. This also tests handling of (broken) UTF-8 input. M src/lib-mail/test-message-header-decode.c 2020-09-16 04:31:58 +0200 Stephan Bosch (b37dcca4fb) lib-mail: test-message-header-encode - Add tests for broken UTF-8 in input. M src/lib-mail/test-message-header-encode.c 2020-09-17 12:17:44 +0200 Stephan Bosch (5f35cab966) lib-mail: test-message-header-encode - Check maximum line length with long printable text and whitespace. M src/lib-mail/test-message-header-encode.c 2020-09-17 01:26:13 +0200 Stephan Bosch (05e84eb74c) lib-mail: message-header-encode - Update function descriptions. M src/lib-mail/message-header-encode.h 2020-09-16 03:21:30 +0200 Stephan Bosch (617b1beaa3) lib-mail: Properly handle bad UTF-8 in message_header_encode_b(). Broken characters are substituted with a replacement character. M src/lib-mail/message-header-encode.c 2020-09-16 03:19:34 +0200 Stephan Bosch (e73eafc68b) lib-mail: Properly handle bad UTF-8 in message_header_encode_q(). Broken characters are substituted with a replacement character. M src/lib-mail/message-header-encode.c 2020-09-16 03:10:12 +0200 Stephan Bosch (de56f9152b) lib-mail: message-header-encode - Return immediately when len == 0 in message_header_encode_b/q(). Just to make sure. This shouldn't happen in the first place. M src/lib-mail/message-header-encode.c 2020-09-16 03:05:30 +0200 Stephan Bosch (894e088f92) lib-mail: message-header-encode - Use size_t for length/size variables and parameters. M src/lib-mail/message-header-encode.c M src/lib-mail/message-header-encode.h 2020-09-17 01:33:52 +0200 Stephan Bosch (2d35de6b65) lib-mail: message-header-encode - Fix encoding of 0x7F byte for Q encoding. It was not escaped. M src/lib-mail/message-header-encode.c M src/lib-mail/test-message-header-decode.c 2020-09-17 01:41:41 +0200 Stephan Bosch (6832846c8c) lib-mail: test-message-header-decode - Use test_assert_idx(). M src/lib-mail/test-message-header-decode.c 2020-09-16 18:28:43 +0200 Stephan Bosch (154602378a) lib-mail: test-message-header-decode - Avoid generating random bytes that are never used. M src/lib-mail/test-message-header-decode.c 2020-09-17 12:24:40 +0200 Stephan Bosch (9bd6007d8b) lib-mail: test-message-header-decode - Use test_assert_strcmp(). M src/lib-mail/test-message-header-decode.c 2020-09-17 12:23:06 +0200 Stephan Bosch (0b5206d887) lib-mail: test-message-header-encode - Use test_assert_strcmp(). M src/lib-mail/test-message-header-encode.c 2020-09-16 01:03:53 +0200 Stephan Bosch (334cd2fc22) lib: base64 - Add base64_encode_get_full_space(). This translates the space in the destination buffer to the number of bytes that can be encoded at most to complete the full base64 encoding, including padding and newlines if configured. M src/lib/base64.c M src/lib/base64.h M src/lib/test-base64.c 2020-09-16 01:02:22 +0200 Stephan Bosch (dd8408a50e) lib: base64 - Fix return value of base64_encode_more(). It didn't properly return TRUE when all input data was consumed. M src/lib/base64.c M src/lib/test-base64.c 2020-09-16 23:19:19 +0200 Stephan Bosch (2eaa4e3fd3) lib: test-base64 - Add test for base64_encode_get_size() in random lowlevel streaming tests. M src/lib/test-base64.c 2020-09-16 23:20:32 +0200 Stephan Bosch (375332aa5f) lib: test-base64 - Abort random lowlevel test case early when something failed already. M src/lib/test-base64.c 2020-09-16 00:37:45 +0200 Stephan Bosch (c830037f8c) lib: unichar - Add length definitions for replacement and ellipsis characters. M src/lib/unichar.h 2020-05-06 13:15:34 +0300 Timo Sirainen (1cf8040306) lib: json-parser - Fix parsing \uXXXX in non-blocking input If it was in the istream's read boundary it resulted as parsing error. M src/lib/json-parser.c M src/lib/test-json-parser.c 2020-05-06 13:01:41 +0300 Timo Sirainen (c4beabf43f) lib: json-parser - Fix error message for invalid escape sequence M src/lib/json-parser.c 2020-05-06 12:54:13 +0300 Timo Sirainen (7d74329816) lib: json-parser - Don't allocate errors from data stack There's no guarantee that the json-parser's life time is within the same data stack frame. M src/lib/json-parser.c 2020-05-06 12:38:22 +0300 Timo Sirainen (a4057ea644) lib: json-parser - Fail if strings contain NULs Previous behavior was to just truncate the string, which could be worse than failing entirely. M src/lib/json-parser.c M src/lib/test-json-parser.c 2020-09-23 01:59:27 +0200 Stephan Bosch (4d09884528) lib-http: test-http-client-errors - Add unit test for host idle timeout. This test involves retrying a request that failed host lookup, which used to cause the request to be erroneously aborted. M src/lib-http/test-http-client-errors.c 2020-09-21 01:14:20 +0200 Stephan Bosch (ac4173fa38) lib-http: http-client-host - Prevent erroneously starting host idle timeout during request retry. During request retry the request is first dropped from and subsequently added to the queue. Dropping a request from the queue can start the host idle timeout when it is the very last one. The timeout was not removed later on anymore when the request was submitted again, because it was added prematurely (before dropping the request). M src/lib-http/http-client-host.c 2020-09-20 23:16:00 +0200 Stephan Bosch (29f3be1af8) lib-http: http-client-host - Fix determination of whether host is idle. M src/lib-http/http-client-host.c 2020-09-22 22:12:27 +0200 Stephan Bosch (c701368bef) lib-http: http-client-host - Make sure DNS lookup is performed when host has no IPs. This fixes at least one panic: Panic: file ./http-client-private.h: line 679 (http_client_host_get_ip): assertion failed: (idx < host->shared->ips_count) M src/lib-http/http-client-host.c 2020-08-26 11:31:01 +0300 Timo Sirainen (bf1c45440a) auth: Fix potential read buffer overflow in PLAIN mechanism The overflow could have crashed the auth process in theory, although practically it doesn't seem to happen. M src/auth/mech-plain.c M src/auth/test-mech.c 2020-08-26 11:42:02 +0300 Timo Sirainen (e29ce296cf) auth: test-mech - Allocate test input explicitly This way valgrind will catch if there are read buffer overflows. M src/auth/test-mech.c 2020-04-01 17:22:04 +0300 Timo Sirainen (c394c60959) lib-index: Fix DEBUG assert to not trigger on transaction resets Fixes a crash in test-mail-index when compiled --with-devel-checks: Panic: file mail-index-transaction.c: line 211 (mail_index_transaction_commit_real): assertion failed: (expected_highest_modseq == log->head->sync_highest_modseq) M src/lib-index/mail-index-transaction.c 2020-09-17 15:43:02 -0400 Josef 'Jeff' Sipek (372a88e701) login-common: Include the proxy's source address in log messages M src/login-common/client-common-auth.c 2020-09-17 15:42:52 -0400 Josef 'Jeff' Sipek (c066b7d60d) login-common: Move common client info logging into a helper function M src/login-common/client-common-auth.c 2020-09-17 14:19:46 -0400 Josef 'Jeff' Sipek (cd8a50c686) login-common: Add login_proxy_get_source_host() to get the local proxy hostname M src/login-common/login-proxy.c M src/login-common/login-proxy.h 2020-09-17 10:45:44 -0400 Josef 'Jeff' Sipek (bd8eadf128) login-common: Heap allocate login source IPs array to avoid use-after-free By default, the service init code runs with a temporary datastack frame that gets freed at the end of initialization to get rid of any temporary allocations made during init before the long-running part of the process executes. M src/login-common/main.c 2020-09-18 14:55:27 +0300 sergey.kitov (4740d48ba3) man: update doveadm-proxy man page with kick -h option. M doc/man/doveadm-proxy.1.in M src/login-common/login-proxy.c 2020-09-15 15:52:24 +0300 sergey.kitov (0f889378f5) doveadm: Implement proxy kick -h M src/doveadm/doveadm-proxy.c 2020-09-15 15:51:26 +0300 sergey.kitov (30a816a360) login-common: Implement kicking all user at backend host. M src/login-common/login-proxy.c 2020-09-17 13:51:36 +0300 sergey.kitov (62e8fe8c4e) login-common: change want_kick signature from (struct *client, ...) to (struct *login_proxy, ...) M src/login-common/login-proxy.c 2020-09-25 10:43:39 +0300 sergey.kitov (10f534e0f2) login-common: Put proxy looping on stack in login_proxy_cmd_kick_full() M src/login-common/login-proxy.c 2020-06-24 11:20:25 +0200 Stephan Bosch (517080d0f3) lib-smtp: smtp-server-connection - Ignore replied command for pipeline limit calculation. This prevents failed commands with payload from blocking the input pipeline. This caused a hang before. M src/lib-smtp/smtp-server-connection.c 2020-06-24 11:15:55 +0200 Stephan Bosch (95edff15c1) lib-smtp: smtp-server-connection - Use connection settings for command pipeline limit. It used the top-level server settings before. M src/lib-smtp/smtp-server-connection.c 2020-06-24 11:13:59 +0200 Stephan Bosch (0dcc8f0556) lib-smtp: smtp-server-connection - Move pipeline limit check to separate function. M src/lib-smtp/smtp-server-connection.c 2020-06-24 10:45:38 +0200 Stephan Bosch (e1009a8641) lib-smtp: smtp-server-command - Always end input lock/capture upon reply submission. M src/lib-smtp/smtp-server-command.c 2020-06-24 10:42:17 +0200 Stephan Bosch (d6ec5245d4) lib-smtp: smtp-server-command - Reliably end input capture in smtp_server_command_input_unlock(). M src/lib-smtp/smtp-server-command.c 2020-09-17 13:09:54 +0300 Timo Sirainen (3fa7052a5d) lib-storage: Rename mail_attachment_detection_options=add-flags-on-save to add-flags Keep add-flags-on-save for backwards compatibility. M doc/example-config/conf.d/10-mail.conf M src/lib-storage/index/index-mail.c M src/lib-storage/mail-storage-settings.c M src/lib-storage/mail-storage-settings.h M src/lib-storage/mail-storage.c 2020-09-04 01:58:58 +0300 Timo Sirainen (aab71c3525) lib-storage: Try to add missing attachment flags when opening mail stream Since the message body is being opened in any case, it's pretty inexpensive to add missing attachment flags. Do this only when mail_attachment_detection_options has add-flags-on-save but no no-flags-on-fetch. M src/lib-storage/index/index-mail.c 2020-09-10 16:38:11 +0300 Timo Sirainen (194dcaa65c) lib-storage: Try to add missing attachment flags when fetching MIME parts or BODYSTRUCTURE This happens only if both mime.parts and imap.bodystructure are already in cache and mail_attachment_detection_options has add-flags-on-save but no no-flags-on-fetch. The no-flags-on-fetch option may be removed in a future release once it's known that it's not causing any unexpected performance issues. M src/lib-storage/index/index-mail.c M src/lib-storage/mail-storage-settings.c M src/lib-storage/mail-storage-settings.h 2020-09-10 16:36:14 +0300 Timo Sirainen (52a0f91840) lib-storage: index_mail_get_cached_bodystructure() - Reorder the if statements Simplifies the following commit. M src/lib-storage/index/index-mail.c 2020-09-10 16:32:35 +0300 Timo Sirainen (74ab5e62e0) lib-storage: Avoid initializing stream multiple times recursively This fixes the situation where stream opening causes it to be re-opened by index_mail_parse_headers(). There are some other more rare situations, but they're in error handling code paths. M src/lib-storage/index/index-mail-headers.c M src/lib-storage/index/index-mail.c M src/lib-storage/index/index-mail.h 2020-09-10 16:21:17 +0300 Timo Sirainen (f4f1c0a1b6) lib-storage: Avoid caching size.physical unless it's explicitly asked for It's internally requested in a few places, but only as an optimization if it happens to exist. It's not important enough that it should affect caching decisions. This change becomes more important after the following changes, which cause size.physical to be added unnecessarily when filling out attachment flags. M src/lib-storage/index/index-mail.c 2020-09-22 20:00:17 +0200 Stephan Bosch (778811a3e6) lib-http: http-client-host - Do not prematurely reset ips_count to zero. It causes problems with existing connection attempts. Panic was: Panic: file http-client-queue.c: line 215 (http_client_queue_is_last_connect_ip): assertion failed: (queue->ips_connect_idx < ips_count) M src/lib-http/http-client-host.c 2020-09-23 02:04:20 +0200 Stephan Bosch (dff9d4719f) lib-http: http-client-host - Log debug message for failed DNS lookup. If the host has no requests, nothing is logged about the failure otherwise. M src/lib-http/http-client-host.c 2020-09-22 19:58:59 +0200 Stephan Bosch (1c9264909c) lib-http: http-client-host - Move DNS lookup success handling to a common function. M src/lib-http/http-client-host.c 2020-09-21 00:38:11 +0200 Stephan Bosch (a01eae05bb) lib-http: Reformat http-client-host.c. M src/lib-http/http-client-host.c 2020-09-28 15:26:27 -0400 ihsinme <61293369+ihsinme@users.noreply.github.com> (9ca475537e) lib-mail: html2text - Fix buffer out-of-bounds access The passed in buffer size is at least 1 byte shorter than the actual buffer size, therefore there is no chance of a crash. M src/lib-mail/mail-html2text.c 2020-08-15 00:56:36 +0300 Timo Sirainen (645a30a6c7) dict-sql: Fix crash if dict iteration is destroyed early If the iteration callback is still called after the iterator is freed, the callback accesses freed memory and crashes. M src/lib-dict-backend/dict-sql.c 2020-09-12 00:20:51 +0200 Stephan Bosch (dba3d86625) lib-smtp: test-smtp-command-parser - Add tests for input ending in partial UTF-8 sequences. M src/lib-smtp/test-smtp-command-parser.c 2020-09-12 00:19:14 +0200 Stephan Bosch (4e24c1a705) lib-smtp: test-smtp-command-parser - Test parsing commands from input that comes in gradually. M src/lib-smtp/test-smtp-command-parser.c 2020-09-12 00:15:35 +0200 Stephan Bosch (77903cf3a3) lib-smtp: smtp-command-parser - Fix parameter parsing not to fail on particular unicode code points. Unicode code points were sometimes erroneously checked as ASCII characters. M src/lib-smtp/smtp-command-parser.c 2020-09-11 21:53:06 +0200 Stephan Bosch (1ae3ca2988) lib-smtp: smtp-command-parser - Fix read past buffer limit while parsing UTF-8 character. The buffer limit was specified as (buf->pos - buf->end) rather than (buf->end - buf->pos). Since at most a valid UTF-8 character can be read beyond the buffer size, this bug didn't cause noticeable effects, nor does it present an attack surface. M src/lib-smtp/smtp-command-parser.c 2020-09-11 23:54:29 +0200 Stephan Bosch (2ec6f2f75b) lib-smtp: Reformat test-smtp-command-parser.c. M src/lib-smtp/test-smtp-command-parser.c 2020-09-11 22:57:58 +0200 Stephan Bosch (853b233469) lib-smtp: Reformat smtp-command-parser.c. M src/lib-smtp/smtp-command-parser.c 2020-08-31 20:38:42 +0300 Timo Sirainen (a668d767a7) lib-mail: message_parser_init_from_parts() - Fix crash if MIME boundaries don't end If the last "boundary--" doens't exist, the parsing assert-crashed at deinit. This mainly happened when searching mails. Fixes: Panic: file message-parser.c: line 175 (message_part_finish): assertion failed: (ctx->nested_parts_count > 0) M src/lib-mail/message-parser.c M src/lib-mail/test-message-parser.c 2020-08-28 18:35:00 +0300 Timo Sirainen (86e1953d07) acl: Ignore acl_object_list_deinit() error when copying ACLs from parent There's already a FIXME, and this makes static analyzer happier. M src/plugins/acl/acl-mailbox.c 2020-08-13 11:38:07 +0300 Timo Sirainen (007e1ff1c5) director: Explicitly ignore array_bsearch_insert_pos() return value Makes static analyzers happier. M src/director/mail-host.c 2020-08-13 11:29:38 +0300 Timo Sirainen (15e7385f69) lib: test-istream - Check or explicitly ignore i_stream_read() return value Makes static analyzers happier. M src/lib/test-istream.c 2020-08-12 11:05:55 +0300 Timo Sirainen (51ed74c63f) lib-ssl-iostream: Fix error message with invalid ciphersuites The error message contained curve_list's value, not ciphersuites' value. M src/lib-ssl-iostream/iostream-openssl-context.c 2020-09-14 17:44:58 +0300 Timo Sirainen (ffd2fdd8d8) lib-compression: test-compression - Fix memory leak M src/lib-compression/test-compression.c 2020-09-14 10:37:16 +0300 Timo Sirainen (8655329e14) lib: Add a comment about o_stream_create_buffer() M src/lib/ostream.h 2020-09-14 10:28:41 +0300 Timo Sirainen (d2054a3115) lib: ostream-buffer - Revert returning 0 as used buffer size This change broke at least one external plugin that assumed the original behavior. Safer to just revert this change. Reverts 48083d9e7fdbe257b0be33043ecf0ca87489eef9 M src/lib/ostream-buffer.c M src/lib/test-ostream-buffer.c 2020-09-14 10:27:26 +0300 Timo Sirainen (0416a3fdc0) lib-compression: test-compression - Convert from ostream-buffer to iostream-temp Using ostream-buffer required 48083d9e7fdbe257b0be33043ecf0ca87489eef9 change, but this broke some code that assumed the original behavior. M src/lib-compression/test-compression.c 2020-09-11 23:28:47 +0300 Aki Tuomi (c2eee2e4bc) lib-compression: test-compression - Use datastack in test Plugs a memory leak. Broken in 60b4040ba498ce7b19fc8b189d327cc606856f07 M src/lib-compression/test-compression.c 2020-09-11 14:29:14 +0300 Timo Sirainen (71c3938bca) lib-fs: test-fs-async - Fix to work properly after previous changes It's an async test, so it should expect that the fs actually behaves asynchronously. M src/lib-fs/fs-test-async.c 2020-09-11 14:28:11 +0300 Timo Sirainen (31d7b252df) lib-dict: dict_switch_ioloop() - Move also failure timeout Forgotten in 178bb676ea1dd380789d3587bf5e64fd85a29d7a M src/lib-dict/dict.c 2020-08-21 14:31:12 -0400 Josef 'Jeff' Sipek (0bcdf2217a) stats: event exporter - Use category exporting helper to avoid duplicates (tabtext) M src/stats/event-exporter-fmt-tab-text.c 2020-08-21 14:23:50 -0400 Josef 'Jeff' Sipek (de4d3eb974) stats: event exporter - Use category exporting helper to avoid duplicates (json) M src/stats/event-exporter-fmt-json.c 2020-08-21 14:23:14 -0400 Josef 'Jeff' Sipek (eb4c8a9a5a) stats: Add helper to append category names without duplicates M src/stats/event-exporter-fmt.c M src/stats/event-exporter.h 2020-08-28 18:36:47 +0300 Timo Sirainen (6f42f48bd3) lib: net_listen|connect_unix() - Use consistent error handling for too long paths The errno should be the same for both functions. Prefer ENAMETOOLONG if it exists on the OS, otherwise fallback to EOVERFLOW. M src/lib/net.c M src/lib/test-net.c 2020-09-11 08:22:11 +0300 Aki Tuomi (1f2ac2afaa) lib-dict: dict - Keep track of next commit in dict_wait Satisfies static analyser, broken in 178bb676ea1dd380789d3587bf5e64fd85a29d7a M src/lib-dict/dict.c 2020-09-10 17:56:49 +0300 Aki Tuomi (b4a048914a) lib-dict: dict - Ensure there are no commits during deinit M src/lib-dict/dict.c 2020-09-10 17:43:06 +0300 Aki Tuomi (24aca7088f) lib-dict: dict - Allow calling callback immediately Make callback calls the next callback immediately, instead of adding a timeout that calls the callback. Forgotten in 178bb676ea1dd380789d3587bf5e64fd85a29d7a M src/lib-dict/dict.c 2020-09-10 17:42:19 +0300 Aki Tuomi (5db10b21b3) lib-dict: dict - Change background to delayed_callback It better describes what it's intended to do. M src/lib-dict/dict.c 2020-08-12 15:48:14 +0300 Timo Sirainen (6907021530) acl: Add unit test for acl_rights_sort() M src/plugins/acl/Makefile.am A src/plugins/acl/test-acl.c 2020-08-12 15:46:31 +0300 Timo Sirainen (3d15b25968) acl: acl_rights_sort() - Handle zero sized rights array properly Fixes ubsan complaint about count-dest wrapping to negative. The array code handled this properly though, so nothing was broken. M src/plugins/acl/acl-api.c 2020-09-01 09:13:05 +0300 Aki Tuomi (9a389c7e88) lib: test-file-cache - Add tests for file-cache M src/lib/Makefile.am A src/lib/test-file-cache.c M src/lib/test-lib.inc 2020-08-20 16:47:12 +0300 Aki Tuomi (eab4b27d31) lib: log-throttle - Initialize last_throttle It's compared to ioloop_timeval later on and would produce overflow there. M src/lib/log-throttle.c 2020-08-20 16:24:41 +0300 Aki Tuomi (bbca56c946) quota: quota_free_bytes - Check we don't decrease more than INT64_MAX Otherwise we get overflow M src/plugins/quota/quota.c 2020-08-20 12:46:06 +0300 Aki Tuomi (d50a5a1151) lib: file-dotlock - Do not call callback if we are going to timeout M src/lib/file-dotlock.c 2020-08-20 10:55:36 +0300 Aki Tuomi (2a82a8a9da) lib-mail: istream-header-filter - Avoid unsigned overflow in last_offset calculation Unsigned integer overflow occurs when size is 0. M src/lib-mail/istream-header-filter.c 2020-08-20 10:37:54 +0300 Aki Tuomi (d34c873397) lib-ldap: ldap_connection_send_next - Extract next message in separate function M src/lib-ldap/ldap-connection.c 2020-08-20 10:31:41 +0300 Aki Tuomi (70d98bc561) lib-storage: index-mail-headers - Avoid unsigned overflow on header_match_value M src/lib-storage/index/index-mail-headers.c 2020-08-20 09:53:11 +0300 Aki Tuomi (4eb3f6f273) imap: imap-sync - Avoid unsigned integer overflow Error: imap-sync.c:433:17: runtime error: unsigned integer overflow: 4294967295 + 1 cannot be represented in type 'unsigned int' M src/imap/imap-sync.c 2020-08-20 09:44:58 +0300 Aki Tuomi (3a5ebc8e80) lib-mail: test-istream-attachment - Avoid unsigned overflow in size calculation M src/lib-mail/test-istream-attachment.c 2020-08-20 09:44:20 +0300 Aki Tuomi (43f8729587) lib: var-expand - Avoid unsigned overflow in offset calculation M src/lib/var-expand.c 2020-08-20 09:43:35 +0300 Aki Tuomi (16ab55427a) lib: time-util - Use correct data types M src/lib/time-util.c 2020-08-20 09:34:40 +0300 Aki Tuomi (192d351aec) quota: quota-imapc - Handle quota limits better If quota limit is bigger than INT64_MAX, it's unlimited as we cannot express this anyways. M src/plugins/quota/quota-imapc.c 2020-08-20 09:10:36 +0300 Aki Tuomi (7ca5c15b7f) lib-mail: message-parser - Change last_chr to unsigned char Matches code usage. M src/lib-mail/message-parser-private.h 2020-08-20 09:02:07 +0300 Aki Tuomi (1a29b5ec0c) lib-imap-storage: imap-msgpart - Fix constant type M src/lib-imap-storage/imap-msgpart.c 2020-08-20 08:47:16 +0300 Aki Tuomi (a0ea53c313) auth: password-scheme - Fix salt generation data type mess Satisfies runtime analyser M src/auth/password-scheme.c 2020-08-20 08:44:45 +0300 Aki Tuomi (13254b7a45) auth: mech-scram - Use correct data type for proof calculation Satisfies runtime analyzer M src/auth/mech-scram.c 2020-08-31 16:15:15 +0300 Aki Tuomi (faa0c21f21) lib: Remove istream-mmap.c Nothing uses it. M src/lib/Makefile.am D src/lib/istream-mmap.c M src/lib/istream.h 2020-08-31 10:33:05 +0300 Aki Tuomi (28d085f408) lib-ntlm: Ensure data_size is large enough for buffer M src/lib-ntlm/ntlm-message.c 2020-08-13 09:48:27 +0300 Aki Tuomi (371025a287) lib-ntlm: Use CONST_PTR_OFFSET M src/lib-ntlm/ntlm-message.c M src/lib-ntlm/ntlm.h 2020-08-13 09:46:37 +0300 Aki Tuomi (4a264f8f70) auth, lib-ntlm: Use dovecot byteorder functions M src/auth/mech-ntlm.c M src/lib-ntlm/Makefile.am D src/lib-ntlm/ntlm-byteorder.h M src/lib-ntlm/ntlm-message.c M src/lib-ntlm/ntlm.h 2020-08-11 09:00:17 +0300 Aki Tuomi (acba0e7c3d) lib: buffer - Assert that we don't try to allocate SIZE_MAX buffer Only if devel checks are enabled M src/lib/buffer.c 2020-08-11 08:45:37 +0300 Aki Tuomi (c2631470a7) lib-ssl-iostream: ostream-openssl - Allocate at most IO_BLOCK_SIZE initial buffer Otherwise we might attempt to allocate way too large buffers. This has not caused issues yet, except with max_buffer_size=SIZE_T, which has been causing us to allocate 0-sized buffers. M src/lib-ssl-iostream/ostream-openssl.c 2020-08-10 19:54:51 +0300 Aki Tuomi (ddf34a7a7c) auth: auth-cache - Data is not 4 bytes but variable sized M src/auth/auth-cache.c M src/auth/auth-cache.h 2020-08-13 11:41:23 +0300 Aki Tuomi (91c831378a) lib-otp: Use for-loop instead while Avoids unsigned integer wrap M src/lib-otp/otp-hash.c 2020-08-13 11:40:35 +0300 Aki Tuomi (6473c1a61f) lib-compression: istream-zstd - Handle signed/unsigned return values correctly M src/lib-compression/istream-zstd.c 2020-08-13 11:39:59 +0300 Aki Tuomi (20765bf476) lib: lib-event - Use for-loop in copying categories Avoids unsigned integer wrap M src/lib/lib-event.c 2020-08-19 13:55:18 +0300 Aki Tuomi (5c7b859710) global: Use i_rand_limit(limit) instead of i_rand() % limit spatch with coccinelle/random-misuse.cocci A coccinelle/random-misuse.cocci M src/director/director-test.c M src/lib-fts/test-fts-tokenizer.c M src/lib/test-array.c M src/lib/test-data-stack.c M src/lib/test-hash.c M src/lib/test-istream-crlf.c M src/lib/test-istream-multiplex.c M src/lib/test-multiplex.c M src/lib/test-ostream-multiplex.c M src/lib/test-seq-range-array.c 2020-08-19 14:01:50 +0300 Aki Tuomi (a8705c0a82) lib: Use i_rand_limit() helpers M src/lib/test-array.c M src/lib/test-base32.c M src/lib/test-base64.c M src/lib/test-buffer.c M src/lib/test-istream-base64-decoder.c 2020-08-19 14:00:03 +0300 Aki Tuomi (761f5d7796) lib: test-base32/64 - Use unsigned char Simplifies next change M src/lib/test-base32.c M src/lib/test-base64.c 2020-08-19 19:49:38 +0300 Aki Tuomi (5549aec84f) lib: Add some helpers for random values M src/lib/lib.h 2020-08-19 14:33:59 -0400 Josef 'Jeff' Sipek (bbdd5bb3b7) lib: Document how i_rand_limit() ensures uniform distribution This algorithm is not original, but it is dense enough that a detailed explanation is in order. M src/lib/rand.c 2020-08-13 11:35:17 +0300 Aki Tuomi (0589ced751) lib: rand - Fix random number bounding M src/lib/rand.c 2020-08-11 08:48:09 +0300 Aki Tuomi (6c21966242) auth: password-scheme - Use generate_salt in md5crypt Deduplicates code M src/auth/password-scheme.c 2020-08-23 23:24:35 +0300 Aki Tuomi (74598bd6d3) lib-sql: driver-cassandra - Add SSL options ssl_ca=: Sets trusted peer certificate filename ssl_cert=: Sets client certificate filename sl_key=: Sets client certificate private key filename ssl_key_password=: Sets password for private key ssl_verify=none | cert | cert-ip | cert-dns: Sets verify mode * none = don't verify * cert = verify certificate * cert-ip = verify IP from CN or SubjectAltName * cert-dns = verify hostname from CN or SubjectAltName M src/lib-sql/driver-cassandra.c 2020-08-23 23:05:33 +0300 Aki Tuomi (0429b4aaf5) lib: buffer - Add buffer_append_full_(file|istream) Consume istream or file up to max_read_size or EOF. M src/lib/Makefile.am A src/lib/buffer-istream.c M src/lib/buffer.h A src/lib/test-buffer-istream.c M src/lib/test-lib.inc 2020-08-23 22:24:07 +0300 Aki Tuomi (c25e20d658) m4: want_cassandra.m4 - Add check for CASS_SSL_VERIFY_PEER_IDENTITY_DNS M m4/want_cassandra.m4 2020-08-23 22:06:50 +0300 Aki Tuomi (5cf96c1e73) m4: want_cassandra.m4 - Add check for cass_cluster_set_use_hostname_resolution M m4/want_cassandra.m4 2020-08-23 22:06:34 +0300 Aki Tuomi (f4f08ac194) m4: Modernize want_cassandra.m4 M m4/want_cassandra.m4 2020-08-28 13:17:10 +0300 Aki Tuomi (8055e6bacd) lib-sql: driver-cassandra - Use INTx_MIN and INTx_MAX Preferred over magic numbers M src/lib-sql/driver-cassandra.c 2020-08-28 13:13:32 +0300 Aki Tuomi (e1c3224a48) lib-sql: Reformat driver-cassandra.c M src/lib-sql/driver-cassandra.c 2020-09-09 12:08:38 +0300 Timo Sirainen (60b4040ba4) lib-compression: Add unit test to compress large input This catches earlier zstd and lzma bugs. M src/lib-compression/test-compression.c 2020-09-09 13:00:44 +0300 Timo Sirainen (3d0f6cf3e0) lib-compression: ostream-lzma - Compressed output could have been truncated The compression wasn't fully finished, resulting in truncated compressed output that couldn't be fully read back. Reading would result in "Broken pipe" errors. Broken by 6080aa16e1bd50cd661acc31203d9f4986a9450a M src/lib-compression/ostream-lzma.c 2020-09-09 12:48:39 +0300 Timo Sirainen (d559f58767) lib-compression: istream-lzma - Improve error messages in EOF handling M src/lib-compression/istream-lzma.c 2020-09-09 12:46:51 +0300 Timo Sirainen (a775fe3d06) lib-compression: istream-lzma - Fix EOF handling lzma_stream_end() call was accidentally dropped by c6248b825d8c6562b1320e51ad0d88e99b9fbe85 This (probably) didn't result in visible problems. M src/lib-compression/istream-lzma.c 2020-09-08 21:19:21 +0300 Timo Sirainen (a96e742047) lib-compression: ostream-zstd - Fix assert-crash with large input If the input was large enough, the ostream write could have returned partially written output. Since this ostream-zstd was only used for blocking ostreams, this would always result in an assert-crash. Fix is to keep flushing the output to parent if the output buffer becomes full. Fixes: Panic: file ostream.c: line 287 (o_stream_sendv_int): assertion failed: (!stream->blocking) M src/lib-compression/ostream-zstd.c 2020-09-09 12:03:31 +0300 Timo Sirainen (48083d9e7f) lib: ostream-buffer: Return 0 as the used size, not the destination buffer size This allows using ostream-buffer in places that previously would think that the ostream buffer needed to be flushed because its buffer size was too large. This also changes o_stream_get_buffer_avail_size() to always return the ostream max buffer size. M src/lib/ostream-buffer.c M src/lib/test-ostream-buffer.c 2020-08-31 15:29:03 +0200 Stephan Bosch (2d9f3124da) lib-smtp: smtp-server-recipient - Recipient event should be using the transaction event as parent. The connection event is only used as event parent when the MAIL command failed in pipeline or when the recipient is destroyed prematurely. The log prefix of the transaction event is dropped, so that the connection event log prefix is used in either case. Therefore, the main visible effect of this commit is that the transaction event fields are available in the recipient event when there is a transaction, the log messages will not change. M src/lib-smtp/smtp-server-recipient.c 2020-08-31 14:10:18 +0200 Stephan Bosch (e0529aa325) lib-smtp: smtp-server-recipient - Don't create event until transaction becomes available. This way, the recipient event parent can be the transaction event once (and if) that becomes available. M src/lib-smtp/smtp-server-cmd-rcpt.c M src/lib-smtp/smtp-server-private.h M src/lib-smtp/smtp-server-recipient.c 2020-08-31 14:58:44 +0200 Stephan Bosch (55a8b332c0) lib-smtp: smtp-server-command - Always call the NEXT_TO_REPLY hook. Before, it wasn't called when a reply was submitted before the command became next to reply. M src/lib-smtp/smtp-server-cmd-mail.c M src/lib-smtp/smtp-server-cmd-rcpt.c M src/lib-smtp/smtp-server-command.c M src/lib-smtp/smtp-server-connection.c 2020-08-31 14:44:25 +0200 Stephan Bosch (1cae0ff5c8) lib-smtp: smtp-server-command - Move smtp_server_command_ready_to_reply(). New order makes more sense in the progression of command state. M src/lib-smtp/smtp-server-command.c 2020-09-02 11:15:33 +0200 Stephan Bosch (205b9fd9f4) lib: event-log - Fix handling dropping parent prefixes beyond a drop at a higher level. Before, the drop in the higher level became invisible to the lower hiererarchies. For example: parent1, parent2, parent3, parent4(drop one) yielded "parent1: parent2: parent4: " as a prefix (which is still OK), whereas parent1: parent2: parent3: parent4(drop one): leaf(drop 3) yielded "parent1: leaf: ", while the expected prefix would be: "leaf: ". This means that the drop of one prefix by parent4 is ignored. Instead it should apply that drop and operate on the prefixes that are still visible at the lowel level, so the number of prefixes dropped should be additive, which is what this commit changes. M src/lib/event-log.c M src/lib/test-event-log.c 2020-08-31 15:08:43 +0200 Stephan Bosch (fbd4baa150) lib-smtp: Reformat smtp-server-recipient.c. M src/lib-smtp/smtp-server-recipient.c 2020-08-31 14:40:16 +0200 Stephan Bosch (6848a98e52) lib-smtp: Reformat smtp-server-private.h. M src/lib-smtp/smtp-server-private.h 2020-08-31 14:37:35 +0200 Stephan Bosch (5cd3c75a8e) lib-smtp: Reformat smtp-server-connection.c. M src/lib-smtp/smtp-server-connection.c 2020-08-31 14:21:41 +0200 Stephan Bosch (4d7f258c93) lib-smtp: Reformat smtp-server-command.c. M src/lib-smtp/smtp-server-command.c 2020-08-31 14:16:31 +0200 Stephan Bosch (953c35eed3) lib-smtp: Reformat smtp-server-cmd-mail.c. M src/lib-smtp/smtp-server-cmd-mail.c 2020-08-31 14:13:31 +0200 Stephan Bosch (bb6edd5e63) lib-smtp: Reformat smtp-server-cmd-rcpt.c. M src/lib-smtp/smtp-server-cmd-rcpt.c 2020-09-07 10:56:34 +0300 Aki Tuomi (178bb676ea) lib-dict: dict_transaction_commit_async() - Never call callback immediately This could cause confusion for the callers. Although so far all the callers have handled it fine. Use this wrappers for all dict drivers, even if they support async commits themselves. This is because many of them were still calling the callback immediately on error handling. M src/lib-dict/dict-private.h M src/lib-dict/dict.c 2020-09-10 10:16:56 +0300 Timo Sirainen (54bc6c2d4e) lib: istream-try - Fix off-by-one check for min_buffer_full_size This mainly fixes random failures with the unit test. M src/lib/istream-try.c 2020-09-10 10:16:35 +0300 Timo Sirainen (7a16c2e06d) lib: test-istream-try - Fix test name M src/lib/test-istream-try.c 2020-09-08 17:32:32 +0300 Timo Sirainen (6d4c1a6506) lib: istream-try - Fix detecting istream when its input buffer is full The previous check didn't work when the stream's buffer_size was 0, which happened with istream-concat parent. Added also a unit test that tries to test for these kind of situations. It doesn't actually reproduce this specific bug, but it tests that the code paths works at least in the generic situation. M src/lib/istream-try.c M src/lib/istream-try.h M src/lib/test-istream-try.c M src/plugins/fs-compress/fs-compress.c 2020-09-08 20:14:09 +0300 Timo Sirainen (b1ca1ba084) lib-compression: Add COMPRESSION_HDR_MAX_SIZE macro Will be used by the next commit. M src/lib-compression/compression.h 2020-07-08 10:18:27 +0200 Markus Valentin (43131bf97f) quota: Add logging prefix once and remove it from loglines M src/plugins/quota/quota-storage.c M src/plugins/quota/quota.c 2020-07-07 14:39:22 +0200 Markus Valentin (f4ab672321) quota: Introduce per quota-backend events M src/plugins/quota/quota-count.c M src/plugins/quota/quota-dict.c M src/plugins/quota/quota-dirsize.c M src/plugins/quota/quota-fs.c M src/plugins/quota/quota-imapc.c M src/plugins/quota/quota-maildir.c M src/plugins/quota/quota-private.h M src/plugins/quota/quota.c 2019-10-31 19:27:15 +0200 Timo Sirainen (d9f9d08624) quota: Use event based logging M src/plugins/quota/quota-dict.c M src/plugins/quota/quota-fs.c M src/plugins/quota/quota-imapc.c M src/plugins/quota/quota-maildir.c M src/plugins/quota/quota-storage.c M src/plugins/quota/quota-util.c M src/plugins/quota/quota.c 2020-08-25 14:01:24 +0300 Aki Tuomi (25ed309c85) quota: Add event support M src/plugins/quota/quota-private.h M src/plugins/quota/quota.c 2020-08-31 18:30:18 +0300 Timo Sirainen (15ae4f8c63) lib-index: Fix cache being purged too often when it had unaccessed fields Cache was being purged when it had a field that was last accessed after mail_cache_unaccessed_field_drop but before 2*mail_cache_unaccessed_field_drop. This purging may not have even done anything. Use shared code now between the check in mail_cache_header_fields_read() and the actual purging in mail_cache_purge_check_field(). This way they can't become desynced again. M src/lib-index/mail-cache-fields.c M src/lib-index/mail-cache-private.h M src/lib-index/mail-cache-purge.c 2020-08-31 17:27:58 +0300 Timo Sirainen (c4a85ba0e4) lib-index: Use delayed purge reason for mail_cache_purge_* events M src/lib-index/mail-cache-purge.c M src/lib-index/mail-cache.h M src/lib-index/mail-index-sync.c 2020-08-31 17:25:54 +0300 Timo Sirainen (4dd52e0499) lib-index: Remember reason for delayed cache file purges M src/lib-index/mail-cache-fields.c M src/lib-index/mail-cache-private.h M src/lib-index/mail-cache-purge.c M src/lib-index/mail-cache.c M src/lib-index/mail-cache.h 2020-08-31 17:23:05 +0300 Timo Sirainen (bfd065af9e) lib-index: Fix file_size field in mail_cache_purge_finished event It used to be 32 always. M src/lib-index/mail-cache-purge.c 2020-08-26 18:39:22 +0300 Timo Sirainen (fe21413485) lib-index: Fix deadlock when expunging mails and adding lots of data to cache This practically happened only when dovecot.index.cache contents were lost and they were being re-filled while mails were also being expunged. Broken by 9efb99924d0b7de27ca83e373f2290f3dd5b22cf M src/lib-index/mail-cache-transaction.c 2020-08-28 17:16:03 +0300 Timo Sirainen (b3f95fbad7) zlib: Rename istreams from zlib(parent) to compress(parent) This clarifies it that the istream is a generic compression stream, not specifically zlib/gz. M src/plugins/zlib/zlib-plugin.c 2020-08-28 17:13:32 +0300 Timo Sirainen (154109921d) lib-compression: ostreams - Add asserts to clarify how buffer flushing works If the output buffer isn't fully sent, the flush function returns 0 early on, before setting flushed=TRUE. M src/lib-compression/ostream-bzlib.c M src/lib-compression/ostream-lzma.c M src/lib-compression/ostream-zlib.c M src/lib-compression/ostream-zstd.c 2020-08-28 16:57:57 +0300 Timo Sirainen (1e3f43e124) auth: Fix leaking memory if auth client disconnects with pending penalty delays * auth penalty lookup returns that auth_request needs a penalty delay * during the penalty timeout auth client disconnects * auth requests are freed, but auth_request_handler isn't unreferenced This resulted in memory leak, and after recent changes also logging warnings about event leaks. M src/auth/auth-request-handler.c M src/auth/auth-request-handler.h M src/auth/auth-request.c M src/auth/auth-request.h 2020-08-27 18:35:33 +0300 Timo Sirainen (01a112995f) lib-auth: Remove duplicate auth_client_connection.event It's already in auth_client_connection.conn.event. Just use it directly to avoid any confusion between them. M src/lib-auth/auth-client-connection.c M src/lib-auth/auth-client-private.h M src/lib-auth/auth-client-request.c 2020-08-27 17:28:38 +0300 Timo Sirainen (50a6a5c0db) auth: Fix compiling gssapi, bsdauth, sia, vpopmail Broken by 5ff7299c9d85b1bab0c7d53d9459dbb31a2bd9d6 M src/auth/mech-gssapi.c M src/auth/passdb-bsdauth.c M src/auth/passdb-sia.c M src/auth/passdb-vpopmail.c M src/auth/userdb-vpopmail.c 2020-08-20 00:24:52 +0200 Stephan Bosch (c2df8fa8ba) lib-http: test-http-client-errors - Add tests involving idle connections. Tests idle timeout and connection reuse. M src/lib-http/test-http-client-errors.c 2020-08-20 00:17:49 +0200 Stephan Bosch (ef4e71e5c2) lib-http: http-client-connection - Use http_client_connection_is_active() to check idle status. This makes the check shorter and easier to understand. M src/lib-http/http-client-connection.c 2020-08-12 22:30:35 +0200 Stephan Bosch (6f16b0d63e) lib-http: http-client-queue - Fix unsigned int arithmetic problem in http_client_queue_request_timeout_cmp(). M src/lib-http/http-client-queue.c 2020-08-13 19:31:30 +0200 Stephan Bosch (ba7357541e) lib-http: http-client-connection - Use timeout_add_short_to() for idle timeout. The idle timeout can be very short. M src/lib-http/http-client-connection.c 2020-08-12 21:33:08 +0200 Stephan Bosch (f9751e9b22) lib-http: http-client-connection - Make idle timeout calculation more robust. M src/lib-http/http-client-connection.c M src/lib-http/http-client-private.h 2020-08-12 22:24:22 +0200 Stephan Bosch (7e849b84ac) lib-http: http-client-connection - Explicitly handle an infinite connection limit for setting idle timeout. This can just use the maximum idle timeout directly. M src/lib-http/http-client-connection.c 2020-08-12 22:20:26 +0200 Stephan Bosch (32f0fc2b41) lib-http: http-client-connection - Deal with first idle connection separately for setting idle timeout. This can just use the maximum idle timeout directly. M src/lib-http/http-client-connection.c 2020-08-12 21:17:08 +0200 Stephan Bosch (2d49e42f9a) lib-http: http-client-connection - Improve overall logic in http_client_connection_start_idle_timeout(). Make clear that idle_count < max when it is used. M src/lib-http/http-client-connection.c 2020-08-12 18:00:45 +0200 Stephan Bosch (09acd5c1eb) lib-http: http-client-connection - Start idle state in a common function. Removes code duplication. M src/lib-http/http-client-connection.c 2020-08-12 20:35:46 +0200 Stephan Bosch (6ea3dc6f41) lib-http: http-client-connection - Handle infinite idle timeout consistently. M src/lib-http/http-client-connection.c 2020-08-12 20:11:01 +0200 Stephan Bosch (8255f15bfc) lib-http: http-client-connection - Start idle timeout in a common function. M src/lib-http/http-client-connection.c 2020-08-12 19:54:50 +0200 Stephan Bosch (dda4e8d8a5) lib-http: http-client-connection - Use separate flag for idle status. It used the presence of the idle timeout before, which isn't acceptable when the timeout is changed to be optional (happens in later commit). M src/lib-http/http-client-connection.c M src/lib-http/http-client-private.h 2020-08-12 17:16:12 +0200 Stephan Bosch (d1d65664bf) lib-http: http-client-connection - Determine idle timeout consistently. It should not matter whether connection got idle due to lost peer or otherwise. M src/lib-http/http-client-connection.c 2020-08-12 17:10:20 +0200 Stephan Bosch (9ead85be5b) lib-http: http-client-connection - Restructure http_client_connection_check_idle(). M src/lib-http/http-client-connection.c 2020-08-12 17:06:23 +0200 Stephan Bosch (60bd3475f6) lib-http: http-client-connection - Restructure http_client_connection_lost_peer(). M src/lib-http/http-client-connection.c 2020-08-12 21:47:39 +0200 Stephan Bosch (50814cc74f) lib-http: http-client-peer - Properly saturate result of http_client_peer_shared_max_connections() at UINT_MAX. M src/lib-http/http-client-peer.c 2020-08-12 18:27:48 +0200 Stephan Bosch (ecaf195beb) lib-http: Reformat http-client-connection.c. M src/lib-http/http-client-connection.c 2018-03-20 20:59:07 +0100 Stephan Bosch (111b0d3063) lib-http: Reformat http-client-private.h. M src/lib-http/http-client-private.h 2018-03-20 20:59:21 +0100 Stephan Bosch (9b0f648c58) lib-http: Reformat http-client-queue.c. M src/lib-http/http-client-queue.c 2018-03-20 20:58:56 +0100 Stephan Bosch (4dd39dc63d) lib-http: Reformat http-client-peer.c. M src/lib-http/http-client-peer.c 2020-08-10 14:43:11 +0300 Aki Tuomi (a88b78fa5a) lib-auth: Do not send ssl details to auth process They are not used for anything. But we still provide them as auth_client event fields, so that we can e.g. do metrics on which TLS protocol is used. M src/lib-auth/auth-client-request.c 2020-08-10 10:56:14 +0300 Aki Tuomi (b2511e8d6b) lib-auth: Add user_mask to auth_userdb_list events M src/lib-auth/auth-master.c 2020-08-10 10:23:19 +0300 Aki Tuomi (4e3ae6fab7) lib-auth: Add new fields to auth_client_userdb events M src/lib-auth/auth-master.c 2020-08-10 09:29:10 +0300 Aki Tuomi (395ef5b35c) doveadm: doveadm-auth - Add support for real_{remote|local}_{ip|port} -x parameters M src/doveadm/doveadm-auth.c 2020-08-10 09:11:41 +0300 Aki Tuomi (d4a70a35ee) doveadm: doveadm-auth - Add session and local_name -x parameters M src/doveadm/doveadm-auth.c 2020-08-10 09:10:08 +0300 Aki Tuomi (6c5b749390) lib-auth: Add session_id and local_name to master auth M src/lib-auth/auth-master.c M src/lib-auth/auth-master.h 2020-08-06 10:52:18 +0300 Aki Tuomi (f02877312e) lmtp: Rename orig_user event field to original_user M src/lmtp/lmtp-proxy.c 2020-07-27 09:11:47 +0300 Aki Tuomi (d1aaeab138) lib-auth: Add more fields to auth client event This way it becomes more useful M src/lib-auth/auth-client-request.c 2020-07-27 12:26:49 +0300 Aki Tuomi (36de1858d0) lib-auth: Always iterate input arguments Makes next change easier M src/lib-auth/auth-client-request.c 2020-07-27 08:48:49 +0300 Aki Tuomi (0e3468f07e) lib-auth: Send event after setting all fields M src/lib-auth/auth-client-request.c 2020-08-06 19:38:33 +0300 Timo Sirainen (d602274721) man: doveadm-auth - List more -x fields M doc/man/doveadm-auth.1.in 2020-08-06 14:13:29 +0300 Timo Sirainen (570ad473dd) auth: Add some unit testing for auth_request_import/export() M src/auth/Makefile.am A src/auth/test-auth-request-fields.c M src/auth/test-auth.h M src/auth/test-main.c 2020-08-06 14:10:50 +0300 Timo Sirainen (4d46d3e5cf) auth: Escape exported session ID string in protocol replies Session ID is normally coming only from trusted sources, so the lack of escaping shouldn't have mattered too much. M src/auth/auth-request-fields.c 2020-08-05 22:48:40 +0300 Timo Sirainen (3edbefb705) auth: Worker commands: Rename "id" event field to "command_id" Now that auth_request events are inherited from worker command events, the "id" field was also inherited. This is rather confusing and might conflict with other IDs in the future, so better to rename it already. M src/auth/auth-worker-client.c 2020-08-05 22:45:30 +0300 Timo Sirainen (e53e98204d) auth: Support inheritance for master auth_requests' events Requests created by auth worker will inherit from the command's event, while other events inherit from the global auth_event for now (since auth-master-connection doesn't have its own event yet). M src/auth/auth-master-connection.c M src/auth/auth-request.c M src/auth/auth-request.h M src/auth/auth-worker-client.c M src/auth/test-lua.c 2020-08-05 22:43:55 +0300 Timo Sirainen (95f89e9048) auth: Inherit auth client connection event from the global auth_event M src/auth/auth-client-connection.c 2020-06-25 20:03:57 +0300 Timo Sirainen (b06d4c7309) doveadm auth: Support forward and extra fields with -x parameter Using "forward_" prefix assumes that it's a forwarded field. Otherwise all unknown parameters are assumed to be extra fields. M src/doveadm/doveadm-auth.c 2020-08-05 22:25:12 +0300 Timo Sirainen (1d5bbaf127) lib-auth: auth-client - Support sending extra_fields. M src/lib-auth/auth-client-request.c M src/lib-auth/auth-client.h 2020-05-28 23:10:41 +0200 Stephan Bosch (4ac4b3b5d2) lib-auth: auth-master - Support sending extra_fields. M src/lib-auth/auth-master.c M src/lib-auth/auth-master.h 2020-08-04 17:35:30 +0300 Timo Sirainen (29371f227e) auth: Add more event fields M src/auth/auth-request-fields.c 2020-08-04 17:34:42 +0300 Timo Sirainen (b0fb82bb67) auth: Set event fields immediately when they're changed in auth_request_fields This way the fields are available for all auth events, not just the final events. M src/auth/auth-request-fields.c M src/auth/auth-request.c 2020-08-06 12:29:07 +0300 Timo Sirainen (6c0fb43324) auth: Remove "username" and "domain" event fields They're not very useful in event fields, since event filtering can just do user=username@* or user=*@domain. M src/auth/auth-request.c 2020-08-04 17:30:02 +0300 Timo Sirainen (8499ff49e6) auth: Remove "credentials_scheme" event field This field wasn't set for plaintext authentication, and in general it's not quite what it was intended to be. Better to remove it entirely to avoid confusion. M src/auth/auth-request.c 2020-08-04 17:29:32 +0300 Timo Sirainen (764265bfdf) auth: Rename auth_request.credentials_scheme to wanted_credentials_scheme Also add comments explaining what it actually does. M src/auth/auth-request.c M src/auth/auth-request.h M src/auth/auth-worker-client.c M src/auth/db-checkpassword.c M src/auth/passdb-blocking.c M src/auth/passdb-checkpassword.c M src/auth/passdb-dict.c M src/auth/passdb-ldap.c M src/auth/passdb-sql.c M src/auth/passdb.c 2020-08-04 16:46:15 +0300 Timo Sirainen (6619fbab6f) auth: Rename "orig_user" event field to "original_user" It's a bit more understandable to use the full name. There's now also %{original_user} variable alias. M src/auth/auth-request.c 2020-08-04 16:30:59 +0300 Timo Sirainen (3822c3e6e3) auth: Rename "mech" event field to "mechanism" It's a bit more understandable to use the full name. There's now also %{mechanism} variable alias. M src/auth/auth-request-fields.c 2020-08-03 18:51:33 +0300 Timo Sirainen (97749d387f) auth: Keep auth_request_fields const for most of the code This way there's a compiler warning/error if anything outside auth-request-fields.c attempts to modify them. It makes it easier to keep the values synced with events. M src/auth/auth-request-fields.c M src/auth/auth-request.h M src/auth/test-auth.h 2020-08-04 16:16:18 +0300 Timo Sirainen (8c698ff01e) auth: test-mech - Fix include ordering Required by the following change. M src/auth/test-mech.c 2020-08-04 14:48:23 +0300 Timo Sirainen (4d724f877b) auth: Add and use auth_request_set_delayed_credentials() M src/auth/auth-request-fields.c M src/auth/auth-request.c M src/auth/auth-request.h 2020-08-04 14:44:00 +0300 Timo Sirainen (8f86c02d64) auth: Add and use auth_request_set_login_username_forced() M src/auth/auth-request-fields.c M src/auth/auth-request.c M src/auth/auth-request.h 2020-08-04 14:28:28 +0300 Timo Sirainen (39c4197b30) auth: LIST - Use auth_request_import() to set missing "service" M src/auth/auth-master-connection.c 2020-08-04 14:26:08 +0300 Timo Sirainen (c5a72becc6) auth: Use auth_request_init_userdb_reply() always for initializing userdb_reply M src/auth/auth-request-fields.c M src/auth/auth-request.c 2020-08-04 14:23:18 +0300 Timo Sirainen (e04efc5cbf) auth: auth_request_init_userdb_reply() - Add add_default_fields parameter M src/auth/auth-request-fields.c M src/auth/auth-request.c M src/auth/auth-request.h M src/auth/auth-worker-client.c 2020-08-04 14:22:16 +0300 Timo Sirainen (544781e8d4) auth: Move auth_request_init_userdb_reply() to auth-request-fields.c M src/auth/auth-request-fields.c M src/auth/auth-request.c 2020-08-04 12:42:22 +0300 Timo Sirainen (1797aaf874) auth: Add and use auth_request_set_password_verified() M src/auth/auth-request-fields.c M src/auth/auth-request.c M src/auth/auth-request.h 2020-08-04 12:32:27 +0300 Timo Sirainen (4dc7edd911) auth: Add and use auth_request_set_auth_successful() M src/auth/auth-request-fields.c M src/auth/auth-request.c M src/auth/auth-request.h 2020-08-03 17:32:34 +0300 Timo Sirainen (deaba55862) auth: Add and use auth_request_set_realm() M src/auth/auth-request-fields.c M src/auth/auth-request.h M src/auth/mech-digest-md5.c 2020-08-03 17:25:59 +0300 Timo Sirainen (854ffb49fd) auth: Add and use auth_request_set_username_forced() M src/auth/auth-master-connection.c M src/auth/auth-request-fields.c M src/auth/auth-request.c M src/auth/auth-request.h M src/auth/mech-anonymous.c M src/auth/userdb-blocking.c 2020-08-04 14:41:42 +0300 Timo Sirainen (cb06a8f19c) auth: Change auth_request_fix_username() to return int M src/auth/auth-request-fields.c 2020-08-04 14:35:49 +0300 Timo Sirainen (5f5256311a) auth: Optimize memory usage when auth_username_format is set The per-request memory pool was used unnecessarily to allocate the username before the formatting was applied. M src/auth/auth-request-fields.c 2020-08-03 17:16:12 +0300 Timo Sirainen (6bf74fbc35) auth: Move auth_request_fields initialization code to auth_request_fields_init() M src/auth/auth-request-fields.c M src/auth/auth-request.c M src/auth/auth-request.h 2020-08-03 17:11:14 +0300 Timo Sirainen (51623b9e9e) auth: Move auth_request_master_lookup_finish() to auth-request-fields.c Also rename it to auth_request_master_user_login_finish(). M src/auth/auth-request-fields.c M src/auth/auth-request.c M src/auth/auth-request.h 2020-08-03 17:07:22 +0300 Timo Sirainen (007deed21f) auth: Move username changing functions to auth-request-fields.c M src/auth/auth-request-fields.c M src/auth/auth-request.c 2020-08-03 17:06:23 +0300 Timo Sirainen (f469acfcd2) auth: Change auth_request_get_log_prefix_db() to be public M src/auth/auth-request.c M src/auth/auth-request.h 2020-08-03 16:49:00 +0300 Timo Sirainen (1c7ea685e6) auth: test-lua - Use auth_request_set_username() Instead of changing the user directly. M src/auth/test-lua.c 2020-08-03 16:43:56 +0300 Timo Sirainen (8841d1b2a8) auth: test-lua - Deduplicate code into test_db_lua_auth_request_new() M src/auth/test-lua.c 2020-08-03 16:28:57 +0300 Timo Sirainen (6e07479735) auth: auth_request_fix_username() - Don't temporarily modify auth_request_fields.user Use the new username parameter in auth_request_get_var_expand_table_full() instead. M src/auth/auth-request.c 2020-08-03 16:26:11 +0300 Timo Sirainen (e743e0b02b) auth: auth_cache_insert() - Don't temporarily modify auth_request_fields.user Use the new username parameter in auth_request_get_var_expand_table_full() instead. M src/auth/auth-cache.c M src/auth/test-auth-cache.c 2020-08-03 16:18:00 +0300 Timo Sirainen (aa21999180) auth: auth_request_get_var_expand_table_full() - Add username parameter M src/auth/auth-policy.c M src/auth/auth-request-var-expand.c M src/auth/auth-request-var-expand.h M src/auth/db-ldap.c M src/auth/db-oauth2.c 2020-08-04 16:45:19 +0300 Timo Sirainen (2522e957e1) auth: Add %{original_*} aliases for %{orig_*} M src/auth/auth-request-var-expand.c M src/auth/auth-request-var-expand.h 2020-08-04 16:19:29 +0300 Timo Sirainen (bff8b10007) auth: Add %{mechanism} alias for %{mech} M src/auth/auth-request-var-expand.c M src/auth/auth-request-var-expand.h 2020-04-27 16:43:39 +0300 Timo Sirainen (bb2a9ba49a) auth: Add %{[real_]local/remote_ip/port} aliases for %{[real_]lip/rip/lport/rport) M src/auth/auth-request-var-expand.c M src/auth/auth-request-var-expand.h M src/auth/test-auth-request-var-expand.c 2020-08-03 15:10:35 +0300 Timo Sirainen (c5d940f758) auth: Move auth_request_export/import*() to auth-request-fields.c M src/auth/Makefile.am A src/auth/auth-request-fields.c M src/auth/auth-request.c 2020-08-03 14:56:12 +0300 Timo Sirainen (5ff7299c9d) auth: Move imported/exported fields to struct auth_request_fields This makes it clearer what fields are being passed between auth master and worker processes. M src/auth/auth-cache.c M src/auth/auth-master-connection.c M src/auth/auth-penalty.c M src/auth/auth-policy.c M src/auth/auth-request-handler.c M src/auth/auth-request-stats.c M src/auth/auth-request-var-expand.c M src/auth/auth-request.c M src/auth/auth-request.h M src/auth/auth-worker-client.c M src/auth/db-checkpassword.c M src/auth/db-lua.c M src/auth/db-oauth2.c M src/auth/mech-anonymous.c M src/auth/mech-digest-md5.c M src/auth/mech-dovecot-token.c M src/auth/mech-external.c M src/auth/mech-login.c M src/auth/mech-ntlm.c M src/auth/mech-otp-skey-common.c M src/auth/mech-otp.c M src/auth/mech-rpa.c M src/auth/mech-skey.c M src/auth/passdb-blocking.c M src/auth/passdb-cache.c M src/auth/passdb-dict.c M src/auth/passdb-ldap.c M src/auth/passdb-lua.c M src/auth/passdb-pam.c M src/auth/passdb-passwd.c M src/auth/passdb-shadow.c M src/auth/passdb-sql.c M src/auth/passdb-static.c M src/auth/passdb.c M src/auth/test-auth-request-var-expand.c M src/auth/test-lua.c M src/auth/test-mech.c M src/auth/userdb-blocking.c M src/auth/userdb-passwd.c M src/auth/userdb-static.c 2020-08-03 14:31:30 +0300 Timo Sirainen (9743153243) auth: Remove auth_request->debug Use event_want_debug(auth_request->event) instead. M src/auth/auth-request.c M src/auth/auth-request.h M src/auth/db-ldap.c M src/auth/passdb-imap.c M src/auth/test-lua.c 2020-08-03 14:29:55 +0300 Timo Sirainen (5110ff330c) auth: Remove unnecessary auth_request->debug checks e_debug() already checks whether debug logging is enabled. M src/auth/db-lua.c 2020-04-26 20:15:39 +0300 Timo Sirainen (6ef8c6324d) lib: events - Use const event pointer for "get" functions M src/lib/lib-event.c M src/lib/lib-event.h 2020-08-24 15:00:39 +0300 Timo Sirainen (cb875b83a8) lib-storage: mail_user_init_fs_settings() - Use user's event as fs parent event M src/lib-storage/mail-user.c 2020-08-13 19:13:49 +0300 Aki Tuomi (68817df1ef) auth: test-mech - Fix type mismatch M src/auth/test-mech.c 2020-08-13 19:13:04 +0300 Aki Tuomi (a744f28294) auth: test-mech - Fix APOP challenge format M src/auth/test-mech.c 2020-08-17 18:06:14 +0200 Stephan Bosch (4e264dad2f) submission: submission-backend-relay - Handle relay server replies consistently. Initial connection setup errors were handled differently when the reply came into the ready callback first. M src/submission/submission-backend-relay.c 2018-07-12 00:15:23 +0200 Stephan Bosch (a0a7d59e6a) lib-smtp: test-smtp-client-errors - Add test for server presenting invalid SSL certificate. M src/lib-smtp/Makefile.am M src/lib-smtp/test-smtp-client-errors.c 2018-07-14 13:16:05 +0200 Stephan Bosch (4032347467) lib-smtp: smtp-client-connection - If SSL connection gets lost, log the last SSL error. M src/lib-smtp/smtp-client-connection.c 2018-07-12 00:15:31 +0200 Stephan Bosch (d5c5dffdf9) lib-smtp: smtp-client-connection - Handle connection loss uniformly at a single location. Also amend the logged error message with SSL information when relevant. M src/lib-smtp/smtp-client-connection.c 2018-07-14 12:19:07 +0200 Stephan Bosch (58ace7aaaf) lib-smtp: smtp-client-connection - Properly log SSL handshake failure occuring during input read as an error. M src/lib-smtp/smtp-client-connection.c 2018-07-14 11:35:20 +0200 Stephan Bosch (a9849c479b) lib-smtp: smtp-client-connection - Restructure handling of immediate connection failure. The delayed error callback is now started at a single location, much like lib-http/client deals with this situation. M src/lib-smtp/smtp-client-connection.c M src/lib-smtp/smtp-client-private.h 2020-05-04 17:21:23 +0300 Timo Sirainen (db253d7e8e) master: Make sure a listener isn't added to a throttled service This fixes master process using 100% CPU in some situations when a service is being throttled. M src/master/service-monitor.c 2020-08-16 10:57:36 +0100 Paul G. Banks (fea1bacab9) auth: mech-gssapi - GSSAPI can contain NUL. M src/auth/mech-gssapi.c 2020-08-17 19:16:01 +0300 Timo Sirainen (6ab580a6e5) imap: Add "mailbox" field to successful imap_client_unhibernated event M src/imap/imap-master-client.c 2020-08-17 19:10:35 +0300 Timo Sirainen (ef60e26343) imap-hibernate: Add "mailbox" field to events M src/imap-hibernate/imap-client.c M src/imap-hibernate/imap-client.h M src/imap-hibernate/imap-hibernate-client.c M src/imap/imap-client-hibernate.c 2020-08-17 15:33:23 +0300 Timo Sirainen (8fac1bccc1) imap, imap-hibernate: Track how long hibernation lasted M src/imap-hibernate/imap-client.c M src/imap/imap-master-client.c 2020-08-17 15:39:19 +0300 Timo Sirainen (7c90fb0723) imap-hibernate: Add imap_client_unhibernate_retried event M src/imap-hibernate/imap-client.c 2020-08-17 14:03:53 +0300 Timo Sirainen (be68c85357) imap-hibernate: Add imap_client_unhibernated event for errors Successful unhibernation is logged by imap process. M src/imap-hibernate/imap-client.c 2020-08-17 13:55:18 +0300 Timo Sirainen (faaaf06e4f) imap-hibernate: Handle unhibernation errors more consistently. Log an error with the exact reason, and just log "Failed to unhibernate client" as the info-level disconnect reason. M src/imap-hibernate/imap-client.c 2020-08-17 13:53:50 +0300 Timo Sirainen (6adcb79448) imap-hibernate: Fix error handling when unhibernation retry timeout is reached An error message wasn't logged, and a wrong kind of message was logged in the info line. M src/imap-hibernate/imap-client.c 2020-08-17 13:53:28 +0300 Timo Sirainen (cf69e30178) imap-hibernate: Split off imap_move_has_reached_timeout() M src/imap-hibernate/imap-client.c 2020-08-17 15:06:42 +0300 Timo Sirainen (0ea836c9b0) imap: Add imap_client_unhibernated event M src/imap/imap-master-client.c 2020-08-17 14:48:01 +0300 Timo Sirainen (9e44878321) imap: Send unhibernation OK reply to imap-hibernate only after creating client The following commit adds unhibernation event, which would be much more difficult to implement for this error path without this change. The OK reply is still sent before client_create_finish(), which is the part that could be slow. M src/imap/imap-master-client.c 2020-08-17 14:55:55 +0300 Timo Sirainen (9df45f5df8) imap: Set unhibernation IDLE state earlier This simplifies the following changes. M src/imap/imap-master-client.c 2020-08-17 13:34:35 +0300 Timo Sirainen (36a255bb93) imap: Add imap_client_hibernated event M src/imap/imap-client-hibernate.c 2020-08-17 13:08:50 +0300 Timo Sirainen (f8a13f869a) imap-hibernate: Log via imap_client.event or connection.event M src/imap-hibernate/imap-client.c M src/imap-hibernate/imap-hibernate-client.c M src/imap-hibernate/imap-master-connection.c 2020-08-17 13:08:19 +0300 Timo Sirainen (481e29adea) imap-hibernate: Add imap_client.event M src/imap-hibernate/imap-client.c 2020-08-17 13:07:49 +0300 Timo Sirainen (0665e883e3) imap-hibernate: Preserve local_port and remote_port during hibernation M src/imap-hibernate/imap-client.c M src/imap-hibernate/imap-client.h M src/imap-hibernate/imap-hibernate-client.c M src/imap/imap-client-hibernate.c M src/imap/imap-master-client.c 2020-08-17 12:47:53 +0300 Timo Sirainen (30098f130d) imap: Log ID and logout info lines via imap_client.event This doesn't change the logging output at all. M src/imap/cmd-id.c M src/imap/imap-client.c 2020-08-17 12:45:08 +0300 Timo Sirainen (12d740b891) imap: Log imap-master errors/debugs via connection.event M src/imap/imap-master-client.c 2020-08-17 12:43:12 +0300 Timo Sirainen (8482b886ea) imap: Log errors via imap_client.event when possible M src/imap/cmd-getmetadata.c M src/imap/cmd-urlfetch.c M src/imap/imap-client-hibernate.c M src/imap/imap-client.c M src/imap/imap-master-client.c M src/imap/main.c 2020-08-17 13:28:58 +0300 Timo Sirainen (218eaa07c9) imap: imap_hibernate_process_send() - Return error instead of logging it M src/imap/imap-client-hibernate.c 2020-08-17 15:28:00 +0300 Timo Sirainen (b4b3b41989) lib: Add str_to_timeval() M src/lib/test-time-util.c M src/lib/time-util.c M src/lib/time-util.h 2020-08-20 16:17:48 +0300 Timo Sirainen (ea91edd058) director: Use director_connection.event wherever possible This adds the "director(name): " log prefix to many log messages where it didn't previously exist. The director name is now sometimes duplicated in the log messages, but maybe that's good for clarity. M src/director/director-connection.c 2020-08-20 16:11:56 +0300 Timo Sirainen (4b7d51bfd0) director: Avoid explicit log prefixes by logging via director_connection.event M src/director/director-connection.c 2020-08-20 16:07:00 +0300 Timo Sirainen (716aab1678) director: Add director_connection.event M src/director/director-connection.c 2020-08-20 16:05:23 +0300 Timo Sirainen (057b8620d7) director: Add director_connection_set_name() change connection name M src/director/director-connection.c 2019-10-31 19:15:22 +0200 Timo Sirainen (b47636b619) director: Replace most of the i_error() logging with e_error() M src/director/auth-connection.c M src/director/director-connection.c M src/director/director.c M src/director/doveadm-connection.c M src/director/login-connection.c M src/director/mail-host.c M src/director/notify-connection.c 2019-10-31 19:10:22 +0200 Timo Sirainen (2795b4f95e) director: Replace i_warning() and i_info() logging with e_*() M src/director/director-connection.c M src/director/director-request.c M src/director/director.c M src/director/doveadm-connection.c M src/director/mail-host.c M src/director/main.c M src/director/notify-connection.c M src/director/user-directory.c 2019-10-31 19:17:28 +0200 Timo Sirainen (5e6d04c952) director: Add auth_connection.dir M src/director/auth-connection.c M src/director/auth-connection.h M src/director/main.c 2019-10-31 19:09:35 +0200 Timo Sirainen (c9b8061af6) director: Add user_directory.director M src/director/mail-host.c M src/director/test-user-directory.c M src/director/user-directory.c M src/director/user-directory.h 2019-10-31 19:06:46 +0200 Timo Sirainen (5107e7f89c) director: Add mail_host_list.dir M src/director/director.c M src/director/doveadm-connection.c M src/director/mail-host.c M src/director/mail-host.h 2019-10-31 19:00:57 +0200 Timo Sirainen (9da9aa4cf4) director: Remove dir_debug() and director_debug M src/director/director.c M src/director/director.h M src/director/main.c 2019-10-31 18:59:57 +0200 Timo Sirainen (d861dab090) director: director-request: Add event and replace dir_debug() with e_debug() M src/director/director-request.c 2019-10-31 18:56:56 +0200 Timo Sirainen (7e4f1966bf) director: Replace most of the dir_debug() with e_debug() M src/director/director-connection.c M src/director/director.c 2019-10-31 18:49:59 +0200 Timo Sirainen (97af941652) director: Add struct director.event M src/director/director.c M src/director/director.h M src/director/main.c 2018-11-07 16:51:49 -0800 Rosen Penev (5d88510b30) lib: Fix compilation with OpenSSL deprecated APIs disabled OpenSSL with no deprecated APIs does not implicitly include header files. M src/lib-dcrypt/dcrypt-openssl.c M src/lib-ssl-iostream/iostream-openssl-context.c 2020-08-07 11:11:21 -0400 Josef 'Jeff' Sipek (8b2455fe5e) lib: Always use the representative when comparing event's categories We need to be consistent about using the representative category pointer. Otherwise, we may end up with duplicates in an event's categories array. Since an event's categories are conceptually a set, it is reasonable to write event using code that assumes no duplicates. If duplicates are present, it may lead to incorrect behavior or even crashes. M src/lib/lib-event.c 2020-08-14 10:25:33 -0400 Josef 'Jeff' Sipek (942e4a1b58) lib: event-filter-parser - Use str_begins() to compare unit test error strings Different versions of bison generate slightly different error strings, but they always begin the same way. So, instead of comparing them let's only compare the beginning. M src/lib/test-event-filter-parser.c 2020-08-14 09:26:12 -0400 Josef 'Jeff' Sipek (320a207cc5) lib: event-filter-parser - YYERROR_VERBOSE has been deprecated since 2003 The proper way to enable verbose error messages is to use the parse.error define. M src/lib/event-filter-parser.y 2020-08-14 00:36:19 +0300 Timo Sirainen (92d767268c) lib: Add unit test for long log line splitting M src/lib/test-failures.c 2020-08-13 22:49:43 +0300 Timo Sirainen (e02f24ac33) lib-index: Remove log prefix from cache events Index events don't have a prefix either. The parent event likely already contains the mailbox name, which should be enough. It's especially bad using the full filesystem path in the event prefix, because it could be very long. M src/lib-index/mail-cache.c 2020-08-13 22:47:02 +0300 Timo Sirainen (984e3d03b6) global: Make sure event log prefixes are sanitized and not excessively long It doesn't make sense to allow log prefixes to grow to kilobytes long, especially from user-given input. M src/lib-http/http-client-queue.c M src/lib-http/http-client-request.c M src/lib-http/http-server-request.c M src/lib-http/http-server-resource.c M src/lib-smtp/smtp-client-command.c M src/lib-smtp/smtp-client-transaction.c M src/lib-smtp/smtp-server-recipient.c M src/lib-storage/fail-mailbox.c M src/lib-storage/index/index-storage.c 2020-08-13 22:18:41 +0300 Timo Sirainen (812fab2981) lib: Fix sending log lines when prefix is larger than PIPE_BUF This caused the log line to be sent repeatedly to the log process, possibly causing hundreds of duplicate log lines. M src/lib/failures.c 2020-08-13 22:08:48 +0300 Timo Sirainen (172e23fecb) log: log_connection_handshake() - Handle i_stream_read()'s -2 return value properly Although this shouldn't happen anymore after the previous change. M src/log/log-connection.c 2020-08-13 19:26:23 +0300 Timo Sirainen (884b5c012c) log: Fix busy loop when a long line is logged If the line exceeded PIPE_MAX (4 kB usually), the process got into a busy loop. It would still break out of it every 100ms and maybe handle some other services' logging, but the service that logged the long line would be stuck. This resulted in all those service processes also hanging because they were waiting to be able to write to log. M src/log/log-connection.c 2020-05-18 13:08:45 +0300 Aki Tuomi (199686daf5) auth: test-mech - Add tests for RPA and NTLM bug M src/auth/test-mech.c 2020-05-18 12:33:39 +0300 Aki Tuomi (fb246611e6) lib-ntlm: Check buffer length on responses Add missing check for buffer length. If this is not checked, it is possible to send message which causes read past buffer bug. Broken in c7480644202e5451fbed448508ea29a25cffc99c M src/lib-ntlm/ntlm-message.c 2020-05-06 13:40:36 +0300 Aki Tuomi (69ad3c902e) auth: mech-rpa - Fail on zero len buffer M src/auth/mech-rpa.c 2020-07-02 17:31:19 +0300 Timo Sirainen (19193f40b1) lib-mail: Fix handling trailing "--" in MIME boundaries Broken by 5b8ec27fae941d06516c30476dcf4820c6d200ab M src/lib-mail/message-parser.c M src/lib-mail/test-message-parser.c 2020-04-23 17:09:33 +0300 Timo Sirainen (be53a118e7) lib-mail: message-parser - Support limiting max number of MIME parts The default is to allow 10000 MIME parts. When it's reached, no more MIME boundary lines will be recognized, so the rest of the mail belongs to the last added MIME part. M src/lib-mail/message-parser-private.h M src/lib-mail/message-parser.c M src/lib-mail/message-parser.h M src/lib-mail/test-message-parser.c 2020-04-23 16:59:40 +0300 Timo Sirainen (7868f5f49b) lib-mail: message-parser - Support limiting max number of nested MIME parts The default is to allow 100 nested MIME parts. When the limit is reached, the innermost MIME part's body contains all the rest of the inner bodies until a parent MIME part is reached. M src/lib-mail/message-parser-private.h M src/lib-mail/message-parser.c M src/lib-mail/message-parser.h M src/lib-mail/test-message-parser.c 2020-04-23 16:50:56 +0300 Timo Sirainen (0f46088a1a) lib-mail, global: message_parser_init*() - Convert flags to settings structure M src/doveadm/doveadm-mail-fetch.c M src/lib-imap/test-imap-bodystructure.c M src/lib-imap/test-imap-envelope.c M src/lib-mail/istream-attachment-extractor.c M src/lib-mail/istream-binary-converter.c M src/lib-mail/message-parser-from-parts.c M src/lib-mail/message-parser-private.h M src/lib-mail/message-parser.c M src/lib-mail/message-parser.h M src/lib-mail/message-search.c M src/lib-mail/message-snippet.c M src/lib-mail/test-message-decoder.c M src/lib-mail/test-message-parser.c M src/lib-mail/test-message-part.c M src/lib-storage/index/index-mail-headers.c M src/plugins/fts/fts-build-mail.c 2020-04-23 15:00:57 +0300 Timo Sirainen (a676cb539f) lib-mail: message-parser - Don't use memory pool for parser This reduces memory usage when parsing many MIME parts where boundaries are being added and removed constantly. M src/lib-mail/message-parser-private.h M src/lib-mail/message-parser.c 2020-04-23 14:53:27 +0300 Timo Sirainen (a175d654c3) lib-mail: message-parser - Add boundary_remove_until() helper function M src/lib-mail/message-parser.c 2020-04-23 13:06:02 +0300 Timo Sirainen (8dbc754a31) lib-mail: message-parser - Optimize boundary lookups when exact boundary is found When an exact boundary is found, there's no need to continue looking for more boundaries. M src/lib-mail/message-parser.c 2020-04-23 12:53:12 +0300 Timo Sirainen (729941c996) lib-mail: message-parser - Truncate excessively long MIME boundaries RFC 2046 requires that the boundaries are a maximum of 70 characters (excluding the "--" prefix and suffix). We allow 80 characters for a bit of extra safety. Anything longer than that is truncated and treated the same as if it was just 80 characters. M src/lib-mail/message-parser-private.h M src/lib-mail/message-parser.c M src/lib-mail/test-message-parser.c 2020-04-23 12:10:07 +0300 Timo Sirainen (02c7c6dbb5) lib-mail: message-parser - Minor code cleanup to finding the end of boundary line M src/lib-mail/message-parser.c 2020-04-23 12:00:38 +0300 Timo Sirainen (24f0bfefdb) lib-mail: message-parser - Optimize appending new part to linked list M src/lib-mail/message-parser-private.h M src/lib-mail/message-parser.c 2020-04-23 11:36:48 +0300 Timo Sirainen (5ecadd3074) lib-mail: message-parser - Optimize updating children_count M src/lib-mail/message-parser.c 2020-04-23 11:34:22 +0300 Timo Sirainen (cb00e21fd7) lib-mail: message-parser - Change message_part_append() to do all work internally M src/lib-mail/message-parser.c 2020-04-23 11:33:31 +0300 Timo Sirainen (e5830ae885) lib-mail: message-parser - Add a message_part_finish() helper function M src/lib-mail/message-parser.c 2020-04-23 11:47:18 +0300 Timo Sirainen (926742088a) lib-mail: Move message_parser_init_from_parts() handling to its own file This helps to see what code they have in common. M src/lib-mail/Makefile.am A src/lib-mail/message-parser-from-parts.c A src/lib-mail/message-parser-private.h M src/lib-mail/message-parser.c 2020-04-23 11:27:14 +0300 Timo Sirainen (6d77e00e4d) lib-mail: test-message-parser - Test that children_count is correct M src/lib-mail/test-message-parser.c 2020-04-23 11:14:04 +0300 Timo Sirainen (d4bb43a08a) lib-mail: test-message-parser - Add another test for boundary matching M src/lib-mail/test-message-parser.c 2020-08-12 11:58:07 +0300 Timo Sirainen (84b70b76a6) dict: Fix potential hang when iterating Broken by 2937287a72cffa8c709c22ede838058d48b61778 M src/dict/dict-commands.c M src/dict/dict-connection.h 2020-08-12 11:57:26 +0300 Timo Sirainen (1bbb54716a) lib: Clarify o_stream_set_flush_pending() comment related to corking M src/lib/ostream.h 2020-08-06 17:46:07 +0300 Timo Sirainen (75693aa152) lib: When clearing signal handlers, ignore the signals instead of restoring defaults This is mainly happening in while the process is shutting down. Getting a signal at a time when the normal signal handlers are gone isn't something that is expected. It's better to just ignore the signal and let the process to finish shutting down normally instead of getting killed. This should also fix some unit tests where the child processes were sometimes dying with SIGTERM due to these race conditions. M src/lib-test/test-subprocess.c M src/lib/lib-signals.c M src/lib/lib-signals.h 2020-08-03 13:21:14 +0300 Timo Sirainen (d0ea7f9f45) pop3-login: Fix the next command failing after unsuccessful AUTH If the AUTH command failed (e.g. bad password or proxying failure), the next command was still processed as AUTH command. For example: auth plain . -ERR [AUTH] Invalid base64 data in initial response quit -ERR [AUTH] Unsupported authentication mechanism. M src/pop3-login/client-authenticate.c 2020-08-04 12:37:45 +0300 Aki Tuomi (f491dea427) lib-compression: zstd - Check version If we are using older than 1.3.1 we emit warning if there is library mismatch. This is because error codes will break. M src/lib-compression/iostream-zstd-private.h M src/lib-compression/istream-zstd.c M src/lib-compression/ostream-zstd.c 2020-08-04 12:35:39 +0300 Aki Tuomi (1160ac3a37) lib-compression: zstd - Repair error codes if necessary libzstd version numbers were pinned on 1.3.1, if we are compiled against version before that, and runtime is newer, we need to repair version numbers. A horrible hack that only allows using 1.3.1+ with old code. M src/lib-compression/Makefile.am A src/lib-compression/iostream-zstd-private.h M src/lib-compression/istream-zstd.c M src/lib-compression/ostream-zstd.c 2020-08-05 14:35:52 +0300 Timo Sirainen (9ee1a10480) lib: Fix potential crash changing signal handlers after destroying ioloop M src/lib/lib-signals.c 2020-06-22 15:30:49 +0300 sergey.kitov (ddd93d7953) lib-index: Set event name for "Recreated index" M src/lib-index/mail-index-write.c 2020-07-21 13:32:19 -0400 Josef 'Jeff' Sipek (9a6bbb115a) global: Rely on fs_deinit() automatically freeing parent fs M src/lib-fs/fs-metawrap.c M src/lib-fs/fs-randomfail.c M src/lib-fs/fs-sis-queue.c M src/lib-fs/fs-sis.c M src/plugins/fs-compress/fs-compress.c M src/plugins/mail-crypt/fs-crypt-common.c 2020-07-21 12:55:27 -0400 Josef 'Jeff' Sipek (e42b179cb8) lib-fs: Free parent fs generically M src/lib-fs/fs-api.c 2020-07-21 13:24:15 -0400 Josef 'Jeff' Sipek (09085ba9ba) mail-crypt: Use container_of() instead of casts for fs code Being more explicit not only makes the code more explict, it makes it safer. M src/plugins/mail-crypt/fs-crypt-common.c 2020-07-21 13:22:06 -0400 Josef 'Jeff' Sipek (af02f4005d) fs-compress: Use container_of() instead of casts Being more explicit not only makes the code more explict, it makes it safer. M src/plugins/fs-compress/fs-compress.c 2020-07-21 13:18:41 -0400 Josef 'Jeff' Sipek (efad611e18) lib-fs: sis - Use container_of() instead of casts Being more explicit not only makes the code more explict, it makes it safer. M src/lib-fs/fs-sis.c 2020-07-21 13:16:34 -0400 Josef 'Jeff' Sipek (e11855558a) lib-fs: sis-queue - Use container_of() instead of casts Being more explicit not only makes the code more explict, it makes it safer. M src/lib-fs/fs-sis-queue.c 2020-07-21 13:13:20 -0400 Josef 'Jeff' Sipek (4f1409f68e) lib-fs: randomfail - Use container_of() instead of casts Being more explicit not only makes the code more explict, it makes it safer. M src/lib-fs/fs-randomfail.c 2020-07-21 13:05:34 -0400 Josef 'Jeff' Sipek (fbfbbb3444) lib-fs: metawrap - Use container_of() instead of casts Being more explicit not only makes the code more explict, it makes it safer. M src/lib-fs/fs-metawrap.c 2020-07-17 17:43:08 -0400 Josef 'Jeff' Sipek (8372b18e19) lib-fs: Add new deinit vfunc This is useful for tidying up anything just before freeing the struct fs. For example, flushing dirty data in a write-back cache. M src/lib-fs/fs-api-private.h M src/lib-fs/fs-api.c M src/lib-fs/fs-dict.c M src/lib-fs/fs-metawrap.c M src/lib-fs/fs-posix.c M src/lib-fs/fs-randomfail.c M src/lib-fs/fs-sis-queue.c M src/lib-fs/fs-sis.c M src/lib-fs/fs-test.c M src/plugins/fs-compress/fs-compress.c M src/plugins/mail-crypt/fs-crypt.c M src/plugins/mail-crypt/fs-mail-crypt.c 2020-07-17 17:26:41 -0400 Josef 'Jeff' Sipek (9d59b32ff1) lib-fs: Rename deinit vfunc to free M src/lib-fs/fs-api-private.h M src/lib-fs/fs-api.c M src/lib-fs/fs-dict.c M src/lib-fs/fs-metawrap.c M src/lib-fs/fs-posix.c M src/lib-fs/fs-randomfail.c M src/lib-fs/fs-sis-queue.c M src/lib-fs/fs-sis.c M src/lib-fs/fs-test.c M src/plugins/fs-compress/fs-compress.c M src/plugins/mail-crypt/fs-crypt-common.c M src/plugins/mail-crypt/fs-crypt.c M src/plugins/mail-crypt/fs-mail-crypt.c 2020-04-26 22:27:52 +0300 Timo Sirainen (a92b4b21fa) lib, lib-master: Send updated event to stats if fields/categories change Based on code by Jeff Sipek M src/lib-master/stats-client.c M src/lib-master/test-event-stats.c M src/lib/lib-event-private.h M src/lib/lib-event.c 2020-04-28 18:48:07 +0300 Timo Sirainen (42c309013b) stats: Allow clients to update existing events with UPDATE command M src/stats/client-writer.c 2020-04-28 18:43:21 +0300 Timo Sirainen (f78e3f8bfb) lib: event_import*() - Allow importing duplicate data without using more memory M src/lib/lib-event.c 2020-07-27 11:15:42 -0400 Josef 'Jeff' Sipek (21477aaefd) lib-master: Properly compare unit test output strings with expected values The I_MIN() mean that only the prefix was getting compared. M src/lib-master/test-event-stats.c 2020-07-05 12:16:06 +0200 Stephan Bosch (6d9ff68a11) imap: cmd-notify - Do not try to notify for removable namespaces. It is not going to work anyway and it will cause a crash when the IMAP sync code subsequently drops those namespaces as part of mail_user_drop_useless_namespaces(). This does not drop the earlier created mailbox_list_notify object, causing its mailbox list index view object to remain open. This causes the following panic: Panic: Leaked view for index /dovecot.list.index: Opened in mailbox-list-index-notify.c:142 M src/imap/cmd-notify.c 2020-07-07 01:37:54 +0200 Stephan Bosch (08398c29dd) lib-storage: Add mail_namespace_is_removable() and use it. M src/lib-storage/mail-namespace.h M src/lib-storage/mail-user.c 2020-07-05 12:47:05 +0200 Stephan Bosch (fbeeffeef8) lib-index: mail-index-view - Record caller source filename and line for mail_index_view_clone/dup_private(). Before, this was only recorded for mail_index_view_open(), which caused the view leak panic to show a useless source location, e.g.: Panic: Leaked view for index : Opened in (null):0 M src/lib-index/mail-index-view-private.h M src/lib-index/mail-index-view.c 2020-07-16 16:30:00 -0400 Josef 'Jeff' Sipek (622a3427eb) lib-fs: Set debug on event from settings M src/lib-fs/fs-api.c 2020-06-29 11:56:02 +0200 Stephan Bosch (49daa90133) imap: cmd-notify - Fix segfault ocurring upon NOTIFY error. The client_send_line() function in imap_client_notify_more() uses notify_ns to obtain access to client struct, while that is available as a direct function parameter. And notify_ns is invalid at the end of the for loop, so dereferencing it causes a segmentation fault. M src/imap/imap-notify.c 2020-07-31 18:39:54 +0300 Aki Tuomi (3fd7b277b2) lib-compression: test-compression - Do not fail on missing handlers M src/lib-compression/test-compression.c 2020-07-31 09:51:35 +0300 Aki Tuomi (b8ab80ca29) lib-compression: Fix support for older libzstd M m4/want_zstd.m4 M src/lib-compression/istream-zstd.c M src/lib-compression/ostream-zstd.c 2020-07-31 09:51:16 +0300 Aki Tuomi (cf227c6500) lib-compression: test-compression - Ensure compression handler is found by file extension M src/lib-compression/test-compression.c 2020-06-10 15:53:41 +0300 Timo Sirainen (0447775763) fs-compress: Try all compression formats when decompressing Not just the specified compression format. M src/plugins/fs-compress/fs-compress.c 2020-06-10 15:48:06 +0300 Timo Sirainen (4cd01cefd8) fs-compress: Rename compress_fs.handler to compress_handler M src/plugins/fs-compress/fs-compress.c 2020-07-06 14:54:48 +0300 Aki Tuomi (15786d88fb) lib-compression: test-compression - Add test for tiny invalid data Ensure compression handlers return EINVAL when reading less than header size data. M src/lib-compression/test-compression.c 2020-07-06 19:55:10 +0300 Aki Tuomi (ba73b7f0ea) lib-compression: istream-xz - Fix header reading If file was smaller than xz magic size, we would get EPIPE instead of EINVAL. M src/lib-compression/istream-lzma.c 2020-07-06 15:42:26 +0300 Aki Tuomi (6aaafffe3e) lib-compression: istream-zstd - Fix header reading If file was smaller than zstd magic size, we would get EPIPE instead of EINVAL. M src/lib-compression/istream-zstd.c 2020-07-06 15:41:28 +0300 Aki Tuomi (658bc80f44) lib-compression: istream-zlib - Fix header reading If data size was 0 it would give EPIPE instead of EINVAL M src/lib-compression/istream-bzlib.c 2020-07-06 19:16:50 +0300 Aki Tuomi (58c9dda4c7) lib-compression: istream-lz4 - Fix header reading If data size was smaller than header size, lz4 reading would return -1 without error indicating EOF instead of EINVAL. Broken in c1a43c6098f0caf11e8a2c1889227ec3969e410e M src/lib-compression/istream-lz4.c 2020-07-06 10:12:39 +0300 Aki Tuomi (829ba2c7da) lib-compression: ostream-zstd - Remove o_stream_zstd_error It has only one private caller. M src/lib-compression/ostream-zstd.c 2020-07-06 10:11:51 +0300 Aki Tuomi (2341a03534) lib-compression: ostream-zstd - Fix error handling The error code handling in ZSTD was wrong, because zstd returns error codes as large unsigned numbers which need to be retrieved with helper function. M src/lib-compression/ostream-zstd.c 2020-07-06 10:10:00 +0300 Aki Tuomi (286fa302a4) lib-compression: istream-zstd - Remove i_stream_zstd_error It has only one private caller. M src/lib-compression/istream-zstd.c 2020-07-03 09:45:09 +0300 Aki Tuomi (a36b524470) lib-compression: Fix error handling for zstd The error code handling in ZSTD was wrong, because zstd returns error codes as large unsigned numbers which need to be retrieved with helper function. M src/lib-compression/istream-zstd.c 2020-07-06 11:48:13 +0200 Markus Valentin (6e1f9304ca) lib-compression: Add "unsupported" compression This new compression is only used for testing purposes. M src/lib-compression/compression.c 2020-06-30 14:28:03 +0200 Markus Valentin (e6a0c94c08) lib-compression: Change compression_lookup_handler_from_ext return value In order to improve the error handling for compression_lookup_handler_from_ext calls return an integer rather then a pointer to struct compression_handler. M src/lib-compression/compression.c M src/lib-compression/compression.h M src/lib-compression/test-compression.c M src/plugins/zlib/zlib-plugin.c 2020-06-30 14:21:22 +0200 Markus Valentin (b6d3aedbd4) lib-compression: Change compression_lookup_handler return value In order to improve the error handling for compression_lookup_handler calls return an integer rather then a pointer to struct compression_handler. This change also prevents crashes when trying to use a compression format that isn't compiled in. M src/lib-compression/compression.c M src/lib-compression/compression.h M src/lib-compression/test-compression.c M src/plugins/fs-compress/fs-compress.c M src/plugins/imap-zlib/imap-zlib-plugin.c M src/plugins/zlib/zlib-plugin.c 2020-07-29 10:40:17 +0300 Timo Sirainen (af1a6be96c) pop3: Fix assert-crash when using pop3_deleted_flag Broken by 6d18044e1408ce98aa8ef145a9f85895829a7bc7 Fixes: Panic: file seq-range-array.c: line 472 (seq_range_array_invert): assertion failed: (range[count-1].seq2 <= max_seq) M src/pop3/pop3-commands.c 2020-07-15 12:42:59 +0300 Timo Sirainen (581bea0f68) pop3-login: Fix handling commands that are sent in multiple IP packets This happened especially if the commands were long, like XCLIENT. This got broken by recent pop3-login changes. M src/pop3-login/client-authenticate.c M src/pop3-login/client-authenticate.h M src/pop3-login/client.c M src/pop3-login/client.h 2020-07-10 11:00:14 +0300 Aki Tuomi (e6f8953a6e) lib-test: Rename s1, s2 to _temp_s1, _temp_s2 in test_assert_strcmp_idx Some test code uses s1 and s2 as variable names. Broken in 449539dc52070bebde3ae7babe96e6e272dd7101 M src/lib-test/test-common.h 2020-07-09 09:38:37 +0300 Aki Tuomi (f19d3ad349) pop3-login: Use struct client authenticating member This is what should be used instead of introducing our own. Broken in 6c55437036b3de11804eb68f66d84cb164c33d63 M src/pop3-login/client-authenticate.c M src/pop3-login/client.c M src/pop3-login/client.h 2020-07-09 09:39:48 +0300 Aki Tuomi (7ca712bb6f) pop3-login: Consume line after mech probe Otherwise we read next line empty and that causes -ERR. Broken in 6c55437036b3de11804eb68f66d84cb164c33d63 M src/pop3-login/client-authenticate.c 2020-07-08 10:59:48 +0300 Aki Tuomi (1a1b810e2d) lib: istream - Do not attempt read past end in i_stream_next_line_finish M src/lib/istream.c M src/lib/test-istream.c 2020-07-08 12:58:56 +0300 Aki Tuomi (449539dc52) lib-test: test_assert_strcmp_idx - Avoid double evaluation M src/lib-test/test-common.h 2020-07-08 08:55:31 +0300 Aki Tuomi (fb2379c54d) pop3-login: Read command more carefully Ensure we don't consume '\n' or '\0' when reading command, but that we consume '\r' otherwise i_stream_read_next_line won't work properly. M src/pop3-login/client.c 2020-07-01 12:11:43 -0400 Josef 'Jeff' Sipek (1accaf55c2) lib: Properly free event filter in unit tests M src/lib/test-event-filter-parser.c 2020-07-03 09:11:09 +0300 Aki Tuomi (5a38eafa70) lib: event-filter-lexer - Ignore unused parameters M src/lib/event-filter-lexer.l 2020-05-19 22:08:25 +0300 Timo Sirainen (757255c505) lib: lib-signals - Use persistent signal IOs When ioloop is switched, don't remove the IO from old ioloop and create it to new ioloop. Just use persistent IOs for each separate ioloop. This can reduce a lot of syscalls when ioloops are often switched. M src/lib/lib-signals.c M src/lib/lib-signals.h 2020-05-19 21:30:18 +0300 Timo Sirainen (b25bd31c70) lib: lib-signals - Add struct signal_ioloop This struct tracks which ioloops have signal handlers. M src/lib/lib-signals.c 2020-05-19 21:02:38 +0300 Timo Sirainen (bda17bd783) lib: lib-signals - Replace LIBSIG_FLAG_NO_IOLOOP_AUTOMOVE with LIBSIG_FLAG_IOLOOP_AUTOMOVE There aren't many signal handlers that actually want to move automatically. It's just causing accidental bugs when signal handlers are run in unexpected ioloops. M src/lib-test/test-subprocess.c M src/lib/child-wait.c M src/lib/lib-signals.c M src/lib/lib-signals.h M src/lib/test-lib-signals.c 2020-06-24 10:30:21 +0300 Timo Sirainen (68210f3fa0) lib: lib-signals - Fix creating non-automove signal handlers before ioloop M src/lib/lib-signals.c 2020-05-19 21:50:25 +0300 Timo Sirainen (aa05159613) lib: Add io_loop_add/remove_destroy_callback() M src/lib/ioloop.c M src/lib/ioloop.h 2020-07-02 10:09:49 +0300 Aki Tuomi (21ea4c6033) lib: event-filter - Use i_fatal for fatal error handling M src/lib/event-filter-lexer.l 2020-07-02 09:56:15 +0300 Aki Tuomi (ef7cec2957) lib: event-filter - Disable some more compiler warnings M src/lib/event-filter-lexer.l 2020-07-02 09:55:31 +0300 Aki Tuomi (f3c879817d) lib: event-filter - Handle allocations This allows us to use Dovecot specific memory error handling when allocations fail. Also squashes compiler warnings. M src/lib/event-filter-lexer.l 2020-06-30 14:02:34 +0300 Aki Tuomi (6c55437036) pop3-login: Read SASL-IR properly This fixes issue where login would fail if SASL-IR message would be too long. M src/pop3-login/client-authenticate.c M src/pop3-login/client-authenticate.h M src/pop3-login/client.c M src/pop3-login/client.h 2020-06-30 14:01:12 +0300 Aki Tuomi (c703c8ff58) pop3-login: Read command separately Simplifies next commit M src/pop3-login/client.c 2020-07-01 14:49:36 +0300 Aki Tuomi (b31bbec95b) auth: db-lua - Fix user iteration The old code did not leave the stack empty after finishing up, that would lead into stack being left dirty and accumulating per each call. M src/auth/db-lua.c 2020-07-01 13:18:03 +0300 Aki Tuomi (6e84cc3cd9) auth: db-lua - Always set callback when iterating M src/auth/db-lua.c 2020-06-26 18:31:11 +0300 Aki Tuomi (c76a5af14a) lib-lua: Register panic handler M src/lib-lua/dlua-script.c 2020-06-26 18:27:18 +0300 Aki Tuomi (3e11b97c63) auth: db-lua - Ensure stack is empty at end M src/auth/db-lua.c 2020-06-26 18:29:46 +0300 Aki Tuomi (21668efa7e) auth: db-lua - Pop dovecot after registering M src/auth/db-lua.c 2020-06-26 12:21:40 +0300 Aki Tuomi (919c5103b9) auth: db-lua - Pop result after lookup When doing lookups, the lookup result was not popped. M src/auth/db-lua.c 2020-06-26 12:16:31 +0300 Aki Tuomi (d9dd3c2798) lib-lua: Add dlua_dump_stack Useful for debugging why stack leaks M src/lib-lua/dlua-script.c M src/lib-lua/dlua-script.h 2020-06-29 09:55:15 +0300 Aki Tuomi (dd87051e9e) configure: Properly fail if bison or flex is missing If bison or flex is missing, and are needed, fail configure. M configure.ac 2020-06-26 10:08:27 -0400 Josef 'Jeff' Sipek (9a6e303a95) Ignore ylwrap M .gitignore 2020-06-25 12:16:44 -0400 Josef 'Jeff' Sipek (1e4f9b6566) lib: Rename event filter files to be less redundantly named M .gitignore M src/lib/Makefile.am R098 src/lib/event-filter-parser-lexer.l src/lib/event-filter-lexer.l R100 src/lib/event-filter-parser-parser.y src/lib/event-filter-parser.y 2020-06-10 16:44:19 -0400 Josef 'Jeff' Sipek (b25cea63de) lib: event filter parser unit tests M src/lib/Makefile.am A src/lib/test-event-filter-parser.c M src/lib/test-lib.inc 2020-05-26 11:35:38 -0400 Josef 'Jeff' Sipek (fcba1d5307) lib: Switch event filtering to the new filter language M src/lib-master/stats-client.c M src/lib-master/test-event-stats.c M src/lib/Makefile.am D src/lib/event-filter-parser.c M src/lib/event-filter.c M src/lib/event-filter.h M src/stats/client-writer.c M src/stats/test-client-reader.c M src/stats/test-client-writer.c M src/stats/test-stats-metrics.c 2020-05-29 13:09:22 -0400 Josef 'Jeff' Sipek (789484d40c) lib: Implement a new event filter language Currently, it is not used by anything. In general, the new syntax is very SQL-like. It is a boolean expression made up of key-value comparisons, parentheses, and boolean connectors AND, OR, and NOT. The key-value comparisons are of the form: Where the key is one of: (1) "event" (2) "category" (3) "source_location" (4) a field name The operator is one of: (1) = (2) > (3) < (4) >= (5) <= And the value is either: (1) a single word token, or (2) a quoted string For example, to match events with the event name "abc", we would use one of the following expressions. Note that white space is not significant between tokens, and therefore the following are all equivalent. event=abc event="abc" event = abc event = "abc" To match events with the name "abc" that include the "imap" category, we'd use: event=abc AND category=imap To match events with the name "abc" that either include the "imap" or "pop3" categories, we'd use: event=abc AND (category=imap OR category=pop3) Field names don't have any special prefix. Therefore, to match events than have the field bytes_out equal to 10, we'd use: bytes_out=10 To match events with bytes_out greater than or equal to 10, we'd use: bytes_out>=10 M .gitignore M configure.ac M src/lib/Makefile.am A src/lib/event-filter-parser-lexer.l A src/lib/event-filter-parser-parser.y M src/lib/event-filter-private.h M src/lib/event-filter.c 2020-06-17 15:16:48 -0400 Josef 'Jeff' Sipek (09a26e31a2) lib: Allow event filter nodes to represent a log type category M src/lib/event-filter-private.h M src/lib/event-filter.c 2020-06-17 15:01:28 -0400 Josef 'Jeff' Sipek (64874eaacb) lib: Future-proof the log type to event filter log type mapping The mapping assumed that: EVENT_FILTER_LOG_TYPE_FOO == (1 << LOG_TYPE_FOO) While that is true today and will likely continue to be true in the future, there's no reason why we can't future proof it and ensure that it always works. M src/lib/event-filter.c 2020-05-28 17:43:21 -0400 Josef 'Jeff' Sipek (fc330b22cf) lib: Expose event_filter_category_to_log_type to the rest of event filter code M src/lib/event-filter-private.h M src/lib/event-filter.c 2020-05-28 17:22:09 -0400 Josef 'Jeff' Sipek (61cb32860f) lib: Add internal code for event filter le/lt/ge/gt comparisons These are currently unreachable. M src/lib/event-filter.c 2020-05-22 13:08:24 -0400 Josef 'Jeff' Sipek (4ba261b738) lib: Rewrite event filter internals to use an abstract-syntax-tree M src/lib/Makefile.am A src/lib/event-filter-private.h M src/lib/event-filter.c 2020-05-11 14:43:15 -0400 Josef 'Jeff' Sipek (623031f7e9) stats: Fail to load with empty metric filters M src/stats/stats-settings.c 2020-04-21 10:32:32 -0400 Josef 'Jeff' Sipek (15ff31c2fe) stats: replace metric { } filtering with the common filter language M src/stats/stats-metrics.c M src/stats/stats-settings.c M src/stats/stats-settings.h M src/stats/test-client-reader.c M src/stats/test-client-writer.c M src/stats/test-stats-metrics.c 2020-05-14 15:11:35 -0400 Josef 'Jeff' Sipek (a58a505d91) lib: Change event_filter_parse() filter arg to a single pointer Instead of allocating a new filter, fill in a passed in one. M src/lib-master/master-service-settings.c M src/lib-master/master-service.c M src/lib/event-filter-parser.c M src/lib/event-filter.h 2020-05-14 13:04:10 -0400 Josef 'Jeff' Sipek (5535938ae4) lib: Assert that we aren't trying to match using filter framents M src/lib/event-filter.c 2020-05-14 13:03:52 -0400 Josef 'Jeff' Sipek (fdff11be6c) lib: Add event_filter_create_fragment() M src/lib/event-filter.c M src/lib/event-filter.h 2020-04-21 10:08:46 -0400 Josef 'Jeff' Sipek (891615285d) lib: Move event filter query language from lib-master This way we can use it elsewhere. M src/lib-master/master-service-settings.c M src/lib-master/master-service-settings.h M src/lib-master/master-service.c M src/lib/Makefile.am A src/lib/event-filter-parser.c M src/lib/event-filter.h 2020-04-21 11:05:58 -0400 Josef 'Jeff' Sipek (f3d6ba1bb8) stats: openmetrics shouldn't abuse metric { } filter strings Once upon a time it was thought that it was a good idea to output labels for openmetrics metrics based on the fields used in the filter { } sub-block. For the most part, this is not useful since the labels are going to be either (1) always the same, or (2) one of several values. For example, consider the following metric block: metric foo { event_name = something ... filter { abc = BAR def = BAZ* } } The value of 'abc' will *always* be 'BAR' for this metric, therefore it is useless to include it. The value of 'def' will always start with 'BAZ' for this metric. While it may be tempting to justify this usage, the group_by provides a superset of the functionality. In other words, the following config snipped will provide a superset of the same information. metric foo { event_name = something ... filter { abc = BAR def = BAZ* } group_by = abc def } Therefore, this filter { } sub-block labeling support is redundant and can be safely removed. M src/stats/stats-service-openmetrics.c 2020-05-11 14:07:11 -0400 Josef 'Jeff' Sipek (43159ecb2c) lib: Add a way to merge filter queries with an overridden context This allows the consumers to construct a filter without setting the context on each query, and then when merging it with another query "filling in" the context on the fly. M src/lib/event-filter.c M src/lib/event-filter.h 2020-05-11 14:03:52 -0400 Josef 'Jeff' Sipek (a21b38c645) lib: Better document event filter iteration behavior M src/lib/event-filter.h 2020-05-29 09:53:53 +0300 Aki Tuomi (225bbb2fa6) auth: auth-worker-client - Fix whitespace formatting M src/auth/auth-worker-client.c 2020-05-29 09:52:23 +0300 Aki Tuomi (2bca51fb86) auth: auth-worker-client - Remove global auth_worker_client All should go through connection list instead. Broken in 317cb8aa981f856770057e23aeba98a33afc033a M src/auth/auth-worker-client.c 2019-01-29 01:08:21 +0100 Stephan Bosch (33658141bb) lib-http: http-client - Fix assert panic occurring for shared clients. Occurs as a race condition between connections becoming idle and new connections being set up. Panic was: Panic: file http-client-queue.c: line 373 (http_client_queue_connection_attempt): assertion failed: (http_client_peer_addr_cmp (&(*peer_idx)->shared->addr, addr) != 0) M src/lib-http/http-client-queue.c 2020-05-26 19:22:52 +0300 Timo Sirainen (2937287a72) dict: Delay uncorking ostream in iteration callback M src/dict/dict-commands.c 2020-06-15 10:33:53 +0300 Timo Sirainen (8a31ae84ad) lib-storage: istream-mail - Fix assert-crash on handling corrupted mail size In some situations the "Cached message size smaller than expected" error handling could have resulted in: Panic: file istream.c: line 315 (i_stream_read_memarea): assertion failed: (old_size <= _stream->pos - _stream->skip) M src/lib-storage/index/istream-mail.c 2020-05-26 19:09:38 +0300 Timo Sirainen (f5790ecaa6) dict-client: Fix potential iterator double-free client_dict_iterate_free() didn't really work properly, because of: ctx->finished = TRUE; client_dict_iter_api_callback(ctx, cmd, extra_args); client_dict_iterate_free(ctx); Here finished=TRUE is set first (and it needs to be set first). Afterwards client_dict_iter_api_callback() internally calls client_dict_iterate_deinit(), which can end up freeing the iterator. M src/lib-dict/dict-client.c 2020-05-26 18:59:38 +0300 Timo Sirainen (ed47536cf2) dict-client: Rename struct dict_connection to dict_client_connection dict server already has struct dict_connection. This naming conflict caused problems with gdb debugging. M src/lib-dict/dict-client.c 2020-05-18 20:34:27 +0300 Timo Sirainen (66610c9f00) dict: Cork the output while writing iteration output This reduces system CPU usage by avoiding many tiny write() syscalls. Broken by 2ff2da52146609f4459bd0f7fd603e13400cb85e M src/dict/dict-commands.c 2020-04-28 11:51:16 +0300 Timo Sirainen (c362e6dfd9) fts: Add fts category For now mainly so that the fts drivers' categories can inherit from it. M src/plugins/fts/fts-api.c M src/plugins/fts/fts-api.h 2020-06-11 12:59:14 +0300 Timo Sirainen (203b2b709b) imap: Fix assert-crash in COPY/MOVE when storage doesn't return UIDs For example copying mails into virtual storage crashed. Broken by 09413e35f764a2898cbc26cea94218eed6df5cbf Fixes: Panic: file cmd-copy.c: line 152 (fetch_and_copy): assertion failed: (copy_ctx->copy_count == seq_range_count(©_ctx->saved_uids)) M src/imap/cmd-copy.c 2020-06-09 11:40:53 +0300 Timo Sirainen (0fb7f89740) lib-compression: istream-zstd - Fix infinite loop when istream is nonblocking M src/lib-compression/istream-zstd.c 2020-06-04 13:15:11 +0300 Aki Tuomi (87f109d404) lib-oauth2: oauth-jwt - Ensure / and . are escaped in kid M src/lib-oauth2/oauth2-jwt.c M src/lib-oauth2/test-oauth2-jwt.c 2020-06-04 10:41:32 +0300 Aki Tuomi (654ade00c1) dovecot-oauth2.conf.ext: Update to match code M doc/example-config/dovecot-oauth2.conf.ext 2020-06-04 10:23:36 +0300 Aki Tuomi (92684902de) auth: db-oauth2 - Add more performant defaults for lib-http M src/auth/db-oauth2.c 2020-06-03 15:40:40 +0300 Aki Tuomi (b196135db1) lib-oauth2: Use azp to find token This validates that the token is actually for us and also allows having multiple tokens with same ID but different issuer. M src/lib-oauth2/oauth2-jwt.c M src/lib-oauth2/test-oauth2-jwt.c 2020-06-03 15:40:04 +0300 Aki Tuomi (ebe460f7c2) lib-oauth2: Validate signature in jwt body process This way we can utilize fields from body with validation. M src/lib-oauth2/oauth2-jwt.c 2020-06-03 15:35:48 +0300 Aki Tuomi (fc708711c8) lib-oauth2: Rename algo to alg It's the field name. M src/lib-oauth2/oauth2-jwt.c 2020-06-02 15:59:37 +0300 Aki Tuomi (4b7d893712) lib-oauth2: Add iss validation support M src/auth/db-oauth2.c M src/lib-oauth2/oauth2-jwt.c M src/lib-oauth2/oauth2.h M src/lib-oauth2/test-oauth2-jwt.c 2020-06-02 15:52:34 +0300 Aki Tuomi (b4dd39cce4) lib-oauth2: Ensure token algorithm matches with key Otherwise we might mistakenly use key that is not intended for the token. M src/lib-oauth2/oauth2-jwt.c M src/lib-oauth2/test-oauth2-jwt.c 2020-06-02 16:07:48 +0300 Aki Tuomi (a93c1dbfdf) lib-oauth2: oauth2-jwt - Always uppercase algorithm M src/lib-oauth2/oauth2-jwt.c 2020-05-27 15:41:22 +0300 Aki Tuomi (b219069e81) lib-dcrypt: dcrypt-openssl - Add helper macro for error_r handling Avoids missing NULL checks for error_r. M src/lib-dcrypt/dcrypt-openssl.c 2020-05-27 12:16:25 +0200 Stephan Bosch (dcfd2a9177) lib-signals: Fix lib_signals_set_expected(). The function made no sense at all. Problem found by Coverity. M src/lib/lib-signals.c 2020-04-16 07:35:25 +0200 Markus Valentin (53155cad72) lib-sql: driver-cassandra - Handle more Cassandra errors as uncertain Treat CASS_ERROR_LIB_WRITE_ERROR as uncertain error. M src/lib-sql/driver-cassandra.c 2020-04-16 07:32:36 +0200 Markus Valentin (c3d98cebbd) lib-sql: driver-cassandra - Extract uncertain ascertainment to function M src/lib-sql/driver-cassandra.c 2020-05-08 03:02:22 +0300 Juha-Petri Tyrkkö (ce724fc647) lib-fs: Prevent the release of a nonexistent dict. M src/lib-fs/fs-dict.c 2020-05-27 09:09:45 +0300 Aki Tuomi (2acca6a60d) auth: db-oauth2 - Remove extra oauth2 prefix from log messages M src/auth/db-oauth2.c 2020-05-26 12:46:29 +0300 Aki Tuomi (139fb234bb) auth, lib-oauth2: Add local introspection mode Local introspection attempts to decode token always. This will also happen with password grant, saving an extra roundtrip to oauth2 server. M src/auth/db-oauth2.c M src/lib-oauth2/oauth2.h 2020-05-26 09:53:26 +0300 Aki Tuomi (b2eed05ed0) auth: db-oauth2 - Use common code for lookup and password grant M src/auth/db-oauth2.c 2020-05-26 13:38:09 +0300 Aki Tuomi (1cb8ec93cf) auth: db-oauth2 - Clarify how introspect gets called This should make it more obvious when introspection actually gets called after lookup. Introspection failure is now also moved earlier, before the request would fail later because not all fields are available. M src/auth/db-oauth2.c 2020-05-26 12:12:32 +0300 Aki Tuomi (15c893ea47) auth: db-oauth2 - Add token parameter to db_oauth2_local_validation M src/auth/db-oauth2.c 2020-05-25 21:42:08 +0300 Aki Tuomi (db7f5e6e54) auth: db-oauth2 - Move db_oauth2_local_validation Simplifies next change M src/auth/db-oauth2.c 2020-05-25 21:47:35 +0300 Aki Tuomi (9e2507637e) auth: db-oauth2 - Move db_oauth2_lookup_continue Simplifies next change M src/auth/db-oauth2.c 2020-05-26 21:24:02 +0300 Aki Tuomi (124861cc78) auth: db-oauth2 - Do not fallback into remote validation anymore It makes no sense anymore with introspection_mode=local. One should make another passdb. M src/auth/db-oauth2.c 2020-05-25 21:18:45 +0300 Aki Tuomi (de757d9e27) auth: db-oauth2 - Fix whitespace issue M src/auth/db-oauth2.c 2020-05-26 21:22:51 +0300 Aki Tuomi (e91e4a64ed) lib-oauth2: Use hash instead of hash2 Hash2 doesn't work as we want. Fixes key caching to actually work. M src/lib-oauth2/oauth2-key-cache.c 2020-05-25 16:19:14 +0300 Aki Tuomi (bf25eab15e) lib-oauth2: Allow nbf and iat to be 0 Some implementations set these intentionally to 0. M src/lib-oauth2/oauth2-jwt.c M src/lib-oauth2/test-oauth2-jwt.c 2020-05-01 17:26:14 +0200 Stephan Bosch (0c10ac7534) lmtp: Support forwarding passdb's forward_* fields via RCPT TO XRCPTFORWARD parameter. M src/lmtp/lmtp-client.c M src/lmtp/lmtp-commands.c M src/lmtp/lmtp-common.h M src/lmtp/lmtp-local.c M src/lmtp/lmtp-proxy.c M src/lmtp/lmtp-recipient.h 2020-05-01 17:26:03 +0200 Stephan Bosch (82bf153436) lmtp: lmtp-proxy - Adjust RCPT parameter amendment code for expansion. M src/lmtp/lmtp-proxy.c 2020-05-01 17:25:46 +0200 Stephan Bosch (8cbb7b1310) lmtp: lmtp-proxy - Wait for client connection login before submitting RCPT command. This allows evaluating the server capabilities while composing the RCPT command. M src/lmtp/lmtp-proxy.c 2020-05-01 17:25:27 +0200 Stephan Bosch (4289df7858) lmtp: lmtp-proxy - Make LMTP connection object available in proxy connection struct. M src/lmtp/lmtp-proxy.c 2020-05-02 00:05:06 +0200 Stephan Bosch (2c9a0e54d6) lmtp: lmtp-client - Base client trust on the real remote IP. LMTP uses real_remote_ip for checking the trust. This means: * LMTP proxy checks MTA's IP address * LMTP backend checks LMTP proxy's IP address * If haproxy is used in front of this LMTP server, the haproxy's IP address is checked. This may not be what is always wanted, but in LMTP backend it wouldn't be correct to check the original client IP (= MTA IP) either. M src/lmtp/lmtp-client.c 2020-04-26 11:02:47 +0200 Stephan Bosch (5e11257b83) lib-storage: mail-storage-service - Add support for sending forward_fields in userdb lookup. M src/lib-storage/mail-storage-service.c M src/lib-storage/mail-storage-service.h 2020-04-26 10:57:57 +0200 Stephan Bosch (91dfc52315) lib-auth: auth-master - Add support for sending forward_fields. M src/lib-auth/auth-master.c M src/lib-auth/auth-master.h 2020-04-30 23:57:41 +0200 Stephan Bosch (d2a8e4e2e0) lib-smtp: smtp-client-connection - Allow smtp_client_connection_connect() to be called several times. This change allows calling smtp_client_connection_connect() several times with different login callbacks. If the connection is already available, the provided login callback is called almost immediately from the ioloop. This way, several parallel asynchronous activities using the same connection can wait for its availability and don't need to check whether it is available already. This is mostly useful to obtain the capabilities of the server. M src/lib-smtp/smtp-client-connection.c M src/lib-smtp/smtp-client-private.h 2020-05-01 13:02:57 +0200 Stephan Bosch (05828ad2c1) lib-smtp: smtp-client-connection - Record login reply. M src/lib-smtp/smtp-client-connection.c M src/lib-smtp/smtp-client-private.h 2020-04-22 02:27:05 +0200 Stephan Bosch (d0fb4283ec) lib-smtp: smtp-params - Add support for xtext-encoding/decoding extra parameters. M src/lib-smtp/smtp-params.c M src/lib-smtp/smtp-params.h 2020-04-22 23:24:21 +0200 Stephan Bosch (dc3de46652) lib-smtp: smtp-params - Split off smtp_params_equal() from smtp_params_rcpt_equal(). M src/lib-smtp/smtp-params.c M src/lib-smtp/smtp-params.h 2020-04-22 23:03:57 +0200 Stephan Bosch (b9797261bb) lib-smtp: smtp-params - Remove code duplication between smtp_params_*_write(). M src/lib-smtp/smtp-params.c 2020-04-22 22:55:54 +0200 Stephan Bosch (8ec6e1101b) lib-smtp: smtp-params - Remove code duplication between smtp_params_*_copy(). M src/lib-smtp/smtp-params.c M src/lib-smtp/smtp-params.h 2020-04-22 22:32:55 +0200 Stephan Bosch (c86fd10a18) lib-smtp: smtp-params - Remove code duplication between smtp_params_*_drop_extra(). M src/lib-smtp/smtp-params.c M src/lib-smtp/smtp-params.h 2020-04-22 22:26:25 +0200 Stephan Bosch (6f68a5d763) lib-smtp: smtp-params - Remove code duplication between smtp_params_*_add_extra(). M src/lib-smtp/smtp-params.c M src/lib-smtp/smtp-params.h 2020-04-22 22:15:43 +0200 Stephan Bosch (5830426484) lib-smtp: smtp-params - Remove code duplication between smtp_params_*_get_extra(). M src/lib-smtp/smtp-params.c M src/lib-smtp/smtp-params.h 2020-04-22 21:52:14 +0200 Stephan Bosch (4a2bfa7b95) lib-smtp: smtp-syntax - Add smtp_xtext_decode(). M src/lib-smtp/smtp-syntax.c M src/lib-smtp/smtp-syntax.h 2020-04-27 11:50:13 +0200 Stephan Bosch (2f205f294e) lib-smtp: smtp-params - Rename smtp_params_rcpt_equals() to smtp_params_rcpt_equal(). M src/lib-smtp/smtp-params.c M src/lib-smtp/smtp-params.h M src/lib-smtp/smtp-server-transaction.c 2020-05-01 17:25:05 +0200 Stephan Bosch (a077472e58) lmpt: Reformat lmtp-proxy.c. M src/lmtp/lmtp-proxy.c 2020-05-01 17:24:47 +0200 Stephan Bosch (11b8a9512f) lmtp: Reformat lmtp-commands.c. M src/lmtp/lmtp-commands.c 2020-05-04 22:25:47 +0200 Stephan Bosch (55b083e48b) lmtp: Reformat lmtp-client.c. M src/lmtp/lmtp-client.c 2020-05-02 02:34:34 +0200 Stephan Bosch (210e9058ff) lib-smtp: Reformat smtp-client-connection.h. M src/lib-smtp/smtp-client-connection.h 2020-05-01 17:16:01 +0200 Stephan Bosch (45689522bf) lib-smtp: Reformat smtp-client-connection.c. M src/lib-smtp/smtp-client-connection.c 2020-05-19 19:11:34 +0300 Timo Sirainen (2507d5576a) lib-storage: mail_search_args_init() - Expand "*" in SEARCH_SEQSET This is now required by the IMAP MOVE code to correctly handle "MOVE * folder". M src/lib-storage/mail-search.c M src/lib-storage/mail-search.h 2020-05-19 18:31:31 +0300 Timo Sirainen (6a378e6f55) imap: imap_search_seqset_iter_next() - Assert-crash if iteration doesn't progress This can be done easily with seq_range_array_remove_seq_range(). This is cleaner to use than invert+intersect. I originally didn't notice that this function existed. M src/imap/imap-search-args.c 2020-05-19 19:10:59 +0300 Timo Sirainen (947774f899) lib: Add unit test for seq_range_array_remove_range() M src/lib/test-seq-range-array.c 2020-05-18 12:01:44 +0300 Timo Sirainen (3c9a50165a) lib-storage: mail_search_args_init() - Fix converting UIDSET * to SEQSET on empty mailbox The "*" caused seq=0 to be added to the seqset. This could have caused unexpected issues. Fixes at least UID MOVE on empty mailbox: Panic: file seq-range-array.c: line 471 (seq_range_array_invert): assertion failed: (range[0].seq1 >= min_seq) Before 1a5d89d2bfa031903e88af9aff7eafc1b373d521 this assert-crash didn't happen, but it went to infinite loop. M src/lib-storage/mail-search.c 2020-04-11 19:19:41 +0200 Stephan Bosch (b8116a9c40) lib-imap-client: test-imapc-client - Use the new sub-process test API. This makes an effort to terminate server processes gracefully. Killing them bluntly hampers test coverage measurement and valgrind testing. M src/lib-imap-client/test-imapc-client.c 2020-04-11 18:54:06 +0200 Stephan Bosch (e1c5779d82) lib-imap-client: test-imapc-client - Add server debug messages. M src/lib-imap-client/test-imapc-client.c 2020-04-11 13:44:45 +0200 Stephan Bosch (077e4752df) lib-imap-client: test-imapc-client - Split off test_run_server/client() from test_run_client_server(). M src/lib-imap-client/test-imapc-client.c 2020-04-11 12:28:25 +0200 Stephan Bosch (7de3f74782) lib-imap-client: test-imapc-client - Add log prefixes to distinguish client and server debug messages. M src/lib-imap-client/test-imapc-client.c 2020-04-11 10:02:12 +0200 Stephan Bosch (2a3f08a3f8) lib-imap-client: test-imapc-client - Make sure the child server process is killed. M src/lib-imap-client/test-imapc-client.c 2020-04-11 10:05:25 +0200 Stephan Bosch (1eeb829538) lib-imap-client: test-imapc-client - Use getopt() for parsing command line arguments. M src/lib-imap-client/test-imapc-client.c 2020-04-11 10:00:32 +0200 Stephan Bosch (c93c1cdde3) lib-imap-client: test-imapc-client - Add structural comments. M src/lib-imap-client/test-imapc-client.c 2020-04-11 09:30:29 +0200 Stephan Bosch (ad73b51c0c) lib-imap-client: test-imapc-client - Move client functions. M src/lib-imap-client/test-imapc-client.c 2020-04-13 18:49:12 +0200 Stephan Bosch (dfe0bdb29f) lib-imap-client: test-imapc-client - Move server functions. M src/lib-imap-client/test-imapc-client.c 2020-04-11 09:27:30 +0200 Stephan Bosch (7af50c6dd4) lib-imap-client: test-imapc-client - Move test_open_server_fd(). M src/lib-imap-client/test-imapc-client.c 2020-04-11 13:27:58 +0200 Stephan Bosch (c4e2843bb2) lib-imap-client: Reformat test-imapc-client.c. M src/lib-imap-client/test-imapc-client.c 2020-04-12 11:51:31 +0300 Timo Sirainen (cf04833d7c) lib-imap-client: Remove unnecessary "Authentication failed: disconnected" errors If connection failed during login, there were always two log lines logged. The first line is enough. M src/lib-imap-client/imapc-connection.c M src/lib-imap-client/test-imapc-client.c 2020-04-12 11:34:14 +0300 Timo Sirainen (c91b90cccd) lib-imap-client: test-imapc-client - Client now sends LOGOUT and server expects it M src/lib-imap-client/test-imapc-client.c 2020-04-12 11:30:28 +0300 Timo Sirainen (b64215b17e) lib-imap-client: test-imapc-client - login_hangs: Client stopped too early M src/lib-imap-client/test-imapc-client.c 2020-04-12 11:29:06 +0300 Timo Sirainen (e00a29ea4f) lib-imap-client: test-imapc-client - login_hangs: Server checked wrong connection's input M src/lib-imap-client/test-imapc-client.c 2020-04-11 00:47:21 +0200 Stephan Bosch (e37370c0e1) master: test-master-login-auth - Use the new sub-process test API. This makes an effort to terminate server processes gracefully. Killing them bluntly hampers test coverage measurement and valgrind testing. M src/master/test-master-login-auth.c 2020-04-11 13:51:49 +0200 Stephan Bosch (4f0b28f3fe) master: test-master-login-auth - Split off test_run_server/client() from test_run_client_server(). M src/master/test-master-login-auth.c 2020-04-11 00:40:19 +0200 Stephan Bosch (d7251f0f6d) master: test-master-login-auth - Rename test_server_kill() to test_servers_kill_forced(). M src/master/test-master-login-auth.c 2020-04-11 00:38:26 +0200 Stephan Bosch (b0692354a7) master: test-master-login-auth - Move global initialization to main_init/deinit(). M src/master/test-master-login-auth.c 2020-04-11 00:32:25 +0200 Stephan Bosch (296c8cba36) master: test-master-login-auth - Avoid using sleep()/usleep(). M src/master/test-master-login-auth.c 2020-04-13 18:41:37 +0200 Stephan Bosch (5b2effd70c) master: test-master-login-auth - Use lib-signals API. Using signal() is not portable for installing a signal handler. M src/master/test-master-login-auth.c 2020-04-11 00:29:42 +0200 Stephan Bosch (2de5a76c67) master: test-master-login-auth - Ignore SIGPIPE. M src/master/test-master-login-auth.c 2020-04-13 18:33:08 +0200 Stephan Bosch (e8af3c18a1) master: test-master-login-auth - Don't ignore SIGCHLD. M src/master/test-master-login-auth.c 2020-04-11 00:26:25 +0200 Stephan Bosch (6aaa25c6a0) master: test-master-login-auth - Add log prefixes to distinguish client and server debug messages. M src/master/test-master-login-auth.c 2020-04-11 00:18:08 +0200 Stephan Bosch (de695e729b) master: test-auth-master - Use the new sub-process test API. This makes an effort to terminate server processes gracefully. Killing them bluntly hampers test coverage measurement and valgrind testing. M src/master/test-auth-master.c 2020-04-11 00:11:09 +0200 Stephan Bosch (a66f5b0fb6) master: test-auth-master - Split off test_run_server/client() from test_run_client_server(). M src/master/test-auth-master.c 2020-04-11 00:04:32 +0200 Stephan Bosch (af91b26444) master: test-auth-master - Rename test_server_kill() to test_servers_kill_forced(). M src/master/test-auth-master.c 2020-04-11 00:02:17 +0200 Stephan Bosch (4d1c6c0a6e) master: test-auth-master - Move global initialization to main_init/deinit(). M src/master/test-auth-master.c 2020-04-10 23:56:56 +0200 Stephan Bosch (3408f38934) master: test-auth-master - Avoid using sleep()/usleep(). M src/master/test-auth-master.c 2020-04-13 18:39:56 +0200 Stephan Bosch (62d0a3410a) master: test-auth-master - Use lib-signals API. Using signal() is not portable for installing a signal handler. M src/master/test-auth-master.c 2020-04-10 23:54:29 +0200 Stephan Bosch (9a80c1fe66) master: test-auth-master - Ignore SIGPIPE. M src/master/test-auth-master.c 2020-04-13 18:30:54 +0200 Stephan Bosch (0e4019e254) master: test-auth-master - Don't ignore SIGCHLD. M src/master/test-auth-master.c 2020-04-10 23:52:20 +0200 Stephan Bosch (b1e2a6537f) master: test-auth-master - Add log prefixes to distinguish client and server debug messages. M src/master/test-auth-master.c 2020-04-10 23:43:07 +0200 Stephan Bosch (bb2da34c42) master: test-auth-client - Use the new sub-process test API. This makes an effort to terminate server processes gracefully. Killing them bluntly hampers test coverage measurement and valgrind testing. M src/master/test-auth-client.c 2020-04-10 22:17:05 +0200 Stephan Bosch (1c40aa4946) master: test-auth-client - Split off test_run_server/client() from test_run_client_server(). M src/master/test-auth-client.c 2020-04-10 22:07:48 +0200 Stephan Bosch (676a4ea66f) master: test-auth-client - Rename test_server_kill() to test_servers_kill_forced(). M src/master/test-auth-client.c 2020-04-10 21:59:47 +0200 Stephan Bosch (dab562f599) master: test-auth-client - Move global initialization to main_init/deinit(). M src/master/test-auth-client.c 2020-04-10 21:53:06 +0200 Stephan Bosch (03c5dbbd4b) master: test-auth-client - Avoid using sleep()/usleep(). M src/master/test-auth-client.c 2020-04-13 18:37:55 +0200 Stephan Bosch (f1c60f48e7) master: test-auth-client - Use lib-signals API. Using signal() is not portable for installing a signal handler. M src/master/test-auth-client.c 2020-04-10 21:50:16 +0200 Stephan Bosch (581b5c0bc0) master: test-auth-client - Ignore SIGPIPE. M src/master/test-auth-client.c 2020-04-13 18:28:19 +0200 Stephan Bosch (2819e392b8) master: test-auth-client - Don't ignore SIGCHLD. M src/master/test-auth-client.c 2020-04-10 21:48:11 +0200 Stephan Bosch (bd579b1023) master: test-auth-client - Add log prefixes to distinguish client and server debug messages. M src/master/test-auth-client.c 2020-04-11 12:58:10 +0200 Stephan Bosch (205f5cbf7b) master: Reformat test-master-login-auth.c. M src/master/test-master-login-auth.c 2020-04-11 12:53:40 +0200 Stephan Bosch (b4ee4d3cdc) master: Reformat test-auth-master.c. M src/master/test-auth-master.c 2020-04-11 12:42:58 +0200 Stephan Bosch (6e4d82c689) master: Reformat test-auth-client.c. M src/master/test-auth-client.c 2020-05-14 16:05:00 +0200 Stephan Bosch (0890ee4883) lib-smtp: test-smtp-submit - Use the new sub-process test API. This makes an effort to terminate server processes gracefully. Killing them bluntly hampers test coverage measurement and valgrind testing. M src/lib-smtp/test-smtp-submit.c 2020-04-09 16:47:45 +0200 Stephan Bosch (aba5f64eed) lib-smtp: test-smtp-submit - Split off test_run_server/client() from test_run_client_server(). M src/lib-smtp/test-smtp-submit.c 2020-04-09 11:05:10 +0200 Stephan Bosch (990e820062) lib-smtp: test-smtp-submit - Rename test_servers_kill_all() to test_servers_kill_forced(). M src/lib-smtp/test-smtp-submit.c 2020-04-09 10:53:40 +0200 Stephan Bosch (7c9599e3dc) lib-smtp: test-smtp-submit - Move global initialization to main_init/deinit(). M src/lib-smtp/test-smtp-submit.c 2020-04-09 10:56:07 +0200 Stephan Bosch (1dc769d5bb) lib-smtp: test-smtp-submit - Avoid using sleep(). M src/lib-smtp/test-smtp-submit.c 2020-04-13 17:52:09 +0200 Stephan Bosch (96f1ef1504) lib-smtp: test-smtp-submit - Use lib-signals API. Using signal() is not portable for installing a signal handler. M src/lib-smtp/test-smtp-submit.c 2020-04-09 10:40:23 +0200 Stephan Bosch (a1669c00ae) lib-smtp: test-smtp-submit - Ignore SIGPIPE. M src/lib-smtp/test-smtp-submit.c 2020-04-13 17:45:55 +0200 Stephan Bosch (9cb98b69cc) lib-smtp: test-smtp-submit - Don't ignore SIGCHLD. M src/lib-smtp/test-smtp-submit.c 2020-04-09 10:37:28 +0200 Stephan Bosch (945ce4e152) lib-smtp: test-smtp-submit - Add log prefixes to distinguish client and server debug messages. M src/lib-smtp/test-smtp-submit.c 2020-04-09 00:57:15 +0200 Stephan Bosch (856440da77) lib-smtp: test-smtp-server-errors - Use the new sub-process test API. This makes an effort to terminate client processes gracefully. Killing them bluntly hampers test coverage measurement and valgrind testing. M src/lib-smtp/test-smtp-server-errors.c 2020-04-09 00:30:11 +0200 Stephan Bosch (99f3dc5ae2) lib-smtp: test-smtp-server-errors - Split off test_run_client/server() from test_run_client_server(). M src/lib-smtp/test-smtp-server-errors.c 2020-04-09 00:23:46 +0200 Stephan Bosch (f37980b708) lib-smtp: test-smtp-server-errors - Rename test_clients_kill_all() to test_clients_kill_forced(). M src/lib-smtp/test-smtp-server-errors.c 2020-04-09 10:50:03 +0200 Stephan Bosch (eb954e32b1) lib-smtp: test-smtp-server-errors - Move global initialization to main_init/deinit(). M src/lib-smtp/test-smtp-server-errors.c 2020-04-09 00:18:32 +0200 Stephan Bosch (fe2c2c6b4b) lib-smtp: test-smtp-server-errors - Fix name of client_connection_deinit(). M src/lib-smtp/test-smtp-server-errors.c 2020-04-13 15:40:23 +0200 Stephan Bosch (7afecadf1e) lib-smtp: test-smtp-server-errors - Use lib-signals API. Using signal() is not portable for installing a signal handler. M src/lib-smtp/test-smtp-server-errors.c 2020-04-09 00:16:54 +0200 Stephan Bosch (ecf3cca0f0) lib-smtp: test-smtp-server-errors - Ignore SIGPIPE. M src/lib-smtp/test-smtp-server-errors.c 2020-04-13 15:15:34 +0200 Stephan Bosch (6b5e76662d) lib-smtp: test-smtp-server-errors - Remove useless child signal handler. Restructure code to better match equivalent unit tests. M src/lib-smtp/test-smtp-server-errors.c 2020-04-09 00:15:24 +0200 Stephan Bosch (cf5d484a5e) lib-smtp: test-smtp-server-errors - Adjust log prefix code to match other similar unit tests. M src/lib-smtp/test-smtp-server-errors.c 2020-04-08 23:49:31 +0200 Stephan Bosch (6e29b58293) lib-smtp: test-smtp-client-errors - Use the new sub-process test API. This makes an effort to terminate server processes gracefully. Killing them bluntly hampers test coverage measurement and valgrind testing. M src/lib-smtp/test-smtp-client-errors.c 2020-04-08 22:37:59 +0200 Stephan Bosch (fc19d780fd) lib-smtp: test-smtp-client-errors - Split off test_run_server/dns/client() from test_run_client_server(). M src/lib-smtp/test-smtp-client-errors.c 2020-04-08 22:27:46 +0200 Stephan Bosch (ac4ce94d6c) lib-smtp: test-smtp-client-errors - Rename test_servers_kill_all() to test_servers_kill_forced(). M src/lib-smtp/test-smtp-client-errors.c 2020-04-08 22:24:47 +0200 Stephan Bosch (74afe6d2a6) lib-smtp: test-smtp-client-errors - Move global initialization to main_init/deinit(). M src/lib-smtp/test-smtp-client-errors.c 2020-04-08 21:10:08 +0200 Stephan Bosch (d82f9ec0b1) lib-smtp: test-smtp-client-errors - Avoid using sleep(). M src/lib-smtp/test-smtp-client-errors.c 2020-04-13 14:18:05 +0200 Stephan Bosch (a9c1ea5fa1) lib-smtp: test-smtp-client-errors - Use lib-signals API. Using signal() is not portable for installing a signal handler. M src/lib-smtp/test-smtp-client-errors.c 2020-04-08 21:04:32 +0200 Stephan Bosch (462d42a287) lib-smtp: test-smtp-client-errors - Generally ignore SIGPIPE. Remove per-process code that achieves the same. M src/lib-smtp/test-smtp-client-errors.c 2020-04-13 14:12:25 +0200 Stephan Bosch (950da3273d) lib-smtp: test-smtp-client-errors - Don't ignore SIGCHLD. M src/lib-smtp/test-smtp-client-errors.c 2020-04-13 14:44:31 +0200 Stephan Bosch (74c1251a60) lib-smtp: test-smtp-client-errors - Turn server-side payload read error into a debug message. This can readily occur during tests and must not issue a real error message. M src/lib-smtp/test-smtp-client-errors.c 2020-04-08 21:02:18 +0200 Stephan Bosch (735b90a5e5) lib-smtp: test-smtp-client-errors - Add log prefixes to distinguish client and server debug messages. M src/lib-smtp/test-smtp-client-errors.c 2020-04-05 02:40:33 +0200 Stephan Bosch (3343d5e11a) lib-smtp: test-smtp-payload - Use the new sub-process test API. This makes an effort to terminate server processes gracefully. Killing them bluntly hampers test coverage measurement and valgrind testing. M src/lib-smtp/test-smtp-payload.c 2020-04-08 00:04:05 +0200 Stephan Bosch (08fefcfffc) lib-smtp: test-smtp-payload - Split off test_run_client/server() from test_run_client_server(). M src/lib-smtp/test-smtp-payload.c 2020-04-07 23:48:44 +0200 Stephan Bosch (3f02f6ea98) lib-smtp: test-smtp-payload - Adjust log prefix code to match other similar unit tests. M src/lib-smtp/test-smtp-payload.c 2020-04-05 02:34:29 +0200 Stephan Bosch (81be5e7e6b) lib-smtp: test-smtp-payload - Rename test_server_kill() to test_server_kill_forced(). M src/lib-smtp/test-smtp-payload.c 2020-04-05 02:32:48 +0200 Stephan Bosch (671854cfc0) lib-smtp: test-smtp-payload - Move global initialization to main_init/deinit(). M src/lib-smtp/test-smtp-payload.c 2020-04-05 02:25:30 +0200 Stephan Bosch (0fa20bd854) lib-smtp: test-smtp-payload - Call test_files_init/deinit() in test_run_client_server(). M src/lib-smtp/test-smtp-payload.c 2020-04-13 13:28:51 +0200 Stephan Bosch (75305000aa) lib-smtp: test-smtp-payload - Use lib-signals API. Using signal() is not portable for installing a signal handler. M src/lib-smtp/test-smtp-payload.c 2020-04-13 13:26:04 +0200 Stephan Bosch (04097a659f) lib-smtp: test-smtp-payload - Properly exit child process. M src/lib-smtp/test-smtp-payload.c 2020-04-13 13:23:15 +0200 Stephan Bosch (13d7680f2e) lib-smtp: test-smtp-payload - Don't ignore SIGCHLD. M src/lib-smtp/test-smtp-payload.c 2020-04-10 17:30:51 +0200 Stephan Bosch (eebbe6f4b1) lib-master: master-service - Add master_service_deinit_forked(). M src/lib-master/master-service.c M src/lib-master/master-service.h 2020-05-25 17:16:30 +0200 Stephan Bosch (7fa64eb166) lib-smtp: test-smtp-server-errors - Fix "many bad commands" test. It didn't properly handle the two parallel connections. Removed a useless context struct definition. Modified debug message for easier debugging. M src/lib-smtp/test-smtp-server-errors.c 2020-04-09 01:33:22 +0200 Stephan Bosch (3c00c3590b) lib-smtp: Reformat test-smtp-submit.c. M src/lib-smtp/test-smtp-submit.c 2020-04-09 00:07:36 +0200 Stephan Bosch (f22c6c3006) lib-smtp: Reformat test-smtp-server-errors.c. M src/lib-smtp/test-smtp-server-errors.c 2020-04-08 22:05:57 +0200 Stephan Bosch (10667b6a9d) lib-smtp: Reformat test-smtp-client-errors.c. M src/lib-smtp/test-smtp-client-errors.c 2020-04-05 02:22:50 +0200 Stephan Bosch (c8e707ebeb) lib-smtp: Reformat test-smtp-payload.c. M src/lib-smtp/test-smtp-payload.c 2020-05-23 00:36:48 +0200 Stephan Bosch (647188820e) lib-program-client: test-program-client-local - Add test for running client without I/O or timeouts. M src/lib-program-client/test-program-client-local.c 2019-02-21 02:37:41 +0100 Stephan Bosch (be38004f75) lib: child-wait - Mark the SIGCHLD handler as expected when waiting for child. This alows waiting for a child to be the only activity on the ioloop. M src/lib/child-wait.c 2019-02-21 02:34:54 +0100 Stephan Bosch (d39b532db5) lib: lib-signals - Implement lib_signals_set_expected(). This is a promise that the indicated delayed signal will occur eventually, so that the associated ioloop will eventually terminate. This allows the lib-signal io to be alone on the ioloop. M src/lib/lib-signals.c M src/lib/lib-signals.h 2019-02-21 02:40:36 +0100 Stephan Bosch (349029952a) lib-program-client: program-client-local - Restructure program_client_local_disconnect(). Simplify the handling of the program timeout and improve the debug messages. M src/lib-program-client/program-client-local.c 2020-05-13 15:04:45 +0300 Timo Sirainen (9bab1a7ef7) login-proxy: Add proxy_host_immediate_failure_after=