2021-08-05 18:25:31 +0300 Timo Sirainen (7e2e900c1a) NEWS: Add 100% master process CPU item M NEWS 2021-08-05 17:48:42 +0300 Timo Sirainen (9ac07b89c1) 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 (07a1c92747) 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-08-04 17:24:00 +0300 Timo Sirainen (40ae513d78) fts: Fix internal error when fts_index_timeout is set Broken by cf114f90e0ba25c18db846ee582e3a130bd52949 M src/plugins/fts/fts-indexer.c 2021-08-04 12:51:19 +0300 Timo Sirainen (5efa307f2b) NEWS: Updates for v2.3.16 M NEWS 2021-06-14 12:47:15 +0300 Timo Sirainen (1c0653a7bd) NEWS: Updates for v2.3.15 M NEWS 2021-05-24 14:03:57 +0300 Aki Tuomi (63d1dc03d8) NEWS: Add news for 2.3.14.1 M NEWS 2021-08-03 11:44:06 +0300 Martti Rannanjärvi (2e0f58a1db) 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 (cd85976845) 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 (c27d091a0d) 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-22 11:26:10 +0300 Aki Tuomi (9a312ebd21) 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 2020-12-03 19:20:32 +0200 Timo Sirainen (214157dd82) 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-12 14:26:38 +0200 Markus Valentin (53fafc97c3) 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-13 12:01:47 +0300 Aki Tuomi (639cd6f517) configure: Set version to 2.3.16 M configure.ac 2021-07-12 13:40:58 +0300 Aki Tuomi (3697bbaf77) 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 (e1b0b343c6) 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 (bd4ec646cc) 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 (321c3f31be) 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-02 00:40:19 +0200 Stephan Bosch (0e0ead994c) 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-07-01 10:46:05 +0200 Markus Valentin (604b879dd7) 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-15 12:21:22 +0200 Markus Valentin (b9a96d3f07) 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 (b05e4d4497) 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 (e4fb1de76f) 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-06-22 11:52:02 -0600 Michael M Slusarz (954db37d6b) 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-25 14:52:11 +0200 Markus Valentin (ab3757e44e) 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 (8bd4e7fe80) lib-fs: fs-metawrap - Expect fs_stat to return size 0 for empty file M src/lib-fs/test-fs-metawrap.c 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=