]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
4 years agolib-storage: test-mail-storage: Separate test cases for "LAYOUT=INDEX"
Siavash Tavakoli [Thu, 11 Mar 2021 17:55:08 +0000 (17:55 +0000)] 
lib-storage: test-mail-storage: Separate test cases for "LAYOUT=INDEX"

With default escaping for "INDEX" layout, more mailbox name are accepted.

4 years agolib-storage: mailbox-list: Add default storage name escaping for index layout
Siavash Tavakoli [Mon, 22 Feb 2021 15:29:30 +0000 (15:29 +0000)] 
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.

4 years agolib-storage: Rename mailbox_list_index_node.name to raw_name
Siavash Tavakoli [Fri, 26 Feb 2021 16:03:50 +0000 (16:03 +0000)] 
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".

4 years agolib-storage: Add mailbox list index alt separator
Siavash Tavakoli [Thu, 11 Mar 2021 12:31:52 +0000 (12:31 +0000)] 
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.

4 years agologin-common: Finish freeing the client when anvil lookup is pending at destroy
Timo Sirainen [Tue, 16 Mar 2021 12:37:54 +0000 (14:37 +0200)] 
login-common: Finish freeing the client when anvil lookup is pending at destroy

Broken by f32daf5ac9eaa886e28659965fc0156b52b60bda

4 years agologin-common: Assert-crash at deinit if there are still referenced clients
Timo Sirainen [Tue, 16 Mar 2021 12:37:38 +0000 (14:37 +0200)] 
login-common: Assert-crash at deinit if there are still referenced clients

4 years agologin-common: Track referenced but destroyed clients in a linked list
Timo Sirainen [Tue, 16 Mar 2021 12:36:35 +0000 (14:36 +0200)] 
login-common: Track referenced but destroyed clients in a linked list

This helps debugging.

4 years agolib: test-cpu-limit - Increase ALLOW_MSECS_ABOVE further
Timo Sirainen [Thu, 11 Mar 2021 11:00:56 +0000 (13:00 +0200)] 
lib: test-cpu-limit - Increase ALLOW_MSECS_ABOVE further

1500 was still not enough to prevent random failures.

4 years agolib: cpu-limit - Redesign the API
Timo Sirainen [Mon, 15 Mar 2021 16:18:07 +0000 (18:18 +0200)] 
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.

4 years agolib: cpu-limit - Split off cpu_limit_get_usage_msecs_with()
Timo Sirainen [Mon, 15 Mar 2021 15:22:00 +0000 (17:22 +0200)] 
lib: cpu-limit - Split off cpu_limit_get_usage_msecs_with()

4 years agolib: cpu-limit - Move cpu_limit_get_usage_msecs()
Timo Sirainen [Mon, 15 Mar 2021 15:21:03 +0000 (17:21 +0200)] 
lib: cpu-limit - Move cpu_limit_get_usage_msecs()

4 years agolib: cpu-limit - Update comments related to nesting
Timo Sirainen [Mon, 15 Mar 2021 14:50:25 +0000 (16:50 +0200)] 
lib: cpu-limit - Update comments related to nesting

4 years agolib: cpu_limit_get_usage_[m]secs() - Add type parameter
Timo Sirainen [Mon, 15 Mar 2021 13:42:56 +0000 (15:42 +0200)] 
lib: cpu_limit_get_usage_[m]secs() - Add type parameter

It can now return user CPU, system CPU or both usages.

4 years agolib: cpu-time - Use the original struct rusage as the initial_usage
Timo Sirainen [Mon, 15 Mar 2021 13:37:55 +0000 (15:37 +0200)] 
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.

4 years agolib: test-cpu-limit - Fix nested limit asserts
Timo Sirainen [Mon, 15 Mar 2021 16:00:55 +0000 (18:00 +0200)] 
lib: test-cpu-limit - Fix nested limit asserts

4 years agolib-imap: Handle empty lists in IMAP BODYSTRUCTURE parsing as invalid
Timo Sirainen [Wed, 10 Mar 2021 15:56:12 +0000 (17:56 +0200)] 
lib-imap: Handle empty lists in IMAP BODYSTRUCTURE parsing as invalid

They should be NIL instead of () if they're empty.

4 years agolib-imap: Fix assert-crash if parsing invalid BODYSTRUCTURE with empty Content-Langua...
Timo Sirainen [Wed, 10 Mar 2021 15:40:47 +0000 (17:40 +0200)] 
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)

4 years agolib-imap: test-imap-bodystructure - imap_bodystructure_parse() - Test returned error
Timo Sirainen [Wed, 10 Mar 2021 15:39:48 +0000 (17:39 +0200)] 
lib-imap: test-imap-bodystructure - imap_bodystructure_parse() - Test returned error

4 years agolib-lua: Error out the build if using Lua 5.2
Josef 'Jeff' Sipek [Thu, 11 Mar 2021 18:13:24 +0000 (13:13 -0500)] 
lib-lua: Error out the build if using Lua 5.2

4 years agoGlobal: Remove support for Lua 5.2
Josef 'Jeff' Sipek [Thu, 11 Mar 2021 18:13:03 +0000 (13:13 -0500)] 
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.

4 years agom4: Allow explict override of lua version
Josef 'Jeff' Sipek [Tue, 9 Mar 2021 15:53:50 +0000 (10:53 -0500)] 
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

4 years agolib-storage: Preserve last-rename-stamp when rebuilding index
Timo Sirainen [Tue, 9 Mar 2021 16:40:32 +0000 (18:40 +0200)] 
lib-storage: Preserve last-rename-stamp when rebuilding index

4 years agolib-storage: Don't trust last-rename-stamp that is too far into the future
Timo Sirainen [Tue, 9 Mar 2021 16:42:38 +0000 (18:42 +0200)] 
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.

4 years agolib-storage: Preserve hdr-pop3-uidl when rebuilding index
Timo Sirainen [Tue, 9 Mar 2021 16:37:51 +0000 (18:37 +0200)] 
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.

4 years agolib-storage: Convert index_rebuild_box_name_header() into generic index_rebuild_box_p...
Timo Sirainen [Tue, 9 Mar 2021 16:36:35 +0000 (18:36 +0200)] 
lib-storage: Convert index_rebuild_box_name_header() into generic index_rebuild_box_preserve_header()

4 years agodoveadm dump: Support hdr-pop3-uidl index header extension
Timo Sirainen [Mon, 11 May 2020 14:41:24 +0000 (17:41 +0300)] 
doveadm dump: Support hdr-pop3-uidl index header extension

4 years agodoveadm dump: Include mail-storage-private.h to get easier access to some structs
Timo Sirainen [Mon, 11 May 2020 14:40:29 +0000 (17:40 +0300)] 
doveadm dump: Include mail-storage-private.h to get easier access to some structs

Avoids having to duplicate the structs.

4 years agoauth: userdb_parse_[ug]id() - Fix error logging to use events properly
Timo Sirainen [Wed, 10 Mar 2021 20:08:24 +0000 (22:08 +0200)] 
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.

4 years agoauth: Use auth_request.event for logging whenever possible
Timo Sirainen [Thu, 31 Oct 2019 14:39:26 +0000 (16:39 +0200)] 
auth: Use auth_request.event for logging whenever possible

4 years agoauth: auth-client-connection: Log all errors via events
Timo Sirainen [Thu, 31 Oct 2019 14:31:55 +0000 (16:31 +0200)] 
auth: auth-client-connection: Log all errors via events

4 years agoauth: auth-worker-server: Log errors via events
Timo Sirainen [Thu, 31 Oct 2019 14:29:22 +0000 (16:29 +0200)] 
auth: auth-worker-server: Log errors via events

4 years agoauth: auth-request-handler: Log errors via events
Timo Sirainen [Thu, 31 Oct 2019 14:21:15 +0000 (16:21 +0200)] 
auth: auth-request-handler: Log errors via events

4 years agoauth: authdb_event() - Use const pointer
Timo Sirainen [Thu, 31 Oct 2019 14:18:15 +0000 (16:18 +0200)] 
auth: authdb_event() - Use const pointer

4 years agoauth: Replace auth_master_log_error() with e_error()
Timo Sirainen [Thu, 31 Oct 2019 14:14:09 +0000 (16:14 +0200)] 
auth: Replace auth_master_log_error() with e_error()

4 years agoauth: auth-worker-client: Log errors via events
Timo Sirainen [Thu, 31 Oct 2019 14:21:35 +0000 (16:21 +0200)] 
auth: auth-worker-client: Log errors via events

4 years agoauth: auth-worker-client: Fix setting process title to [idling]
Timo Sirainen [Thu, 31 Oct 2019 13:36:02 +0000 (15:36 +0200)] 
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.

4 years agoauth: auth-worker-client: Move common code to auth_worker_request_finished()
Timo Sirainen [Thu, 31 Oct 2019 13:34:06 +0000 (15:34 +0200)] 
auth: auth-worker-client: Move common code to auth_worker_request_finished()

4 years agoauth: auth-worker-client: Move auth_worker_request_finished*()
Timo Sirainen [Thu, 31 Oct 2019 13:31:57 +0000 (15:31 +0200)] 
auth: auth-worker-client: Move auth_worker_request_finished*()

4 years agoauth: auth-worker-client: Set "error" for all auth worker request failures
Timo Sirainen [Thu, 31 Oct 2019 13:27:49 +0000 (15:27 +0200)] 
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.

4 years agoauth: auth-worker-client: Rename auth_worker_log_finished() to auth_worker_request_fi...
Timo Sirainen [Thu, 31 Oct 2019 13:23:01 +0000 (15:23 +0200)] 
auth: auth-worker-client: Rename auth_worker_log_finished() to auth_worker_request_finished()

4 years agoauth: userdb iteration - Use event based logging
Timo Sirainen [Thu, 31 Oct 2019 12:48:11 +0000 (14:48 +0200)] 
auth: userdb iteration - Use event based logging

4 years agoauth: db-passwd-file - Use event based logging
Timo Sirainen [Thu, 31 Oct 2019 12:41:56 +0000 (14:41 +0200)] 
auth: db-passwd-file - Use event based logging

4 years agoauth: db-ldap - Use event based logging
Timo Sirainen [Thu, 31 Oct 2019 12:34:48 +0000 (14:34 +0200)] 
auth: db-ldap - Use event based logging

4 years agologin-common: Fix assert-crash if client is destroyed during anvil lookup
Timo Sirainen [Thu, 25 Feb 2021 19:58:17 +0000 (21:58 +0200)] 
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)

4 years agolib: event_logv() - Make sure errno is preserved
Timo Sirainen [Wed, 10 Mar 2021 11:50:00 +0000 (13:50 +0200)] 
lib: event_logv() - Make sure errno is preserved

It already should have been, but this change makes it clearer and more
future-safe.

4 years agoimap: Use internal error for logging FETCH failed disconnection message
Timo Sirainen [Tue, 2 Mar 2021 17:30:23 +0000 (19:30 +0200)] 
imap: Use internal error for logging FETCH failed disconnection message

4 years agosubmission-login: Fix logging "no auth attempts" at disconnection
Timo Sirainen [Tue, 2 Mar 2021 16:58:54 +0000 (18:58 +0200)] 
submission-login: Fix logging "no auth attempts" at disconnection

client.banner_sent wasn't set, which prevented this from being logged.

4 years agolib-smtp: smtp_server_connection_ssl_init() - Don't start SSL handshake
Timo Sirainen [Tue, 2 Mar 2021 15:51:54 +0000 (17:51 +0200)] 
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.

4 years agolib-smtp: Remove smtp_server_connection.disconnect_reason
Timo Sirainen [Tue, 2 Mar 2021 15:44:37 +0000 (17:44 +0200)] 
lib-smtp: Remove smtp_server_connection.disconnect_reason

This isn't used anywhere and its purpose is a bit unclear.

4 years agoimap-urlauth: Change event_category_urlauth to be static
Timo Sirainen [Tue, 2 Mar 2021 15:33:30 +0000 (17:33 +0200)] 
imap-urlauth: Change event_category_urlauth to be static

4 years agoimap-urlauth: Replace i_info() and i_error() calls with e_info() and e_error()
Timo Sirainen [Tue, 2 Mar 2021 15:30:52 +0000 (17:30 +0200)] 
imap-urlauth: Replace i_info() and i_error() calls with e_info() and e_error()

4 years agoimap-urlauth: Don't change log prefix just before disconnection line
Timo Sirainen [Tue, 2 Mar 2021 15:26:50 +0000 (17:26 +0200)] 
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.)

4 years agoimap-urlauth: client_destroy() - Allow NULL reason only if client is disconnected
Timo Sirainen [Tue, 2 Mar 2021 15:25:31 +0000 (17:25 +0200)] 
imap-urlauth: client_destroy() - Allow NULL reason only if client is disconnected

4 years agoimap-urlauth: Remove duplicate "Disconnected: " prefix
Timo Sirainen [Tue, 2 Mar 2021 15:24:14 +0000 (17:24 +0200)] 
imap-urlauth: Remove duplicate "Disconnected: " prefix

It's already logged by client_destroy()

4 years agoimap-urlauth: Add Username to log prefix
Timo Sirainen [Tue, 2 Mar 2021 15:19:13 +0000 (17:19 +0200)] 
imap-urlauth: Add Username to log prefix

4 years agoimap-urlauth: Fix event leak if worker can't be connected to
Timo Sirainen [Tue, 2 Mar 2021 15:15:45 +0000 (17:15 +0200)] 
imap-urlauth: Fix event leak if worker can't be connected to

4 years agolib-smtp: Standardize iostream error handling
Timo Sirainen [Tue, 2 Mar 2021 13:15:09 +0000 (15:15 +0200)] 
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.

4 years agolib: Add o_stream_get_disconnect_reason()
Timo Sirainen [Tue, 2 Mar 2021 13:07:56 +0000 (15:07 +0200)] 
lib: Add o_stream_get_disconnect_reason()

4 years agolib: Clarify i[o]_stream_get_disconnect_reason() comment
Timo Sirainen [Tue, 2 Mar 2021 13:06:50 +0000 (15:06 +0200)] 
lib: Clarify i[o]_stream_get_disconnect_reason() comment

4 years agolib-smtp: Remove EIO-specific error handling
Timo Sirainen [Tue, 2 Mar 2021 12:51:48 +0000 (14:51 +0200)] 
lib-smtp: Remove EIO-specific error handling

No such error should be seen by lib-smtp.

4 years agosubmission: Standardize "Disconnected:" log line
Timo Sirainen [Tue, 2 Mar 2021 11:15:56 +0000 (13:15 +0200)] 
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.

4 years agolib-smtp: Standardize QUIT logging
Timo Sirainen [Tue, 2 Mar 2021 11:13:52 +0000 (13:13 +0200)] 
lib-smtp: Standardize QUIT logging

Similar to POP3, use "Logged out" or "Aborted login by logging out".

4 years agopop3: Improve "inactivity" disconnection reason log messages
Timo Sirainen [Mon, 1 Mar 2021 14:47:54 +0000 (16:47 +0200)] 
pop3: Improve "inactivity" disconnection reason log messages

4 years agopop3: Add "Disconnected: " prefix to all disconnection log lines
Timo Sirainen [Mon, 1 Mar 2021 14:46:16 +0000 (16:46 +0200)] 
pop3: Add "Disconnected: " prefix to all disconnection log lines

4 years agologin-common: Add and use client_destroy_iostream_error()
Timo Sirainen [Wed, 3 Feb 2021 20:15:51 +0000 (22:15 +0200)] 
login-common: Add and use client_destroy_iostream_error()

This standardizes the disconnection log message.

4 years ago*-login: Replace "Aborted login" with "Disconnected: Aborted login by logging out"
Timo Sirainen [Wed, 3 Feb 2021 19:59:55 +0000 (21:59 +0200)] 
*-login: Replace "Aborted login" with "Disconnected: Aborted login by logging out"

4 years ago*-login: Add "Disconnected: " prefix to most disconnection log lines
Timo Sirainen [Wed, 3 Feb 2021 19:58:15 +0000 (21:58 +0200)] 
*-login: Add "Disconnected: " prefix to most disconnection log lines

All except "Disconnected by proxy" disconnections.

4 years agoimap-hibernate: Add "Disconnected: " prefix to all disconnection log lines
Timo Sirainen [Wed, 3 Feb 2021 19:18:41 +0000 (21:18 +0200)] 
imap-hibernate: Add "Disconnected: " prefix to all disconnection log lines

4 years agoimap: Improve "inactivity" disconnection reason log messages
Timo Sirainen [Mon, 1 Mar 2021 14:40:57 +0000 (16:40 +0200)] 
imap: Improve "inactivity" disconnection reason log messages

4 years agoimap: Improve client disconnection log line in APPEND
Timo Sirainen [Wed, 3 Feb 2021 19:13:13 +0000 (21:13 +0200)] 
imap: Improve client disconnection log line in APPEND

4 years agoimap: Add "Disconnected: " prefix to all disconnection log lines
Timo Sirainen [Wed, 3 Feb 2021 15:47:13 +0000 (17:47 +0200)] 
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.

4 years agolmtp: Simplify client_destroy() handling
Timo Sirainen [Tue, 2 Mar 2021 14:40:48 +0000 (16:40 +0200)] 
lmtp: Simplify client_destroy() handling

This is similar to the earlier submission commit.

4 years agolmtp: Simplify/clarify disconnection code flow
Timo Sirainen [Tue, 2 Mar 2021 14:37:30 +0000 (16:37 +0200)] 
lmtp: Simplify/clarify disconnection code flow

This is similar to the earlier submission commit.

4 years agosubmission: Remove client.stats
Timo Sirainen [Tue, 2 Mar 2021 14:09:38 +0000 (16:09 +0200)] 
submission: Remove client.stats

client.conn is no longer ever NULL, so this isn't needed.

4 years agosubmission: Simplify client_destroy() handling
Timo Sirainen [Tue, 2 Mar 2021 14:00:24 +0000 (16:00 +0200)] 
submission: Simplify client_destroy() handling

Now it simply calls smtp_server_connection_terminate() and the
conn_free() callback does the actual destroying.

4 years agosubmission: Simplify/clarify disconnection code flow
Timo Sirainen [Tue, 2 Mar 2021 13:46:11 +0000 (15:46 +0200)] 
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.

4 years agosubmission: Move client_connection_disconnect|free()
Timo Sirainen [Tue, 2 Mar 2021 13:41:15 +0000 (15:41 +0200)] 
submission: Move client_connection_disconnect|free()

4 years agolib-smtp, lmtp, submission: Move adding "(state=%s)" in disconnection reason to lib...
Timo Sirainen [Fri, 5 Mar 2021 15:03:11 +0000 (17:03 +0200)] 
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.

4 years agolib-smtp: Add "unfinished %s command" if client disconnected during command processing
Timo Sirainen [Tue, 2 Mar 2021 12:17:29 +0000 (14:17 +0200)] 
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".

4 years agolib-smtp: Rename conn_destroy() callback to conn_free()
Timo Sirainen [Tue, 2 Mar 2021 13:23:46 +0000 (15:23 +0200)] 
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.

4 years agoindexer: Convert indexer-worker log info to event
Siavash Tavakoli [Tue, 2 Mar 2021 10:57:08 +0000 (10:57 +0000)] 
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()".

4 years agolib: lib-event: Add event_enable_user_cpu_usecs
Siavash Tavakoli [Thu, 4 Mar 2021 23:26:52 +0000 (23:26 +0000)] 
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.

4 years agom4: want_lua - Fix Lua function checks
Aki Tuomi [Thu, 11 Mar 2021 07:28:58 +0000 (09:28 +0200)] 
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

4 years agolib-lua: Add table get helpers
Josef 'Jeff' Sipek [Wed, 3 Mar 2021 22:08:07 +0000 (17:08 -0500)] 
lib-lua: Add table get helpers

4 years agolib-lua: Check for function presence instead of Lua version in compat code
Josef 'Jeff' Sipek [Thu, 4 Mar 2021 22:05:45 +0000 (17:05 -0500)] 
lib-lua: Check for function presence instead of Lua version in compat code

4 years agolib-lua: Reorder compat luaL_{setfuncs,setmetatable}
Josef 'Jeff' Sipek [Thu, 4 Mar 2021 22:03:03 +0000 (17:03 -0500)] 
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.

4 years agolib-lua: Move compat macros and prototypes to dlua-compat.h
Josef 'Jeff' Sipek [Thu, 4 Mar 2021 21:51:46 +0000 (16:51 -0500)] 
lib-lua: Move compat macros and prototypes to dlua-compat.h

Additionally, fix -Wstrict-bool issue in luaL_newmetatable() compatibility
wrapper.

4 years agolib-lua: Remove unused compatibility macros
Josef 'Jeff' Sipek [Thu, 4 Mar 2021 21:38:50 +0000 (16:38 -0500)] 
lib-lua: Remove unused compatibility macros

These are never used since all supported Lua versions define
LUA_VERSION_NUM.

4 years agolib-lua: Implement a Lua 5.1 & 5.2 compatibility wrapper for lua_isinteger
Josef 'Jeff' Sipek [Thu, 4 Mar 2021 21:21:07 +0000 (16:21 -0500)] 
lib-lua: Implement a Lua 5.1 & 5.2 compatibility wrapper for lua_isinteger

4 years agom4: want_lua - Check for lua_isinteger
Josef 'Jeff' Sipek [Thu, 4 Mar 2021 21:16:53 +0000 (16:16 -0500)] 
m4: want_lua - Check for lua_isinteger

4 years agolib-lua: Implement a Lua 5.1 compatibility wrapper for lua_tointegerx
Josef 'Jeff' Sipek [Thu, 4 Mar 2021 20:35:37 +0000 (15:35 -0500)] 
lib-lua: Implement a Lua 5.1 compatibility wrapper for lua_tointegerx

4 years agom4: want_lua - Check for lua_tointegerx
Josef 'Jeff' Sipek [Thu, 4 Mar 2021 20:31:29 +0000 (15:31 -0500)] 
m4: want_lua - Check for lua_tointegerx

4 years agolib-smtp: test-smtp-client-errors - Amend early data reply test to verify that connec...
Stephan Bosch [Fri, 12 Feb 2021 12:11:53 +0000 (13:11 +0100)] 
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.

4 years agolib-smtp: smtp-client-connection - Hold reference to command that is sending a stream.
Stephan Bosch [Tue, 9 Feb 2021 22:35:53 +0000 (23:35 +0100)] 
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)

4 years agolib-smtp: smtp-client-command - Make smtp_client_command_unref() return TRUE when...
Stephan Bosch [Tue, 9 Feb 2021 22:35:42 +0000 (23:35 +0100)] 
lib-smtp: smtp-client-command - Make smtp_client_command_unref() return TRUE when the object persists.

4 years agolib-smtp: smtp-client-command - Make smtp_client_command_unref(NULL) a no-op.
Stephan Bosch [Tue, 9 Feb 2021 22:44:42 +0000 (23:44 +0100)] 
lib-smtp: smtp-client-command - Make smtp_client_command_unref(NULL) a no-op.

4 years agoimap: Fix logging garbage if imap-hibernate sends invalid VERSION
Timo Sirainen [Sat, 6 Mar 2021 15:58:53 +0000 (17:58 +0200)] 
imap: Fix logging garbage if imap-hibernate sends invalid VERSION

4 years agolib-mail: mail-html2text - Fix character signedness type mismatch
Timo Sirainen [Fri, 5 Mar 2021 13:26:24 +0000 (15:26 +0200)] 
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)

4 years agofts-tika: Don't fail indexing if Tika returns 5xx error
Timo Sirainen [Fri, 5 Mar 2021 10:44:42 +0000 (12:44 +0200)] 
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.

4 years agopop3: Change IO context earlier while shutting down
Timo Sirainen [Tue, 2 Mar 2021 15:10:03 +0000 (17:10 +0200)] 
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.