]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
4 years agombox: Add mbox_[io]stream_set_syscall_error()
Timo Sirainen [Wed, 3 Feb 2021 15:18:09 +0000 (17:18 +0200)] 
mbox: Add mbox_[io]stream_set_syscall_error()

This allows logging the iostream-specific error rather than the more generic
errno.

4 years agolib-master: Fix haproxy PROXY protocol LOCAL type connection behavior when header...
Alex/AT [Thu, 23 Apr 2020 12:26:22 +0000 (15:26 +0300)] 
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

4 years agolib: cpu-limit - Don't round current CPU usage up when checking if rlim_max is reached
Timo Sirainen [Tue, 16 Feb 2021 14:40:35 +0000 (16:40 +0200)] 
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.

4 years agolib: cpu-limit - Allow time comparisons to be more relaxed
Timo Sirainen [Tue, 16 Feb 2021 14:42:54 +0000 (16:42 +0200)] 
lib: cpu-limit - Allow time comparisons to be more relaxed

This should fix random failures.

4 years agolib-storage: Fix assert-crash when parsing binary attachments
Timo Sirainen [Tue, 10 Nov 2020 14:33:41 +0000 (16:33 +0200)] 
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)

4 years agoconfig: test-config-parser - Change filename to match .gitignore pattern
Aki Tuomi [Fri, 12 Feb 2021 12:45:39 +0000 (14:45 +0200)] 
config: test-config-parser - Change filename to match .gitignore pattern

4 years agoconfig: test-config-parser - Cleanup input file after test
Aki Tuomi [Fri, 12 Feb 2021 12:32:01 +0000 (14:32 +0200)] 
config: test-config-parser - Cleanup input file after test

4 years agoacl: acl_lookup_dict_rebuild_update() - Commit transaction after each [un]set
Markus Valentin [Mon, 1 Feb 2021 14:38:49 +0000 (15:38 +0100)] 
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.

4 years agolib-storage: Fix assert-crash in shared namespace if storage has no directories
Timo Sirainen [Tue, 15 Dec 2020 22:13:19 +0000 (00:13 +0200)] 
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

4 years agoacl: Add acl_ignore_namespace* settings
Timo Sirainen [Tue, 15 Dec 2020 22:09:32 +0000 (00:09 +0200)] 
acl: Add acl_ignore_namespace* settings

Ignore ACLs entirely for the listed namespaces. For example:

plugin {
  acl_ignore_namespace = virtual/
  acl_ignore_namespace2 = shared/*
}

4 years agoutil: health-check - Timeout the read via trap for POSIX shell compatibility
Simon Rupf [Sun, 7 Feb 2021 08:23:03 +0000 (09:23 +0100)] 
util: health-check - Timeout the read via trap for POSIX shell compatibility

4 years agoutil: health-check - Consistent variable style
Simon Rupf [Sat, 23 Jan 2021 10:29:22 +0000 (11:29 +0100)] 
util: health-check - Consistent variable style

4 years agoutil: health-check - Made bash script compatible with dash shell
Simon Rupf [Sat, 23 Jan 2021 10:07:36 +0000 (11:07 +0100)] 
util: health-check - Made bash script compatible with dash shell

4 years agoMakefile.am: fix typo and broken variable assignment
Nis Martensen [Sun, 24 May 2020 21:15:53 +0000 (23:15 +0200)] 
Makefile.am: fix typo and broken variable assignment

4 years agosystemd integration: notify service manager when ready
Nis Martensen [Sun, 24 May 2020 20:05:42 +0000 (22:05 +0200)] 
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.

4 years agolib: Add API for limiting CPU usage of subroutines.
Stephan Bosch [Thu, 29 Oct 2020 00:04:26 +0000 (01:04 +0100)] 
lib: Add API for limiting CPU usage of subroutines.

4 years agolib: time-util - Add support for rounding off timeval to a time_t value.
Stephan Bosch [Thu, 29 Oct 2020 00:09:17 +0000 (01:09 +0100)] 
lib: time-util - Add support for rounding off timeval to a time_t value.

4 years agolib: time-util - Add support for calculating the sum of two timeval values.
Stephan Bosch [Thu, 29 Oct 2020 00:06:57 +0000 (01:06 +0100)] 
lib: time-util - Add support for calculating the sum of two timeval values.

4 years agorun-test-valgrind.supp: Add more suppressions
Siavash Tavakoli [Mon, 1 Feb 2021 12:33:02 +0000 (12:33 +0000)] 
run-test-valgrind.supp: Add more suppressions

4 years agodsync: Add namespace prefixes to mailbox tree
Siavash Tavakoli [Thu, 28 Jan 2021 23:09:00 +0000 (23:09 +0000)] 
dsync: Add namespace prefixes to mailbox tree

Adds syncing selectable namespace prefixes, especially shared INBOXes with
"mail_shared_explicit_inbox=yes".

4 years agodsync: Check namespace prefix when syncing shared namespaces
Siavash Tavakoli [Thu, 7 Jan 2021 09:40:51 +0000 (09:40 +0000)] 
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.

4 years agodsync: Don't send out of tree namespace parents for syncing
Siavash Tavakoli [Tue, 19 Jan 2021 10:33:17 +0000 (10:33 +0000)] 
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.

4 years agolib-storage: Cache mailbox's namespace prefix if selectable
Siavash Tavakoli [Thu, 4 Feb 2021 20:54:14 +0000 (20:54 +0000)] 
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.

4 years agolib-storage: Add mailbox_guid_cache_add_mailbox()
Siavash Tavakoli [Thu, 4 Feb 2021 15:57:09 +0000 (15:57 +0000)] 
lib-storage: Add mailbox_guid_cache_add_mailbox()

Refactored caching logic in mailbox_guid_cache_refresh to this new
function.

4 years agolib-storage: Add mail_namespace_prefix_is_inbox()
Siavash Tavakoli [Thu, 4 Feb 2021 20:52:19 +0000 (20:52 +0000)] 
lib-storage: Add mail_namespace_prefix_is_inbox()

4 years agolib-storage: Skip private server attributes for shared inboxes
Siavash Tavakoli [Thu, 4 Feb 2021 01:42:52 +0000 (01:42 +0000)] 
lib-storage: Skip private server attributes for shared inboxes

Private server attributes should be iterated only for user's own inbox.

4 years agolib-storage: mailbox-list-iter: Send delayed inbox after actually seeing the inbox
Siavash Tavakoli [Mon, 1 Feb 2021 17:53:59 +0000 (17:53 +0000)] 
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.

4 years agolib-index: Fix implicit integer truncation found by ubsan
Siavash Tavakoli [Tue, 2 Feb 2021 12:43:50 +0000 (12:43 +0000)] 
lib-index: Fix implicit integer truncation found by ubsan

4 years agolib-index: Avoid a duplicate "missing middle file seq" warning.
Timo Sirainen [Wed, 3 Feb 2021 13:55:14 +0000 (15:55 +0200)] 
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.

4 years agolib-index: Change "missing middle file seq" error into warning
Timo Sirainen [Mon, 1 Feb 2021 15:49:18 +0000 (17:49 +0200)] 
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.

4 years agolib-index: view_sync_set_log_view_range() - Move error logging to parent
Timo Sirainen [Mon, 1 Feb 2021 15:02:24 +0000 (17:02 +0200)] 
lib-index: view_sync_set_log_view_range() - Move error logging to parent

4 years agolib-index: Fix repetitive "missing middle file seq" error.
Timo Sirainen [Mon, 1 Feb 2021 14:53:18 +0000 (16:53 +0200)] 
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.

4 years agom4: dovecot.m4 - Execute tests with libtool
Aki Tuomi [Tue, 26 Jan 2021 07:30:42 +0000 (09:30 +0200)] 
m4: dovecot.m4 - Execute tests with libtool

This allows libtool to do all the necessary preparations
before test harness is used.

4 years agom4: dovecot.m4 - Find out and use absolute path to valgrind
Aki Tuomi [Tue, 26 Jan 2021 07:29:44 +0000 (09:29 +0200)] 
m4: dovecot.m4 - Find out and use absolute path to valgrind

4 years agolib-settings: test-settings-parser - Use ULL suffix
Aki Tuomi [Mon, 8 Feb 2021 08:05:47 +0000 (10:05 +0200)] 
lib-settings: test-settings-parser - Use ULL suffix

Some of the sizes do not fit to UL in 32 bit systems.

4 years agolib-compression: Remove xz/lzma write support
Josef 'Jeff' Sipek [Fri, 22 Jan 2021 19:00:21 +0000 (14:00 -0500)] 
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.

4 years agolib-mail: test-message-snippet - Add unit tests for multipart messages
Aki Tuomi [Thu, 28 Jan 2021 15:04:37 +0000 (17:04 +0200)] 
lib-mail: test-message-snippet - Add unit tests for multipart messages

4 years agolib-mail: test-message-snippet - Use test_assert_strcmp
Aki Tuomi [Wed, 3 Feb 2021 15:22:07 +0000 (17:22 +0200)] 
lib-mail: test-message-snippet - Use test_assert_strcmp

Makes it easier to see what failed.

4 years agolib-mail: Reformat test-message-snippet.c
Aki Tuomi [Thu, 28 Jan 2021 14:52:10 +0000 (16:52 +0200)] 
lib-mail: Reformat test-message-snippet.c

4 years agolib-mail: message-snippet - Stop building snippet on first non-empty part
Aki Tuomi [Thu, 28 Jan 2021 15:01:38 +0000 (17:01 +0200)] 
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.

4 years agolib-mail: message-snippet - Do not stop on first non-text part
Aki Tuomi [Thu, 28 Jan 2021 14:48:05 +0000 (16:48 +0200)] 
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.

4 years agolib-mail: message-snippet - Free html parser before making new
Aki Tuomi [Thu, 28 Jan 2021 09:07:32 +0000 (11:07 +0200)] 
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

4 years agostats: stats-service-openmetrics - Use PRIdTIME_T for startup time
Aki Tuomi [Thu, 4 Feb 2021 06:59:29 +0000 (08:59 +0200)] 
stats: stats-service-openmetrics - Use PRIdTIME_T for startup time

4 years agologin: login-proxy - Fix type conflict
Aki Tuomi [Thu, 4 Feb 2021 06:57:24 +0000 (08:57 +0200)] 
login: login-proxy - Fix type conflict

4 years agolib-mail: test-message-header-decode - Use ptrdiff_t for rep_char_len
Aki Tuomi [Thu, 4 Feb 2021 06:54:59 +0000 (08:54 +0200)] 
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.

4 years agolib-settings: test-setting-parser - Use correct type in test
Aki Tuomi [Thu, 4 Feb 2021 06:46:51 +0000 (08:46 +0200)] 
lib-settings: test-setting-parser - Use correct type in test

SIZE uses uoff_t.

4 years agolib: backtrace - Use correct format modifier
Aki Tuomi [Thu, 4 Feb 2021 06:45:37 +0000 (08:45 +0200)] 
lib: backtrace - Use correct format modifier

Matches size_t correctly.

4 years agolib: test-time-util - Use correct types for test case
Aki Tuomi [Thu, 4 Feb 2021 06:44:46 +0000 (08:44 +0200)] 
lib: test-time-util - Use correct types for test case

Fixes type mismatch on 32-bit systems.

4 years agomaster: Fix reopening log files on SIGUSR1
Timo Sirainen [Tue, 19 Jan 2021 18:11:47 +0000 (19:11 +0100)] 
master: Fix reopening log files on SIGUSR1

4 years agoman: Clarify how doveadm log reopen works
Timo Sirainen [Tue, 19 Jan 2021 18:11:20 +0000 (19:11 +0100)] 
man: Clarify how doveadm log reopen works

4 years agodovecot.service.in: Update documentation URL
Timo Sirainen [Thu, 28 Jan 2021 15:45:45 +0000 (16:45 +0100)] 
dovecot.service.in: Update documentation URL

4 years agolib-master: test-event-stats - Fix unit test when compiling using build directory
Timo Sirainen [Fri, 22 Jan 2021 11:19:05 +0000 (13:19 +0200)] 
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.

4 years agolib-master: test-event-stats - Cast test value to uint64_t
Aki Tuomi [Mon, 18 Jan 2021 16:14:47 +0000 (18:14 +0200)] 
lib-master: test-event-stats - Cast test value to uint64_t

4 years agolib: Fix timeval_cmp_margin for 32-bit systems
Paul Howarth [Mon, 4 Jan 2021 16:31:03 +0000 (16:31 +0000)] 
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

4 years agodsync: Use a better default vname escape character
Timo Sirainen [Tue, 26 Jan 2021 15:44:46 +0000 (17:44 +0200)] 
dsync: Use a better default vname escape character

A control character was a bit unreadable in strings.

4 years agodsync: Replace escape characters in outgoing mailbox names with alt_char
Timo Sirainen [Tue, 26 Jan 2021 16:55:22 +0000 (18:55 +0200)] 
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.

4 years agodsync: Send alt_char also to slave brain
Timo Sirainen [Tue, 26 Jan 2021 16:54:53 +0000 (18:54 +0200)] 
dsync: Send alt_char also to slave brain

4 years agolib-storage: mailbox_list_escape_name_params() - Assert that escape_char isn't NUL
Timo Sirainen [Mon, 18 Jan 2021 21:53:50 +0000 (23:53 +0200)] 
lib-storage: mailbox_list_escape_name_params() - Assert that escape_char isn't NUL

4 years agoimapc: Add comment explaining various mailbox names
Timo Sirainen [Fri, 15 Jan 2021 17:27:00 +0000 (19:27 +0200)] 
imapc: Add comment explaining various mailbox names

4 years agoimapc: fs mailbox_list - Remove vname_escape_char
Timo Sirainen [Mon, 18 Jan 2021 21:31:28 +0000 (23:31 +0200)] 
imapc: fs mailbox_list - Remove vname_escape_char

This isn't necessary.

4 years agoimapc: Add IMAPC_LIST_FS_NAME_ESCAPE_CHAR
Timo Sirainen [Mon, 18 Jan 2021 21:30:28 +0000 (23:30 +0200)] 
imapc: Add IMAPC_LIST_FS_NAME_ESCAPE_CHAR

This clarifies how the escape characters are used.

4 years agoimapc: Add a default vname_escape_char
Timo Sirainen [Mon, 18 Jan 2021 21:23:37 +0000 (23:23 +0200)] 
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.

4 years agoimapc: Fix local filesystem directory name escaping
Timo Sirainen [Mon, 18 Jan 2021 21:19:01 +0000 (23:19 +0200)] 
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.

4 years agoimapc: Add imapc_list_remote_to_storage_name()
Timo Sirainen [Sat, 16 Jan 2021 15:20:46 +0000 (17:20 +0200)] 
imapc: Add imapc_list_remote_to_storage_name()

4 years agoimapc: Fix remote/storage mailbox name mismatches
Timo Sirainen [Sat, 16 Jan 2021 13:03:59 +0000 (15:03 +0200)] 
imapc: Fix remote/storage mailbox name mismatches

4 years agoimapc: Use more explicit mailbox name variable names
Timo Sirainen [Sat, 16 Jan 2021 13:00:06 +0000 (15:00 +0200)] 
imapc: Use more explicit mailbox name variable names

Clearly specify which type of a mailbox name it is to avoid
misunderstandings.

4 years agoimapc: Rename imapc_list_get_fs_name() to imapc_list_storage_to_fs_name()
Timo Sirainen [Sat, 16 Jan 2021 12:44:00 +0000 (14:44 +0200)] 
imapc: Rename imapc_list_get_fs_name() to imapc_list_storage_to_fs_name()

4 years agoimapc: Rename imapc_list_to_vname() to imapc_list_remote_to_vname()
Timo Sirainen [Sat, 16 Jan 2021 12:41:24 +0000 (14:41 +0200)] 
imapc: Rename imapc_list_to_vname() to imapc_list_remote_to_vname()

4 years agoimapc: Rename imapc_list_to_remote() to imapc_list_storage_to_remote_name()
Timo Sirainen [Sat, 16 Jan 2021 12:40:54 +0000 (14:40 +0200)] 
imapc: Rename imapc_list_to_remote() to imapc_list_storage_to_remote_name()

4 years agolib-storage: mailbox_list_default_get_storage_name() - Escape ns_prefix/INBOX if...
Timo Sirainen [Thu, 14 Jan 2021 15:45:07 +0000 (17:45 +0200)] 
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.

4 years agolib-storage: Update mailbox_list_settings.{vname|storage_name}_escape_char comments
Timo Sirainen [Thu, 14 Jan 2021 15:33:13 +0000 (17:33 +0200)] 
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.

4 years agolib-storage: Fix mailbox name escape/unescape ordering
Timo Sirainen [Thu, 14 Jan 2021 15:27:03 +0000 (17:27 +0200)] 
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.

4 years agolib-storage: mailbox_list_default_get_vname() - Fix escaping namespace separator...
Timo Sirainen [Thu, 14 Jan 2021 15:07:34 +0000 (17:07 +0200)] 
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.

4 years agolib-storage: Use imap_escaped_utf8_to_utf7()
Timo Sirainen [Thu, 14 Jan 2021 14:38:04 +0000 (16:38 +0200)] 
lib-storage: Use imap_escaped_utf8_to_utf7()

4 years agolib-storage: Use imap_escaped_utf8_hex_to_char()
Timo Sirainen [Thu, 14 Jan 2021 14:32:25 +0000 (16:32 +0200)] 
lib-storage: Use imap_escaped_utf8_hex_to_char()

4 years agolib-storage: Use mailbox_list_settings.vname_escape_char also with utf8 storage names
Timo Sirainen [Thu, 14 Jan 2021 14:23:24 +0000 (16:23 +0200)] 
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.

4 years agolib-storage: mailbox_list_default_get_vname() - Use imap_utf7_to_utf8_escaped()
Timo Sirainen [Thu, 14 Jan 2021 13:40:44 +0000 (15:40 +0200)] 
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.

4 years agolib-storage: mailbox_list_default_get_vname() - Escape each hierarchical name separately
Timo Sirainen [Thu, 14 Jan 2021 13:09:34 +0000 (15:09 +0200)] 
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().

4 years agolib-storage: Split off mailbox_list_storage_name_prepare()
Timo Sirainen [Thu, 14 Jan 2021 10:47:55 +0000 (12:47 +0200)] 
lib-storage: Split off mailbox_list_storage_name_prepare()

4 years agolib-storage: mailbox_list_default_get_storage_name() - Escape each hierarchical name...
Timo Sirainen [Thu, 14 Jan 2021 10:34:48 +0000 (12:34 +0200)] 
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.

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.