]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
4 years agolib-storage: mailbox_list_default_get_storage_name() - Cleanup shared namespace root...
Timo Sirainen [Thu, 14 Jan 2021 10:30:54 +0000 (12:30 +0200)] 
lib-storage: mailbox_list_default_get_storage_name() - Cleanup shared namespace root handling

4 years agolib-storage: Split off mailbox_list_vname_prepare()
Timo Sirainen [Thu, 14 Jan 2021 10:03:58 +0000 (12:03 +0200)] 
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.

4 years agolib-storage: Remove mailbox_list_unescape_name() by moving its code inline
Timo Sirainen [Thu, 14 Jan 2021 13:22:20 +0000 (15:22 +0200)] 
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.

4 years agolib-storage: Remove mailbox_list_escape_name() by moving its code inline
Timo Sirainen [Thu, 14 Jan 2021 13:20:13 +0000 (15:20 +0200)] 
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.

4 years agolib-storage: Add unit tests for mailbox_list_default_get_{storage_name|vname}()
Timo Sirainen [Wed, 13 Jan 2021 18:55:43 +0000 (20:55 +0200)] 
lib-storage: Add unit tests for mailbox_list_default_get_{storage_name|vname}()

4 years agolib-storage: Rename mailbox_list_settings.broken_char to vname_escape_char
Timo Sirainen [Wed, 13 Jan 2021 16:50:38 +0000 (18:50 +0200)] 
lib-storage: Rename mailbox_list_settings.broken_char to vname_escape_char

This clarifies that it's only used in vnames.

4 years agolib-storage: Rename mailbox_list_settings.escape_char to storage_name_escape_char
Timo Sirainen [Wed, 13 Jan 2021 16:47:11 +0000 (18:47 +0200)] 
lib-storage: Rename mailbox_list_settings.escape_char to storage_name_escape_char

This clarifies that it's only used in storage_names.

4 years agolib-imap: Add imap_utf7_to_utf8_escaped() and imap_escaped_utf8_to_utf7()
Timo Sirainen [Wed, 13 Jan 2021 17:50:50 +0000 (19:50 +0200)] 
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.

4 years agolib-imap: test-imap-utf7 - Simplify test_imap_utf7_non_utf16()
Timo Sirainen [Wed, 13 Jan 2021 17:48:15 +0000 (19:48 +0200)] 
lib-imap: test-imap-utf7 - Simplify test_imap_utf7_non_utf16()

4 years agolib-imap: Move unnecessary shift check to mbase64_decode_to_utf8()
Timo Sirainen [Wed, 13 Jan 2021 17:19:37 +0000 (19:19 +0200)] 
lib-imap: Move unnecessary shift check to mbase64_decode_to_utf8()

4 years agolib-imap: test-imap-utf7 - Improve/clarify testing '&'
Timo Sirainen [Wed, 13 Jan 2021 17:17:18 +0000 (19:17 +0200)] 
lib-imap: test-imap-utf7 - Improve/clarify testing '&'

& is never base64-encoded.

4 years agoconfig: Add unit test for config parser
Aki Tuomi [Mon, 25 Jan 2021 11:32:18 +0000 (13:32 +0200)] 
config: Add unit test for config parser

4 years agoconfig: Extract sources to libconfig.la
Aki Tuomi [Wed, 20 Jan 2021 08:07:56 +0000 (10:07 +0200)] 
config: Extract sources to libconfig.la

Makes unit testing possible

4 years agolib-settings: test-settings - Add tests for settings file
Aki Tuomi [Tue, 19 Jan 2021 09:54:15 +0000 (11:54 +0200)] 
lib-settings: test-settings - Add tests for settings file

4 years agotest-settings-parser: Add test for size
Aki Tuomi [Mon, 18 Jan 2021 13:43:06 +0000 (15:43 +0200)] 
test-settings-parser: Add test for size

4 years agolib-settings: test-settings-parser - Add test for settings parser
Aki Tuomi [Mon, 18 Jan 2021 13:32:51 +0000 (15:32 +0200)] 
lib-settings: test-settings-parser - Add test for settings parser

4 years agolib-settings: Add support for $ENV:name
Aki Tuomi [Mon, 18 Jan 2021 12:11:28 +0000 (14:11 +0200)] 
lib-settings: Add support for $ENV:name

Expands into given environment variable

4 years agoconfig: Add support for $ENV:name
Aki Tuomi [Wed, 22 Jan 2020 12:34:15 +0000 (14:34 +0200)] 
config: Add support for $ENV:name

Expands into given environment variable

4 years agoconfig: Expand multiple variables per line
Aki Tuomi [Wed, 22 Jan 2020 12:33:38 +0000 (14:33 +0200)] 
config: Expand multiple variables per line

Needed to properly support environment variables.

4 years agoconfig: config-parser - Add config_write_keyvariable
Aki Tuomi [Wed, 20 Jan 2021 08:49:23 +0000 (10:49 +0200)] 
config: config-parser - Add config_write_keyvariable

Move code handling key variable expansion to separate function.
Simplifies next commit.

4 years agolib-storage: Make lua methods and functions use the passed in lua_State * directly
Josef 'Jeff' Sipek [Tue, 12 Jan 2021 18:53:19 +0000 (13:53 -0500)] 
lib-storage: Make lua methods and functions use the passed in lua_State * directly

4 years agolib-storage: Make dlua_push_mail() take lua_State * directly
Josef 'Jeff' Sipek [Tue, 12 Jan 2021 19:27:31 +0000 (14:27 -0500)] 
lib-storage: Make dlua_push_mail() take lua_State * directly

4 years agolib-storage: Make dlua_push_mail_user() take lua_State * directly
Josef 'Jeff' Sipek [Tue, 12 Jan 2021 19:26:07 +0000 (14:26 -0500)] 
lib-storage: Make dlua_push_mail_user() take lua_State * directly

4 years agolib-storage: Make lua_storage_cmp() take lua_State * directly
Josef 'Jeff' Sipek [Tue, 12 Jan 2021 18:30:45 +0000 (13:30 -0500)] 
lib-storage: Make lua_storage_cmp() take lua_State * directly

4 years agolib-storage: Make lua_check_storage_mailbox() take lua_State * directly
Josef 'Jeff' Sipek [Tue, 12 Jan 2021 17:59:39 +0000 (12:59 -0500)] 
lib-storage: Make lua_check_storage_mailbox() take lua_State * directly

4 years agolib-storage: Make dlua_push_mailbox() take lua_State * directly
Josef 'Jeff' Sipek [Tue, 12 Jan 2021 17:02:05 +0000 (12:02 -0500)] 
lib-storage: Make dlua_push_mailbox() take lua_State * directly

4 years agomaster: Send instance_name setting to log process
Timo Sirainen [Thu, 7 Jan 2021 16:12:27 +0000 (18:12 +0200)] 
master: Send instance_name setting to log process

This way log process can use it for syslog ident

4 years agocassandra: Fix logging messages with LFs
Timo Sirainen [Mon, 7 Dec 2020 13:58:00 +0000 (15:58 +0200)] 
cassandra: Fix logging messages with LFs

At least some trace level messages had them.

4 years agom4: Fix configuration of libunwind on i386 (and probably other systems).
Stephan Bosch [Sat, 18 Apr 2020 10:56:14 +0000 (12:56 +0200)] 
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.

4 years agolib-imap: imap_bodystructure_write() - Add asserts to check unexpected NULLs inside...
Timo Sirainen [Wed, 25 Mar 2020 14:20:08 +0000 (16:20 +0200)] 
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.

4 years agolib-imap: Add unit test for invalid BODYSTRUCTUREs
Timo Sirainen [Wed, 25 Mar 2020 13:52:29 +0000 (15:52 +0200)] 
lib-imap: Add unit test for invalid BODYSTRUCTUREs

4 years agolib-imap: imap_arg_get/as_nstring() - fail if input is an atom
Timo Sirainen [Wed, 25 Mar 2020 13:52:02 +0000 (15:52 +0200)] 
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

4 years agolib-imap: Don't wrongly accept NILs or atoms when parsing BODYSTRUCTURE
Timo Sirainen [Wed, 25 Mar 2020 13:49:37 +0000 (15:49 +0200)] 
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.

4 years agolib-imap: imap_body_parse_from_bodystructure() - Write size field as atom
Timo Sirainen [Wed, 25 Mar 2020 13:47:51 +0000 (15:47 +0200)] 
lib-imap: imap_body_parse_from_bodystructure() - Write size field as atom

Following changes will break writing it as nstring.

4 years agoimap: SETMETADATA - Explicitly support using atoms for values
Timo Sirainen [Wed, 25 Mar 2020 14:00:08 +0000 (16:00 +0200)] 
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.

4 years agolib: event-filter - Implement event_filter_merge() unit test
Josef 'Jeff' Sipek [Wed, 20 Jan 2021 16:15:18 +0000 (11:15 -0500)] 
lib: event-filter - Implement event_filter_merge() unit test

4 years agolib: event-filter - Use p_strdup() instead of p_strdup_empty() to avoid NULLs
Josef 'Jeff' Sipek [Tue, 12 Jan 2021 16:15:44 +0000 (11:15 -0500)] 
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.

4 years agolib: test-lib - Free event filters
Aki Tuomi [Thu, 21 Jan 2021 07:15:10 +0000 (09:15 +0200)] 
lib: test-lib - Free event filters

Fixes memory leak

Forgotten from 01ccf687d660331ca3e483c90582156757cebb7f

4 years agolib: event-filter - Implement filter boolean expression unit tests
Josef 'Jeff' Sipek [Tue, 19 Jan 2021 18:46:13 +0000 (13:46 -0500)] 
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).

4 years agolib: event-filter - Correct a comment referring to old filter syntax
Josef 'Jeff' Sipek [Tue, 19 Jan 2021 18:42:17 +0000 (13:42 -0500)] 
lib: event-filter - Correct a comment referring to old filter syntax

4 years agolib: event-filter - Add a helper function to get at the filter's boolean expression
Josef 'Jeff' Sipek [Tue, 19 Jan 2021 18:41:45 +0000 (13:41 -0500)] 
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.

4 years agolib: event-filter - Expose internal functions to allow for unit testing
Josef 'Jeff' Sipek [Tue, 19 Jan 2021 18:40:17 +0000 (13:40 -0500)] 
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.

4 years agolib: event-filter - Make NOT operator right associative and higher precedence
Josef 'Jeff' Sipek [Mon, 4 Jan 2021 17:01:28 +0000 (12:01 -0500)] 
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'

4 years agolib-test: fuzzer - Don't crash in targets without ioloop
Philippe Antoine [Thu, 14 Jan 2021 19:31:18 +0000 (20:31 +0100)] 
lib-test: fuzzer - Don't crash in targets without ioloop

4 years agoauth: Makefile.am - Use $(LIBDOVECOT_LUA) instead of redefining it
Timo Sirainen [Mon, 18 Jan 2021 16:53:36 +0000 (17:53 +0100)] 
auth: Makefile.am - Use $(LIBDOVECOT_LUA) instead of redefining it

4 years agoauth: Fix building built-in lua
Timo Sirainen [Mon, 18 Jan 2021 16:53:07 +0000 (17:53 +0100)] 
auth: Fix building built-in lua

It was working only when building as plugin.

4 years agolib: test-buffer - Fix memory leak errors in fatal buffer tests
Timo Sirainen [Mon, 18 Jan 2021 12:46:55 +0000 (13:46 +0100)] 
lib: test-buffer - Fix memory leak errors in fatal buffer tests

4 years agolib-test: Add test_fatal_set_callback()
Timo Sirainen [Mon, 18 Jan 2021 12:46:46 +0000 (13:46 +0100)] 
lib-test: Add test_fatal_set_callback()

4 years agolib-master: test-event-stats - Add test for large event id
Aki Tuomi [Mon, 18 Jan 2021 09:38:04 +0000 (11:38 +0200)] 
lib-master: test-event-stats - Add test for large event id

Ensure UPDATE command syntax is correct when event id is over 1 million

4 years agoindexer: Remove worker-specific request queue
Siavash Tavakoli [Mon, 21 Dec 2020 10:45:32 +0000 (10:45 +0000)] 
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.

4 years agoindexer: Cleanup idle_list from worker pool
Siavash Tavakoli [Sun, 20 Dec 2020 19:45:09 +0000 (19:45 +0000)] 
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.

4 years agoindexer: Disconnect from indexer-worker after each request
Siavash Tavakoli [Mon, 14 Dec 2020 21:39:39 +0000 (21:39 +0000)] 
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.

4 years agolib: array - Make sure it assert-crashes if trying to add more than UINT_MAX elements
Timo Sirainen [Wed, 20 May 2020 08:18:48 +0000 (11:18 +0300)] 
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.

4 years agolib: Add buffer_create_dynamic_max()
Timo Sirainen [Wed, 20 May 2020 08:16:29 +0000 (11:16 +0300)] 
lib: Add buffer_create_dynamic_max()

4 years agolib: hash - Add assert to make sure hash table doesn't grow beyond UINT_MAX nodes
Timo Sirainen [Wed, 20 May 2020 10:42:22 +0000 (13:42 +0300)] 
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.

4 years agoauth: db-lua - Deref script in auth_lua_call_userdb_iterate_init() only once
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:48:37 +0000 (17:48 -0500)] 
auth: db-lua - Deref script in auth_lua_call_userdb_iterate_init() only once

4 years agoauth: db-lua - Deref script in auth_lua_call_userdb_lookup() only once
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:47:57 +0000 (17:47 -0500)] 
auth: db-lua - Deref script in auth_lua_call_userdb_lookup() only once

4 years agoauth: db-lua - Deref script in auth_lua_call_passdb_lookup() only once
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:47:03 +0000 (17:47 -0500)] 
auth: db-lua - Deref script in auth_lua_call_passdb_lookup() only once

4 years agoauth: db-lua - Deref script in auth_lua_call_password_verify() only once
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:46:20 +0000 (17:46 -0500)] 
auth: db-lua - Deref script in auth_lua_call_password_verify() only once

4 years agoauth: db-lua - Make auth_lua_dovecot_auth_register() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:44:16 +0000 (17:44 -0500)] 
auth: db-lua - Make auth_lua_dovecot_auth_register() take lua_State * directly

4 years agoauth: db-lua - Make auth_lua_auth_request_register() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:43:36 +0000 (17:43 -0500)] 
auth: db-lua - Make auth_lua_auth_request_register() take lua_State * directly

4 years agoauth: db-lua - Make auth_lua_call_lookup_finish() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:39:24 +0000 (17:39 -0500)] 
auth: db-lua - Make auth_lua_call_lookup_finish() take lua_State * directly

4 years agoauth: db-lua - Make auth_lua_export_passdb_table() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:37:10 +0000 (17:37 -0500)] 
auth: db-lua - Make auth_lua_export_passdb_table() take lua_State * directly

4 years agoauth: db-lua - Make auth_lua_call_lookup() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:35:21 +0000 (17:35 -0500)] 
auth: db-lua - Make auth_lua_call_lookup() take lua_State * directly

4 years agoauth: db-lua - Make auth_lua_export_userdb_table() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:32:50 +0000 (17:32 -0500)] 
auth: db-lua - Make auth_lua_export_userdb_table() take lua_State * directly

4 years agoauth: db-lua - Make auth_lua_export_table() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:31:59 +0000 (17:31 -0500)] 
auth: db-lua - Make auth_lua_export_table() take lua_State * directly

4 years agoauth: db-lua - Make auth_lua_push_auth_request() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 22:30:38 +0000 (17:30 -0500)] 
auth: db-lua - Make auth_lua_push_auth_request() take lua_State * directly

4 years agoauth: db-lua - Make lua methods and functions use the passed in lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 21:53:08 +0000 (16:53 -0500)] 
auth: db-lua - Make lua methods and functions use the passed in lua_State * directly

4 years agoauth: db-lua - Make auth_lua_check_auth_request() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 21:50:50 +0000 (16:50 -0500)] 
auth: db-lua - Make auth_lua_check_auth_request() take lua_State * directly

4 years agolib-lua: Use dlua_register()
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 21:43:19 +0000 (16:43 -0500)] 
lib-lua: Use dlua_register()

4 years agolib-lua: Add dlua_register()
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 21:41:21 +0000 (16:41 -0500)] 
lib-lua: Add dlua_register()

4 years agolib-storage: Make lua methods and functions use the passed in lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 00:54:10 +0000 (19:54 -0500)] 
lib-storage: Make lua methods and functions use the passed in lua_State * directly

4 years agolib-storage: Make lua_storage_mail_user_set_metadata_unset() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 01:01:30 +0000 (20:01 -0500)] 
lib-storage: Make lua_storage_mail_user_set_metadata_unset() take lua_State * directly

4 years agolib-storage: Make lua_check_storage_mail_user() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 00:59:13 +0000 (19:59 -0500)] 
lib-storage: Make lua_check_storage_mail_user() take lua_State * directly

4 years agolib-storage: Make lua_check_storage_mail() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 00:51:57 +0000 (19:51 -0500)] 
lib-storage: Make lua_check_storage_mail() take lua_State * directly

4 years agolib-lua: Make dlua_dump_stack() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 18:07:52 +0000 (13:07 -0500)] 
lib-lua: Make dlua_dump_stack() take lua_State * directly

4 years agolib-lua: Move dlua_dump_stack() prototype to private header
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 18:06:57 +0000 (13:06 -0500)] 
lib-lua: Move dlua_dump_stack() prototype to private header

4 years agolib-lua: Make dlua_check_event() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 18:00:10 +0000 (13:00 -0500)] 
lib-lua: Make dlua_check_event() take lua_State * directly

4 years agolib-lua: Make dlua_push_event() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 18:00:00 +0000 (13:00 -0500)] 
lib-lua: Make dlua_push_event() take lua_State * directly

4 years agolib-lua: Move dlua_{check,push}_event() prototypes to private header
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 17:57:26 +0000 (12:57 -0500)] 
lib-lua: Move dlua_{check,push}_event() prototypes to private header

4 years agolib-lua: Make dlua_getdovecot() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 17:55:25 +0000 (12:55 -0500)] 
lib-lua: Make dlua_getdovecot() take lua_State * directly

4 years agolib-lua: Make dlua_setmembers() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 17:53:44 +0000 (12:53 -0500)] 
lib-lua: Make dlua_setmembers() take lua_State * directly

4 years agolib-lua: Make lua methods and functions use the passed in lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 00:23:13 +0000 (19:23 -0500)] 
lib-lua: Make lua methods and functions use the passed in lua_State * directly

4 years agolib-lua: Make dlua_push_event_passthrough() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 00:33:55 +0000 (19:33 -0500)] 
lib-lua: Make dlua_push_event_passthrough() take lua_State * directly

4 years agolib-lua: Make dlua_check_event_passthrough() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 00:32:19 +0000 (19:32 -0500)] 
lib-lua: Make dlua_check_event_passthrough() take lua_State * directly

4 years agolib-lua: Make dlua_event_log() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 00:18:33 +0000 (19:18 -0500)] 
lib-lua: Make dlua_event_log() take lua_State * directly

4 years agolib-lua: Make dlua_get_file_line() take lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 00:16:44 +0000 (19:16 -0500)] 
lib-lua: Make dlua_get_file_line() take lua_State * directly

4 years agolib-lua: Make DLUA_REQUIRE_ARGS*() take the lua_State * directly
Josef 'Jeff' Sipek [Thu, 17 Dec 2020 00:05:04 +0000 (19:05 -0500)] 
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.

4 years agoimap: test-imap-client-hibernate - Remove dead assignment
Timo Sirainen [Wed, 13 Jan 2021 10:54:09 +0000 (12:54 +0200)] 
imap: test-imap-client-hibernate - Remove dead assignment

4 years agoutil: dovecot-sysreport: Use "uname -n" instead of "hostname" for portability
Geert Hendrickx [Fri, 9 Oct 2020 19:07:40 +0000 (21:07 +0200)] 
util: dovecot-sysreport: Use "uname -n" instead of "hostname" for portability

hostname is not defined by POSIX, so not guaranteed to work.

4 years agolib-mail: mail-html2text: HTML entity lookup must be case-sensitive
Siavash Tavakoli [Wed, 23 Dec 2020 12:50:33 +0000 (12:50 +0000)] 
lib-mail: mail-html2text: HTML entity lookup must be case-sensitive

HTML entities are case-sensitive.

4 years agolib-storage: Add unit test for mailbox-list error handling
Timo Sirainen [Thu, 30 Jan 2020 11:50:30 +0000 (13:50 +0200)] 
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.

4 years agolib-storage: test-mail-storage - Split overlong lines
Timo Sirainen [Sat, 22 Feb 2020 10:01:45 +0000 (12:01 +0200)] 
lib-storage: test-mail-storage - Split overlong lines

4 years agolib-storage: Change mailbox_list_set_error/critical() to work the same as storage's
Timo Sirainen [Thu, 30 Jan 2020 11:48:26 +0000 (13:48 +0200)] 
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.

4 years agolib-storage: mailbox_list_get_last_error() - Handle unexpected situations better
Timo Sirainen [Fri, 24 Jan 2020 11:50:50 +0000 (13:50 +0200)] 
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.

4 years agolib-storage: Detect corrupted mail size when calculating body size
Timo Sirainen [Thu, 22 Oct 2020 19:49:56 +0000 (22:49 +0300)] 
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.

4 years agostats: openmetrics: Do not duplicate counter and duration metrics for histograms
Siavash Tavakoli [Sun, 22 Nov 2020 19:16:03 +0000 (19:16 +0000)] 
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.

4 years agostats: Make exported metrics compliant with OpenMetrics standards
Manuel Rüger [Mon, 23 Nov 2020 18:22:22 +0000 (18:22 +0000)] 
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.

4 years agoindexer, auth: Set indexer-worker and auth-worker services' type=worker
Timo Sirainen [Tue, 22 Dec 2020 11:23:45 +0000 (13:23 +0200)] 
indexer, auth: Set indexer-worker and auth-worker services' type=worker

4 years agolib-master, master: Add "worker" service type
Timo Sirainen [Mon, 21 Dec 2020 19:24:50 +0000 (21:24 +0200)] 
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.