]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
5 years agolib: Use event category representatives instead of user supplied pointers
Josef 'Jeff' Sipek [Thu, 24 Oct 2019 21:58:22 +0000 (17:58 -0400)] 
lib: Use event category representatives instead of user supplied pointers

Since we cannot rely on the consumers to supply us with unique category
pointers, we can switch all our tracking to the category representative
structures.

5 years agolib: Maintain a representative event category inside internal state
Josef 'Jeff' Sipek [Thu, 24 Oct 2019 21:40:32 +0000 (17:40 -0400)] 
lib: Maintain a representative event category inside internal state

More than one category can be represented by the internal state.  To give
consumers a unique but consistent category pointer, we allocate a category
structure (technically part of the internal state) and use it as the
representative for all the registrations.

Note: This commit only allocates and maintains the representatives.  It does
not make use of them.

5 years agolib: Keep an internal event category structure
Josef 'Jeff' Sipek [Tue, 22 Oct 2019 18:40:02 +0000 (14:40 -0400)] 
lib: Keep an internal event category structure

5 years agolib: events: Replace ->registered with ->internal
Josef 'Jeff' Sipek [Tue, 22 Oct 2019 18:19:10 +0000 (14:19 -0400)] 
lib: events: Replace ->registered with ->internal

This is in preparation for maintaining an internal category state structure.

5 years agolib: Remove support for unregistering categories
Josef 'Jeff' Sipek [Fri, 8 Nov 2019 17:58:47 +0000 (12:58 -0500)] 
lib: Remove support for unregistering categories

Nothing used the code and there were some unhandled corner cases.

5 years agolib: Correct struct event_category's registered member's comment
Josef 'Jeff' Sipek [Tue, 22 Oct 2019 18:14:13 +0000 (14:14 -0400)] 
lib: Correct struct event_category's registered member's comment

5 years agolib: json-parser: Escape characters U+2028 and U+2029 to avoid CR-LF conflict with...
Sina Tavakoli [Wed, 13 Nov 2019 09:49:23 +0000 (11:49 +0200)] 
lib: json-parser: Escape characters U+2028 and U+2029 to avoid CR-LF conflict with some parsers.

5 years agolib: json-parser: Fix eager escaping UTF-8 characters
Sina Tavakoli [Mon, 11 Nov 2019 13:24:07 +0000 (15:24 +0200)] 
lib: json-parser: Fix eager escaping UTF-8 characters

5 years agopush-notification: lua: Expose UTF8 from/to/subject
Timo Sirainen [Sun, 10 Nov 2019 12:16:49 +0000 (14:16 +0200)] 
push-notification: lua: Expose UTF8 from/to/subject

Replace the existing "subject" field with UTF8 subject. Add new
from_address, from_display_name, to_address and to_display_name where
the *_display_names are UTF8.

5 years agopush-notification: Support UTF8-decoded from/to/subject
Timo Sirainen [Sun, 10 Nov 2019 12:09:18 +0000 (14:09 +0200)] 
push-notification: Support UTF8-decoded from/to/subject

Use a new struct push_notification_message_ext for this so both MessageNew
and MessageAppend events can share the same struct.

For From and To addresses keep the actual email address and display-name in
separate fields, since some drivers want them separated.

5 years agopush-notification: Simplify code with p_strarray_dup()
Timo Sirainen [Thu, 7 Nov 2019 16:51:37 +0000 (18:51 +0200)] 
push-notification: Simplify code with p_strarray_dup()

5 years agopush-notification: Deduplicate MessageNew and MessageAppend events' data gathering...
Timo Sirainen [Thu, 7 Nov 2019 16:49:02 +0000 (18:49 +0200)] 
push-notification: Deduplicate MessageNew and MessageAppend events' data gathering code

It would have been simpler to share their structs, but that can't be done cleanly
without breaking the API's backwards compatibility.

5 years agolib-smtp: smtp-server-cmd-mail - Don't implicitly accept missing '<' and '>' when...
Stephan Bosch [Thu, 21 Nov 2019 08:42:09 +0000 (09:42 +0100)] 
lib-smtp: smtp-server-cmd-mail - Don't implicitly accept missing '<' and '>' when set->mail_path_allow_broken == TRUE.

5 years agolib-smtp: smtp-address - Don't allow missing '<' and '>' with only SMTP_ADDRESS_PARSE...
Stephan Bosch [Wed, 20 Nov 2019 23:35:51 +0000 (00:35 +0100)] 
lib-smtp: smtp-address - Don't allow missing '<' and '>' with only SMTP_ADDRESS_PARSE_FLAG_IGNORE_BROKEN flag set.

5 years agolib-smtp: test-smtp-server-errors - Fix "MAIL broken path" test.
Stephan Bosch [Thu, 21 Nov 2019 14:35:28 +0000 (15:35 +0100)] 
lib-smtp: test-smtp-server-errors - Fix "MAIL broken path" test.

The test label and the number of clients was wrong.

5 years agodoveadm: Fix doveadm_proxy_port alias
Martti Rannanjärvi [Fri, 15 Nov 2019 10:20:38 +0000 (12:20 +0200)] 
doveadm: Fix doveadm_proxy_port alias

5 years agorun-test-valgrind.supp: Fix libunwind supression
Timo Sirainen [Thu, 7 Nov 2019 11:01:47 +0000 (13:01 +0200)] 
run-test-valgrind.supp: Fix libunwind supression

The stack trace changed after the initial suppression was done

5 years agolib-imap: imap_write_arg() - Write IMAP_ARG_LITERAL_SIZE* the same as imap_write_args...
Timo Sirainen [Thu, 7 Nov 2019 12:34:48 +0000 (14:34 +0200)] 
lib-imap: imap_write_arg() - Write IMAP_ARG_LITERAL_SIZE* the same as imap_write_args_for_human()

Either way it's not a proper literal because the content is missing.
This is at least now more consistent.

5 years agoimap: APPEND - Fix parameters for cmd_args and cmd_human_args
Timo Sirainen [Thu, 7 Nov 2019 12:29:07 +0000 (14:29 +0200)] 
imap: APPEND - Fix parameters for cmd_args and cmd_human_args

Note that this still includes only the first parameters when CATENATE or
MULTIAPPEND is used.

5 years agoimap: client_args_finished() - support appending more args
Timo Sirainen [Thu, 7 Nov 2019 12:28:56 +0000 (14:28 +0200)] 
imap: client_args_finished() - support appending more args

5 years agoimap: Split off client_args_finished()
Timo Sirainen [Thu, 7 Nov 2019 12:26:40 +0000 (14:26 +0200)] 
imap: Split off client_args_finished()

5 years agoimap: Add "cmd_" prefix to most imap_command_finished event parameters
Timo Sirainen [Wed, 6 Nov 2019 17:27:41 +0000 (19:27 +0200)] 
imap: Add "cmd_" prefix to most imap_command_finished event parameters

Especially "name" can conflict with child events' parameter.

5 years agoimap: Fix args and human_args parameters to imap_command_finished event
Timo Sirainen [Wed, 6 Nov 2019 17:27:07 +0000 (19:27 +0200)] 
imap: Fix args and human_args parameters to imap_command_finished event

They were being set too early when they didn't yet exist.

5 years agolib-imap: Add IMAP_ARG_EOL parameter also for unfinished lists
Timo Sirainen [Fri, 8 Nov 2019 08:57:01 +0000 (10:57 +0200)] 
lib-imap: Add IMAP_ARG_EOL parameter also for unfinished lists

If list parsing was stopped due to IMAP_ARG_LITERAL_SIZE* the list didn't
have IMAP_ARG_EOL added. However, imap_arg_get_list() could still have
been used for it, which assumes that the IMAP_ARG_EOL exists.

This didn't seem to cause any actual bugs so far, but the following commits
require this.

The IMAP_ARG_EOL is appended and deleted immediately. This way it's seen by
imap_arg_get_list(), but it won't change any other behavior unexpectedly.

5 years agolib: Add io_loop_stop_delayed()
Timo Sirainen [Tue, 29 Oct 2019 16:47:51 +0000 (18:47 +0200)] 
lib: Add io_loop_stop_delayed()

5 years agolmtp: lmtp-proxy - Add ORCPT parameter to RCPT command when recipient path changes.
Stephan Bosch [Tue, 8 Oct 2019 20:54:12 +0000 (22:54 +0200)] 
lmtp: lmtp-proxy - Add ORCPT parameter to RCPT command when recipient path changes.

This will happen when passdb changes the username.

5 years agolib-smtp: smtp-params - Add support for parsing RCPT ORCPT parameter without domain.
Stephan Bosch [Tue, 8 Oct 2019 22:25:41 +0000 (00:25 +0200)] 
lib-smtp: smtp-params - Add support for parsing RCPT ORCPT parameter without domain.

5 years agolib-smtp: smtp-params - Add smtp_params_rcpt_has_orcpt().
Stephan Bosch [Tue, 8 Oct 2019 20:57:02 +0000 (22:57 +0200)] 
lib-smtp: smtp-params - Add smtp_params_rcpt_has_orcpt().

Evaluates whether ORCPT parameter is present.

5 years agolib-smtp: smtp-params - Add smtp_params_rcpt_set_orcpt().
Stephan Bosch [Tue, 8 Oct 2019 20:56:21 +0000 (22:56 +0200)] 
lib-smtp: smtp-params - Add smtp_params_rcpt_set_orcpt().

Allows modifying the ORCPT parameter.

5 years agolib-smtp: smtp-address - Prevent/handle empty string values in fields of struct smtp_...
Stephan Bosch [Tue, 8 Oct 2019 22:21:53 +0000 (00:21 +0200)] 
lib-smtp: smtp-address - Prevent/handle empty string values in fields of struct smtp_address.

This prevents e.g. writing an invalid address like 'user@'.

5 years agolib-smtp: Reformat test-smtp-params.c.
Stephan Bosch [Tue, 8 Oct 2019 22:43:52 +0000 (00:43 +0200)] 
lib-smtp: Reformat test-smtp-params.c.

5 years agolib-smtp: Reformat smtp-params.h.
Stephan Bosch [Tue, 8 Oct 2019 21:11:34 +0000 (23:11 +0200)] 
lib-smtp: Reformat smtp-params.h.

5 years agolib-smtp: Reformat smtp-params.c.
Stephan Bosch [Tue, 8 Oct 2019 21:11:00 +0000 (23:11 +0200)] 
lib-smtp: Reformat smtp-params.c.

5 years agolib-http: http-url - Fix handling of double slash in request target URL.
Stephan Bosch [Thu, 31 Oct 2019 08:07:42 +0000 (09:07 +0100)] 
lib-http: http-url - Fix handling of double slash in request target URL.

A origin-form URL starting with double slash caused the initial path segment to
be erroneously recognized as the URL authority, making the path part
unexpectedly empty (NULL). This could cause the HTTP server to crash.

5 years agolib-http: test-http-request-parser - Test equality of target URL paths in valid tests.
Stephan Bosch [Thu, 31 Oct 2019 08:33:31 +0000 (09:33 +0100)] 
lib-http: test-http-request-parser - Test equality of target URL paths in valid tests.

5 years agolib-http: test-http-request-parser - Split off test_http_request_equal() from test_ht...
Stephan Bosch [Thu, 31 Oct 2019 08:23:23 +0000 (09:23 +0100)] 
lib-http: test-http-request-parser - Split off test_http_request_equal() from test_http_request_parse_valid().

5 years agolib-http: test-http-url - Split off test_http_url_equal() from test_http_url_valid().
Stephan Bosch [Wed, 30 Oct 2019 21:39:36 +0000 (22:39 +0100)] 
lib-http: test-http-url - Split off test_http_url_equal() from test_http_url_valid().

5 years agolib-http: http-url - Split off http_url_parse_fragment() from http_url_do_parse().
Stephan Bosch [Wed, 30 Oct 2019 08:54:16 +0000 (09:54 +0100)] 
lib-http: http-url - Split off http_url_parse_fragment() from http_url_do_parse().

5 years agolib-http: http-url - Split off http_url_parse_query() from http_url_do_parse().
Stephan Bosch [Wed, 30 Oct 2019 08:48:38 +0000 (09:48 +0100)] 
lib-http: http-url - Split off http_url_parse_query() from http_url_do_parse().

5 years agolib-http: http-url - Split off http_url_parse_path() from http_url_do_parse().
Stephan Bosch [Wed, 30 Oct 2019 08:38:49 +0000 (09:38 +0100)] 
lib-http: http-url - Split off http_url_parse_path() from http_url_do_parse().

5 years agolib-http: http-url - Split off http_url_parse_scheme() from http_url_do_parse().
Stephan Bosch [Wed, 30 Oct 2019 07:53:32 +0000 (08:53 +0100)] 
lib-http: http-url - Split off http_url_parse_scheme() from http_url_do_parse().

5 years agolib-http: http-url - Split off http_url_parse_unknown_scheme() from http_url_do_parse().
Stephan Bosch [Wed, 30 Oct 2019 07:58:00 +0000 (08:58 +0100)] 
lib-http: http-url - Split off http_url_parse_unknown_scheme() from http_url_do_parse().

5 years agolib-http: http-url - Split off http_url_parse_userinfo() from http_url_parse_authority().
Stephan Bosch [Tue, 29 Oct 2019 23:58:53 +0000 (00:58 +0100)] 
lib-http: http-url - Split off http_url_parse_userinfo() from http_url_parse_authority().

5 years agolib-http: Reformat test-http-request-parser.c.
Stephan Bosch [Thu, 31 Oct 2019 00:18:27 +0000 (01:18 +0100)] 
lib-http: Reformat test-http-request-parser.c.

5 years agolib-http: Reformat test-http-url.c.
Stephan Bosch [Wed, 30 Oct 2019 21:34:02 +0000 (22:34 +0100)] 
lib-http: Reformat test-http-url.c.

5 years agolib-http: Reformat http-url.c.
Stephan Bosch [Tue, 29 Oct 2019 23:47:37 +0000 (00:47 +0100)] 
lib-http: Reformat http-url.c.

5 years agolib-http: Reformat http-url.h.
Stephan Bosch [Tue, 29 Oct 2019 23:38:43 +0000 (00:38 +0100)] 
lib-http: Reformat http-url.h.

5 years agolib-mail: message-snippet - Use i_isspace
Aki Tuomi [Tue, 29 Oct 2019 11:44:50 +0000 (13:44 +0200)] 
lib-mail: message-snippet - Use i_isspace

This way we catch all the whitespace

5 years agolib-mail: Treat > as quote for HTML mails too
Aki Tuomi [Tue, 29 Oct 2019 13:11:18 +0000 (15:11 +0200)] 
lib-mail: Treat > as quote for HTML mails too

5 years agolib-mail: Use quoted text as snippet if there is nothing else
Aki Tuomi [Tue, 29 Oct 2019 10:40:31 +0000 (12:40 +0200)] 
lib-mail: Use quoted text as snippet if there is nothing else

5 years agolib-mail: message-snippet - Add snippet_add_content
Aki Tuomi [Tue, 29 Oct 2019 12:55:10 +0000 (14:55 +0200)] 
lib-mail: message-snippet - Add snippet_add_content

Simplifies next commit

5 years agolib-mail: message-snippet - Use struct for snippet
Aki Tuomi [Tue, 29 Oct 2019 12:50:05 +0000 (14:50 +0200)] 
lib-mail: message-snippet - Use struct for snippet

Simplifies next change

5 years agolib-mail: Include blockquotes as quotes in plain text
Aki Tuomi [Tue, 29 Oct 2019 10:39:16 +0000 (12:39 +0200)] 
lib-mail: Include blockquotes as quotes in plain text

<blockquote>This is now preserved</blockquote>
which is fine

renders as

> this is now preserved
which is fine

5 years agolib-mail: mail-html2text - Drop unused ignore_next_text
Aki Tuomi [Tue, 29 Oct 2019 11:44:08 +0000 (13:44 +0200)] 
lib-mail: mail-html2text - Drop unused ignore_next_text

5 years agolib-mail: mail-html2text - Do not add space after newline
Aki Tuomi [Tue, 29 Oct 2019 12:15:07 +0000 (14:15 +0200)] 
lib-mail: mail-html2text - Do not add space after newline

5 years agologin-proxy: Fix potential crash if ssl_iostream_handshake() fails
Timo Sirainen [Sat, 14 Sep 2019 09:59:06 +0000 (12:59 +0300)] 
login-proxy: Fix potential crash if ssl_iostream_handshake() fails

The error was uninitialized, which could have caused a crash when it was
logged (or just "(null)" printed with better luck).

5 years agolib-storage: Attachment detection shouldn't cause mime.parts parsing when copying...
Timo Sirainen [Thu, 24 Oct 2019 16:17:23 +0000 (19:17 +0300)] 
lib-storage: Attachment detection shouldn't cause mime.parts parsing when copying mails

5 years agolib-storage: Create vsize records already when building the initial vsize header
Timo Sirainen [Thu, 24 Oct 2019 07:56:06 +0000 (10:56 +0300)] 
lib-storage: Create vsize records already when building the initial vsize header

This way they aren't first added to cache as size.virtuals, but immediately
added as vsize extension records.

5 years agolib-storage: Use latest index map when checking if vsize records should be created
Timo Sirainen [Thu, 24 Oct 2019 07:55:22 +0000 (10:55 +0300)] 
lib-storage: Use latest index map when checking if vsize records should be created

The current view's map may not be completely up-to-date. Required by the
following commit.

5 years agolib-storage: Copy vsize record even when destination mailbox doesn't have it
Timo Sirainen [Tue, 22 Oct 2019 16:59:43 +0000 (19:59 +0300)] 
lib-storage: Copy vsize record even when destination mailbox doesn't have it

It's almost guaranteed that if the source mailbox has vsize then we want the
destination mailbox to also have it. This condition now happens mainly when
copying mails to a newly created mailbox where the vsize lookups haven't
occurred yet. It's better to do this immediately to avoid unnecessarily slow
lookups later on.

5 years agolib-storage: Fix copying vsize record when copying mails
Timo Sirainen [Tue, 22 Oct 2019 16:58:23 +0000 (19:58 +0300)] 
lib-storage: Fix copying vsize record when copying mails

Broken by 153ab952f77ed25b71fa4fa9774ff3e3a776b91c

5 years agolib: ostream-multiplex - Change o_stream_multiplex_sendv() to return void
Timo Sirainen [Sun, 20 Oct 2019 10:53:18 +0000 (13:53 +0300)] 
lib: ostream-multiplex - Change o_stream_multiplex_sendv() to return void

It was always returning 0.

5 years agolib: ostream-multiplex - Make sure stream gets uncorked always
Timo Sirainen [Sun, 20 Oct 2019 10:52:25 +0000 (13:52 +0300)] 
lib: ostream-multiplex - Make sure stream gets uncorked always

5 years agodsync: Fix potential hang when initializing remote dsync
Timo Sirainen [Sun, 20 Oct 2019 10:48:22 +0000 (13:48 +0300)] 
dsync: Fix potential hang when initializing remote dsync

The initial dsync handshake TCP packet could be in the same packet as the
previous doveadm command. This started happening more often with the
recent multiplex ostream corking changes in
f284865285ae461b293c713e03277cfbb6973eca

5 years agodoveadm-mail-server: Initialize port to doveadm_port
Aki Tuomi [Thu, 17 Oct 2019 10:14:41 +0000 (13:14 +0300)] 
doveadm-mail-server: Initialize port to doveadm_port

Forgotten in 8048fa8e46c1c8cfc1f29837512cc7d49fafa4da

5 years agodoveadm: Add doveadm_ssl setting
Aki Tuomi [Tue, 15 Oct 2019 11:33:25 +0000 (14:33 +0300)] 
doveadm: Add doveadm_ssl setting

5 years agodoveadm-mail-server: Support proxy fields properly
Aki Tuomi [Tue, 15 Oct 2019 10:32:23 +0000 (13:32 +0300)] 
doveadm-mail-server: Support proxy fields properly

5 years agodoveadm: Add STARTTLS support
Aki Tuomi [Sun, 13 Oct 2019 17:38:12 +0000 (20:38 +0300)] 
doveadm: Add STARTTLS support

5 years agodoveadm: Setup ssl connection when ssl_flags require it
Aki Tuomi [Sun, 13 Oct 2019 18:06:12 +0000 (21:06 +0300)] 
doveadm: Setup ssl connection when ssl_flags require it

5 years agodoveadm: Do not block fd after command
Aki Tuomi [Mon, 14 Oct 2019 09:28:46 +0000 (12:28 +0300)] 
doveadm: Do not block fd after command

It is not useful and breaks SSL

5 years agolib: istream - Fix calling i_stream_nonseekable_try_seek() without intermittent reads.
Stephan Bosch [Sun, 13 Oct 2019 09:01:53 +0000 (11:01 +0200)] 
lib: istream - Fix calling i_stream_nonseekable_try_seek() without intermittent reads.

Calling i_stream_nonseekable_try_seek() sets stream->high_pos when seeking back
within buffer. Once i_stream_read_memarea() is called, the pos is set to
high_pos and the high pos is cleared. However, when no read is performed in the
mean time, another call to i_stream_nonseekable_try_seek() would overwrite the
high_pos value with pos, causing the true value to get lost, leading to all
kinds of issues. This is fixed by checking whether high_pos is already set and
not touching it when it is (first value is the only valid one).

One issue this caused is that the mbox storage would no longer work with
compression, triggering `unexpected EOF' errors.

5 years agodoveadm mailbox cache remove: Require search query parameter
Timo Sirainen [Thu, 10 Oct 2019 07:34:29 +0000 (10:34 +0300)] 
doveadm mailbox cache remove: Require search query parameter

Don't treat nonexistent search query the same as ALL.

5 years ago*-login: Fix potential hangs with SSL connections
Timo Sirainen [Tue, 8 Oct 2019 13:14:15 +0000 (16:14 +0300)] 
*-login: Fix potential hangs with SSL connections

1) Multi-step SASL authentication could hang when login process waits for
response from a client, but it has already pipelined it together with the
AUTH/AUTHENTICATE command.

2) After failed authentication commands could start hanging.

5 years agolib: backtrace_append() - If libunwind returns failure, fallback to libc's method
Timo Sirainen [Thu, 13 Jun 2019 13:39:42 +0000 (16:39 +0300)] 
lib: backtrace_append() - If libunwind returns failure, fallback to libc's method

5 years agolib: backtrace_get/append() - skip stack frames only based name
Timo Sirainen [Mon, 30 Sep 2019 20:00:37 +0000 (23:00 +0300)] 
lib: backtrace_get/append() - skip stack frames only based name

It's not really safe to do anything else because functions may potentially
be inlined.

5 years agolib: test-backtrace - Remove unnecessary includes
Timo Sirainen [Mon, 30 Sep 2019 19:52:50 +0000 (22:52 +0300)] 
lib: test-backtrace - Remove unnecessary includes

5 years agolib: backtrace_append() - If libunwind fails to get any symbols, return error
Timo Sirainen [Thu, 13 Jun 2019 13:37:34 +0000 (16:37 +0300)] 
lib: backtrace_append() - If libunwind fails to get any symbols, return error

5 years agolib-storage: mail-storage - Add mailbox_has_special_use().
Stephan Bosch [Thu, 5 Oct 2017 10:28:43 +0000 (12:28 +0200)] 
lib-storage: mail-storage - Add mailbox_has_special_use().

Implements checking whether a mailbox has a particular special-use flag.

5 years agolib-storage: mail-storage - Add API for allocating a mailbox based on a special-use...
Stephan Bosch [Thu, 5 Oct 2017 10:27:08 +0000 (12:27 +0200)] 
lib-storage: mail-storage - Add API for allocating a mailbox based on a special-use flag.

6 years agolib-storage: mail-storage - Merge mailbox_alloc_delivery() into mailbox_alloc_for_user().
Stephan Bosch [Wed, 2 Oct 2019 22:43:07 +0000 (00:43 +0200)] 
lib-storage: mail-storage - Merge mailbox_alloc_delivery() into mailbox_alloc_for_user().

Uses the MAILBOX_FLAG_POST_SESSION flag.

6 years agolib-storage: mail-storage - Add mailbox_alloc_for_user().
Stephan Bosch [Wed, 2 Oct 2019 21:54:44 +0000 (23:54 +0200)] 
lib-storage: mail-storage - Add mailbox_alloc_for_user().

6 years agolib-index: Fix checking if log file can be rotated
Timo Sirainen [Sat, 5 Oct 2019 12:46:47 +0000 (15:46 +0300)] 
lib-index: Fix checking if log file can be rotated

This fixes a bug caused by 883a3022992d0f832f0aff21572caeb7c63b7668 where
dovecot.index.log file wasn't rotated as often as it was supposed to be. It
also could have caused dovecot.index to be rewritten much more often than
it was supposed to be.

The buggy commit was correct that the tail_offset wasn't updated previously
to the dovecot.index.log file after changes. However, I didn't realize that
the tail_offset was internally still updated and required by this rotation
check to work correctly.

The fix works by relaxing the tail_offset==head_offset requirement for
rotation. It's enough that all the changes are synced, which can be checked
from mail_index_sync_ctx.fully_synced. Any changes after tail_offset are
then supposed to be external transactions, which aren't synced anyway, so
rotation is allowed.

6 years agolmtp: lmtp-proxy - Support forwarding a broken sender address to the backend LMTP...
Stephan Bosch [Fri, 13 Sep 2019 20:51:04 +0000 (22:51 +0200)] 
lmtp: lmtp-proxy - Support forwarding a broken sender address to the backend LMTP service.

This is subject to configuration.

6 years agolib-smtp: smtp-client - Add support for proxying MAIL command with broken path.
Stephan Bosch [Fri, 13 Sep 2019 20:33:05 +0000 (22:33 +0200)] 
lib-smtp: smtp-client - Add support for proxying MAIL command with broken path.

6 years agolmtp: Accept MAIL command with broken sender address.
Stephan Bosch [Fri, 13 Sep 2019 20:49:37 +0000 (22:49 +0200)] 
lmtp: Accept MAIL command with broken sender address.

The address is treated as <> in most cases. For logging, the unparsed broken
address is available in the `raw' field of the address.

6 years agolda: Accept -f argument with broken sender address.
Stephan Bosch [Sat, 14 Sep 2019 15:59:29 +0000 (17:59 +0200)] 
lda: Accept -f argument with broken sender address.

6 years agolib-smtp: smtp-server - Support accepting broken path parameter in MAIL command.
Stephan Bosch [Sat, 14 Sep 2019 15:59:08 +0000 (17:59 +0200)] 
lib-smtp: smtp-server - Support accepting broken path parameter in MAIL command.

6 years agolib-smtp: smtp-command-parser - Accept valid UTF-8 characters for command parameters.
Stephan Bosch [Fri, 4 Oct 2019 18:47:35 +0000 (20:47 +0200)] 
lib-smtp: smtp-command-parser - Accept valid UTF-8 characters for command parameters.

6 years agolib-smtp: smtp-address - Add smtp_address_is_broken().
Stephan Bosch [Fri, 13 Sep 2019 20:31:37 +0000 (22:31 +0200)] 
lib-smtp: smtp-address - Add smtp_address_is_broken().

6 years agolib-smtp: smtp-address - Add SMTP_ADDRESS_PARSE_FLAG_IGNORE_BROKEN parse flag.
Stephan Bosch [Fri, 13 Sep 2019 00:04:59 +0000 (02:04 +0200)] 
lib-smtp: smtp-address - Add SMTP_ADDRESS_PARSE_FLAG_IGNORE_BROKEN parse flag.

Makes the path parser try to skip over a broken address to allow working around
syntax errors in e.g. the sender address for the  MAIL command.

6 years agolib-smtp: smtp-address - Add SMTP_ADDRESS_PARSE_FLAG_PRESERVE_RAW parse flag.
Stephan Bosch [Fri, 13 Sep 2019 00:04:59 +0000 (02:04 +0200)] 
lib-smtp: smtp-address - Add SMTP_ADDRESS_PARSE_FLAG_PRESERVE_RAW parse flag.

It stores the unparsed representation of the address in the new raw field of
struct smtp_address. This is only relevant to smtp_address_parse_path().

6 years agolib-smtp: test-smtp-address - Restructure valid address tests.
Stephan Bosch [Sat, 14 Sep 2019 17:57:31 +0000 (19:57 +0200)] 
lib-smtp: test-smtp-address - Restructure valid address tests.

6 years agolib-smtp: smtp-address - Add smtp_address_encode_raw*().
Stephan Bosch [Fri, 13 Sep 2019 00:01:52 +0000 (02:01 +0200)] 
lib-smtp: smtp-address - Add smtp_address_encode_raw*().

These are special variants of smtp_address_encode*(), which use the new raw
field when it is set.

6 years agolib-smtp: smtp-address - Also copy the new raw field when cloning struct smtp_address.
Stephan Bosch [Thu, 12 Sep 2019 23:59:57 +0000 (01:59 +0200)] 
lib-smtp: smtp-address - Also copy the new raw field when cloning struct smtp_address.

6 years agolib-smtp: smtp-address - Add raw field to struct smtp_address.
Stephan Bosch [Thu, 12 Sep 2019 23:57:18 +0000 (01:57 +0200)] 
lib-smtp: smtp-address - Add raw field to struct smtp_address.

6 years agolib-smtp: smtp-address - Implement workarounds for parsing addresses with a bad local...
Stephan Bosch [Sun, 4 Nov 2018 18:00:47 +0000 (19:00 +0100)] 
lib-smtp: smtp-address - Implement workarounds for parsing addresses with a bad localpart.

Always parse it as normal when it starts with `<' or `"'. The workaround
consists of parsing the address by splitting it on the last `@'. The address is
accepted when the resulting localpart and domain can be used to compose a valid
address. This workaround is now shared with username-to-address parsing, which
existed before.

6 years agolib-smtp: smtp-address - Allow parsing address from username that contains space...
Stephan Bosch [Sun, 4 Nov 2018 18:09:41 +0000 (19:09 +0100)] 
lib-smtp: smtp-address - Allow parsing address from username that contains space, double quote or backslash.

Not allowing double quote and backslash was a bug, while space was explicitly
disallowed. However, these characters can be used in an RFC 5321 address when
inside a quoted string, so there is no reason to disallow those.

6 years agolib-smtp: smtp-address - Add smtp_address_parse_any().
Stephan Bosch [Tue, 10 Sep 2019 21:20:26 +0000 (23:20 +0200)] 
lib-smtp: smtp-address - Add smtp_address_parse_any().

This allows parsing any RFC5321 address as a string, even severely broken ones.

6 years agolib-smtp: smtp-address - Remove useless check in smtp_address_write().
Stephan Bosch [Fri, 13 Sep 2019 00:03:26 +0000 (02:03 +0200)] 
lib-smtp: smtp-address - Remove useless check in smtp_address_write().

6 years agolib-smtp: smtp-server-transaction - Create transaction using struct smtp_server_cmd_m...
Stephan Bosch [Tue, 10 Sep 2019 00:17:17 +0000 (02:17 +0200)] 
lib-smtp: smtp-server-transaction - Create transaction using struct smtp_server_cmd_mail directly.

Before, it used separate parameters for the individual fields, but that makes it
hard to extend.