]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Markus Valentin [Thu, 20 May 2021 12:27:46 +0000 (14:27 +0200)]
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.
Markus Valentin [Wed, 19 May 2021 13:12:35 +0000 (15:12 +0200)]
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.
Markus Valentin [Wed, 19 May 2021 13:11:40 +0000 (15:11 +0200)]
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.
Markus Valentin [Wed, 19 May 2021 13:09:24 +0000 (15:09 +0200)]
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.
Markus Valentin [Tue, 25 May 2021 14:59:31 +0000 (16:59 +0200)]
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.
Markus Valentin [Tue, 25 May 2021 14:45:13 +0000 (16:45 +0200)]
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.
Markus Valentin [Tue, 25 May 2021 14:29:10 +0000 (16:29 +0200)]
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.
Markus Valentin [Wed, 19 May 2021 12:52:36 +0000 (14:52 +0200)]
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.
Markus Valentin [Tue, 25 May 2021 10:40:55 +0000 (12:40 +0200)]
imap-acl: Add imapc_acl_get_mailbox_error
Allows to retrieve full mailbox error.
Markus Valentin [Tue, 25 May 2021 09:19:47 +0000 (11:19 +0200)]
imap-acl: Split off imap_acl_cmd_myrights from cmd_myrights
Markus Valentin [Thu, 20 May 2021 11:47:55 +0000 (13:47 +0200)]
imap-acl: Split acl_mailbox_open_as_admin
This allows easier implementation of the imap-acl proxying.
Markus Valentin [Thu, 20 May 2021 21:21:10 +0000 (23:21 +0200)]
imap-acl: Add imap_acl_storage with module context
Markus Valentin [Tue, 25 May 2021 10:38:50 +0000 (12:38 +0200)]
imapc: Add imapc_mail_error_to_resp_text_code to access error msg by enum
Markus Valentin [Wed, 26 May 2021 08:31:26 +0000 (10:31 +0200)]
imapc: Change function signature prefix to imapc_resp_text_code_parse
Markus Valentin [Thu, 20 May 2021 21:18:30 +0000 (23:18 +0200)]
imapc: Add imapc_storage_client_unregister_untagged function
Markus Valentin [Tue, 18 May 2021 14:26:46 +0000 (16:26 +0200)]
imapc: Add imapc_features=acl
In order to allow proxying IMAP ACL commands to a remote backend
Timo Sirainen [Fri, 21 May 2021 17:23:57 +0000 (19:23 +0200)]
lib: test-event-filter-*: Hide details of tests unless they fail
This removes ~14k lines of output from test-lib run.
Timo Sirainen [Fri, 21 May 2021 13:11:45 +0000 (16:11 +0300)]
imap: Send tagged login reply before finalizing user initialization
Broken by
5fc66f182ff6941639d30372b414c1b39ae1e67e
Timo Sirainen [Fri, 21 May 2021 13:23:36 +0000 (16:23 +0300)]
m4, dovecot-config: Add LIBDOVECOT_LUA_INCLUDE
This allows building plugins that use lib-lua against uninstalled Dovecot
source code tree.
Josef 'Jeff' Sipek [Thu, 20 May 2021 15:05:37 +0000 (11:05 -0400)]
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.
Josef 'Jeff' Sipek [Thu, 20 May 2021 14:24:35 +0000 (10:24 -0400)]
lib: event filter - Allow '?' in filter language tokens
Without this, it is not possible to use '?' wildcards without quoting the
value.
Timo Sirainen [Tue, 18 May 2021 14:44:08 +0000 (17:44 +0300)]
dict-sql: Support SQL_DB_FLAG_ON_CONFLICT_DO
Timo Sirainen [Tue, 18 May 2021 14:40:00 +0000 (17:40 +0300)]
lib-sql: Add SQL_DB_FLAG_ON_CONFICT_DO for new enough sqlite and pgsql
Timo Sirainen [Tue, 18 May 2021 14:21:59 +0000 (17:21 +0300)]
lib-sql: sqlpool: Implement get_flags() as a wrapper to the real db
Timo Sirainen [Tue, 18 May 2021 14:15:02 +0000 (17:15 +0300)]
lib: test-array - Add more unit tests for array_foreach*()
Make sure that the elem value is as expected after the loop completes.
Timo Sirainen [Tue, 18 May 2021 14:08:51 +0000 (17:08 +0300)]
lib-sql: Add sql_db_vfuncs.get_flags()
Timo Sirainen [Tue, 18 May 2021 14:02:30 +0000 (17:02 +0300)]
dict-sql: Use SQL_DB_FLAG_ON_DUPLICATE_KEY
Instead of hardcoding mysql check.
Timo Sirainen [Tue, 18 May 2021 14:00:44 +0000 (17:00 +0300)]
lib-sql: Add SQL_DB_FLAG_ON_DUPLICATE_KEY flag for MySQL
Aki Tuomi [Mon, 24 May 2021 15:55:28 +0000 (18:55 +0300)]
auth: mech-oauth2 - Iterate fields in safer manner
Static analyser wasn't happy about the previous way.
Stephan Bosch [Mon, 9 Nov 2020 11:29:16 +0000 (12:29 +0100)]
lib-smtp: smtp-server-recipient - Remove smtp_server_recipient_initialize().
It is no longer needed.
Stephan Bosch [Mon, 9 Nov 2020 11:29:29 +0000 (12:29 +0100)]
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.
Timo Sirainen [Fri, 21 May 2021 15:20:10 +0000 (18:20 +0300)]
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.
Timo Sirainen [Fri, 21 May 2021 15:13:08 +0000 (18:13 +0300)]
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.
Stephan Bosch [Sun, 16 May 2021 23:24:31 +0000 (01:24 +0200)]
lib-smtp: test-smtp-payload - Double the client progress timeout.
Otherwise, SSL tests can fail on systems with low entropy.
Stephan Bosch [Wed, 21 Apr 2021 01:02:38 +0000 (03:02 +0200)]
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)
Stephan Bosch [Thu, 22 Apr 2021 10:13:35 +0000 (12:13 +0200)]
lib-smtp: smtp-client-transaction - Properly handle pending failure upon smtp_client_transaction_send_reset().
Stephan Bosch [Thu, 22 Apr 2021 10:03:59 +0000 (12:03 +0200)]
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.
Stephan Bosch [Thu, 22 Apr 2021 09:53:30 +0000 (11:53 +0200)]
lib-smtp: smtp-client-connection - Split off smtp_client_connection_transactions_fail_reply().
Stephan Bosch [Thu, 22 Apr 2021 10:36:18 +0000 (12:36 +0200)]
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.
Stephan Bosch [Thu, 22 Apr 2021 10:32:38 +0000 (12:32 +0200)]
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.
Stephan Bosch [Thu, 22 Apr 2021 10:09:11 +0000 (12:09 +0200)]
lib-smtp: test-smtp-payload - Finish client transaction only when it finishes completely.
Stephan Bosch [Sun, 16 May 2021 23:13:36 +0000 (01:13 +0200)]
lib-smtp: Reformat smtp-client-transaction.c.
Stephan Bosch [Thu, 22 Apr 2021 09:46:30 +0000 (11:46 +0200)]
lib-smtp: Reformat smtp-client-connection.c.
Aki Tuomi [Mon, 10 May 2021 19:37:44 +0000 (22:37 +0300)]
auth: oauth2 - Support passing openid-configuration URL to client on failure
Aki Tuomi [Mon, 10 May 2021 19:29:23 +0000 (22:29 +0300)]
auth: mech-oauth2 - Pass error fields as array
Makes it easier to add fields to it later on.
Timo Sirainen [Fri, 21 May 2021 11:42:07 +0000 (14:42 +0300)]
imap: copy/move: Fix memory leak when no messages were found
Timo Sirainen [Thu, 11 Feb 2021 23:22:25 +0000 (01:22 +0200)]
doveadm: Delay reading settings until doveadm plugins are loaded
Timo Sirainen [Thu, 11 Feb 2021 23:54:48 +0000 (01:54 +0200)]
doveadm: Add doveadm_setting_roots_*() API for plugins to register settings
Timo Sirainen [Mon, 15 Feb 2021 15:11:07 +0000 (17:11 +0200)]
doveadm: Move settings reading code into doveadm-settings.c
This code is now shared between doveadm and doveadm-server.
Timo Sirainen [Fri, 12 Feb 2021 17:17:25 +0000 (19:17 +0200)]
lib-master: Add master_service_settings_input.extra_modules
This allows specifying more than one module.
Timo Sirainen [Fri, 12 Feb 2021 17:15:44 +0000 (19:15 +0200)]
lib-master: master_service_exec_config() - Build argv using dynamic array
Aki Tuomi [Mon, 10 May 2021 21:07:24 +0000 (00:07 +0300)]
auth: auth-worker - Respect service_count
If service_count is set, then auth-worker will stop after
given number of requests.
Timo Sirainen [Thu, 20 May 2021 12:54:04 +0000 (15:54 +0300)]
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.
Timo Sirainen [Thu, 20 May 2021 12:42:45 +0000 (15:42 +0300)]
imap: Send initial tagged reply directly using ostream
This simplifies the following commits.
Timo Sirainen [Thu, 20 May 2021 10:22:18 +0000 (13:22 +0300)]
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
Timo Sirainen [Thu, 20 May 2021 10:16:40 +0000 (13:16 +0300)]
imap: Split client_add_input_capability() into two functions
Timo Sirainen [Thu, 20 May 2021 10:14:00 +0000 (13:14 +0300)]
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.
Timo Sirainen [Mon, 8 Mar 2021 14:45:08 +0000 (16:45 +0200)]
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.
Timo Sirainen [Mon, 8 Mar 2021 14:44:31 +0000 (16:44 +0200)]
pop3: Move finishing istream to client_create_finish()
Timo Sirainen [Mon, 8 Mar 2021 14:55:49 +0000 (16:55 +0200)]
imap: Handle pipelined input from imap-hibernate via istream-concat
Similarly to the previous commit, this fixes issues with rawlog.
Timo Sirainen [Mon, 8 Mar 2021 14:37:15 +0000 (16:37 +0200)]
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.
Timo Sirainen [Mon, 8 Mar 2021 14:33:50 +0000 (16:33 +0200)]
imap: Move iostream-rawlog creation to client_create_finish()
This allows the caller to modify the istream before rawlog.
Timo Sirainen [Mon, 8 Mar 2021 14:33:33 +0000 (16:33 +0200)]
lib: Add i_stream_copy_fd()
Markus Valentin [Fri, 14 May 2021 13:57:20 +0000 (15:57 +0200)]
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
Aki Tuomi [Wed, 12 May 2021 16:06:27 +0000 (19:06 +0300)]
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
Markus Valentin [Fri, 30 Apr 2021 09:34:51 +0000 (11:34 +0200)]
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.
Markus Valentin [Thu, 6 May 2021 08:18:10 +0000 (10:18 +0200)]
acl: Move static acl_namespace_is_ignored
Timo Sirainen [Thu, 18 Feb 2021 10:41:51 +0000 (12:41 +0200)]
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.
Timo Sirainen [Thu, 18 Feb 2021 10:33:06 +0000 (12:33 +0200)]
lib-program-client: Rename "exit_code" to "exit_status"
exit_code typically refers to the numeric 0..255 value that processes exit
with.
Timo Sirainen [Thu, 18 Feb 2021 10:30:50 +0000 (12:30 +0200)]
lib-program-client: Move enum program_client_exit_code to public .h file
Aki Tuomi [Mon, 10 May 2021 16:46:53 +0000 (19:46 +0300)]
lib-lua: dlua-dovecot - Ref event on push
Matches with unref on __gc.
Aki Tuomi [Mon, 10 May 2021 16:23:48 +0000 (19:23 +0300)]
lib-lua: test-lua - Use bool for expected_isnum in check_tointegerx_compat
Aki Tuomi [Mon, 10 May 2021 16:21:50 +0000 (19:21 +0300)]
lib-lua: Define lua_isinteger as boolean function
Aki Tuomi [Mon, 19 Apr 2021 11:51:05 +0000 (14:51 +0300)]
lib-lua: Fix error reporting for script loading
Aki Tuomi [Mon, 19 Apr 2021 11:45:56 +0000 (14:45 +0300)]
lib-lua: Use dluaL_error for luaL_error
Aki Tuomi [Fri, 16 Apr 2021 10:19:26 +0000 (13:19 +0300)]
lib-lua: Fix luaL_error usage
Aki Tuomi [Fri, 16 Apr 2021 10:11:20 +0000 (13:11 +0300)]
lib-lua: Add dluaL_error
Aki Tuomi [Fri, 16 Apr 2021 10:10:41 +0000 (13:10 +0300)]
lib-lua: dlua-script - Add dlua_pushfstring
Uses full sprintf
Aki Tuomi [Thu, 15 Apr 2021 08:19:52 +0000 (11:19 +0300)]
lib-lua: dlua-wrapper - Constify extra functions
Timo Sirainen [Tue, 11 May 2021 14:53:57 +0000 (16:53 +0200)]
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.
Timo Sirainen [Wed, 5 May 2021 09:45:25 +0000 (12:45 +0300)]
lib: abort() on unexpected exit()
This can especially be useful in catching bugs in Lua script that could
unexpectedly exit.
Timo Sirainen [Wed, 5 May 2021 09:44:03 +0000 (12:44 +0300)]
global: Replace exit() with lib_exit()
Stephan Bosch [Wed, 14 Apr 2021 08:45:55 +0000 (10:45 +0200)]
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.
Josef 'Jeff' Sipek [Fri, 30 Apr 2021 20:59:50 +0000 (16:59 -0400)]
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.
Josef 'Jeff' Sipek [Fri, 30 Apr 2021 20:39:15 +0000 (16:39 -0400)]
lib: event filter - Rename EVENT_FILTER_NODE_TYPE_EVENT_FIELD to denote wildcard matching
Josef 'Jeff' Sipek [Fri, 30 Apr 2021 16:41:55 +0000 (12:41 -0400)]
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.
Josef 'Jeff' Sipek [Fri, 30 Apr 2021 16:44:17 +0000 (12:44 -0400)]
lib: event filter - Rename EVENT_FILTER_NODE_TYPE_EVENT_NAME to denote wildcard matching
Josef 'Jeff' Sipek [Fri, 30 Apr 2021 18:09:10 +0000 (14:09 -0400)]
lib: Add wildcard_is_literal to check if a mask has * or ?
Timo Sirainen [Mon, 10 May 2021 08:26:54 +0000 (11:26 +0300)]
lib: test-env-util - Make static analyzer happy
Aki Tuomi [Thu, 6 May 2021 18:25:54 +0000 (21:25 +0300)]
lib-dict: dict-lua - Don't yield again until previous one has completed
Aki Tuomi [Tue, 4 May 2021 09:15:55 +0000 (12:15 +0300)]
lib-dict: dict-lua - Use absolute stack positions for arguments
Aki Tuomi [Wed, 5 May 2021 10:40:29 +0000 (13:40 +0300)]
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.
Timo Sirainen [Wed, 5 May 2021 15:18:29 +0000 (18:18 +0300)]
lib: Add unit tests to env-util
Timo Sirainen [Wed, 20 Jan 2021 18:53:53 +0000 (20:53 +0200)]
lib-index: Use env_put() instead of putenv() directly
Timo Sirainen [Wed, 20 Jan 2021 18:51:56 +0000 (20:51 +0200)]
configure, lib: Remove workarounds for unsetenv()
It's in POSIX.1-2001 and available on all modern systems.
Timo Sirainen [Wed, 20 Jan 2021 18:48:24 +0000 (20:48 +0200)]
lib: env_put() - Use setenv() instead of putenv()
It's already in POSIX.1-2001 so it should be available everywhere.
Timo Sirainen [Wed, 20 Jan 2021 18:46:27 +0000 (20:46 +0200)]
lib, global: Change env_put() API to take name,value pair
Timo Sirainen [Wed, 20 Jan 2021 18:45:11 +0000 (20:45 +0200)]
lib-program-client, script: Use env_put_array()
Timo Sirainen [Wed, 20 Jan 2021 18:42:40 +0000 (20:42 +0200)]
lib: Add env_put_array()
Timo Sirainen [Tue, 20 Apr 2021 16:06:19 +0000 (18:06 +0200)]
util/dovecot-sysreport: Finish report even if doveadm calls fail
It can be useful to generate the report even when dovecot isn't running.