]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agolib-http: client: Fix request statistics text to properly report send attempts.
Stephan Bosch [Tue, 27 Feb 2018 09:45:26 +0000 (10:45 +0100)] 
lib-http: client: Fix request statistics text to properly report send attempts.

If the request was first sent in the same ioloop cycle in which the text is
generated, the text would claim it was not sent at all yet.

With this commit the text now explicitly makes the distinction between request
attempts and actual send attempts. The number of attempts is increased at each
retry, while the send attempts are increased each time the request is actually
being sent to a server.

7 years agonotify: Ignore flag and keywords update during saving
Aki Tuomi [Mon, 26 Feb 2018 16:20:30 +0000 (18:20 +0200)] 
notify: Ignore flag and keywords update during saving

They are part of the saving event

7 years agoconfigure: Add spectre variant 2 mitigations
codarrenvelvindron [Sat, 17 Feb 2018 19:28:48 +0000 (14:28 -0500)] 
configure: Add spectre variant 2 mitigations

--enable-hardening adds -mfunction-return=thunk and -mindirect-branch=thunk
compiler options if supported.

7 years agolib-http: client: Add event fields for the number of bytes sent and received for...
Stephan Bosch [Mon, 19 Feb 2018 12:27:39 +0000 (13:27 +0100)] 
lib-http: client: Add event fields for the number of bytes sent and received for each request in the last attempt.

7 years agolib-http: response parser: Record input stream offset for the start of the last parse...
Stephan Bosch [Mon, 19 Feb 2018 12:24:57 +0000 (13:24 +0100)] 
lib-http: response parser: Record input stream offset for the start of the last parsed response.

7 years agolib-http: message parsers: Record beginning of parsed data.
Stephan Bosch [Mon, 19 Feb 2018 12:20:11 +0000 (13:20 +0100)] 
lib-http: message parsers: Record beginning of parsed data.

7 years agolib-http: client: Trigger special events when a request is finished, retried or redir...
Stephan Bosch [Sun, 21 Jan 2018 14:46:49 +0000 (15:46 +0100)] 
lib-http: client: Trigger special events when a request is finished, retried or redirected.

7 years agolib-http: client: Record last status code in the request object.
Stephan Bosch [Sun, 21 Jan 2018 15:19:41 +0000 (16:19 +0100)] 
lib-http: client: Record last status code in the request object.

7 years agolib-http: client: Reset redirect counter when the request is retried.
Stephan Bosch [Sun, 21 Jan 2018 15:08:55 +0000 (16:08 +0100)] 
lib-http: client: Reset redirect counter when the request is retried.

The absence of this reset caused problems when there was a redirect limit and
the request was retried, in which case the limit is reached too soon.

7 years agolib-http: client: Add "host" and "port" fields to request event.
Stephan Bosch [Sun, 21 Jan 2018 15:06:19 +0000 (16:06 +0100)] 
lib-http: client: Add "host" and "port" fields to request event.

7 years agolib-http: client: Use the new http_url_get_port*() functions.
Stephan Bosch [Sun, 21 Jan 2018 15:00:31 +0000 (16:00 +0100)] 
lib-http: client: Use the new  http_url_get_port*() functions.

7 years agolib-http: url: Add functions that obtain the effective port for the URL.
Stephan Bosch [Sun, 21 Jan 2018 14:54:18 +0000 (15:54 +0100)] 
lib-http: url: Add functions that obtain the effective port for the URL.

When no port is set for the URL, it is set to 0. These functions substitute the
applicable default.

7 years agolib-http: Create http-common.h, which contains global definitions shared by client...
Stephan Bosch [Sun, 21 Jan 2018 14:50:37 +0000 (15:50 +0100)] 
lib-http: Create http-common.h, which contains global definitions shared by client and server.

Currently contains only the default HTTP port definitions that used to be
private to the client.

7 years agolmtp: proxy: Do not forward 421 reply (server shutdown) from backend.
Stephan Bosch [Fri, 23 Feb 2018 20:09:42 +0000 (21:09 +0100)] 
lmtp: proxy: Do not forward 421 reply (server shutdown) from backend.

This closes the LMTP connection implicitly. Instead, translate it into a 451
4.4.0 response, just like all the other connection-related failures.

7 years agolib-smtp: client: transaction: Better document the failure handling for incomplete...
Stephan Bosch [Fri, 23 Feb 2018 19:49:48 +0000 (20:49 +0100)] 
lib-smtp: client: transaction: Better document the failure handling for incomplete transactions.

7 years agolib-smtp: client: transaction: Don't call the DATA callbacks upon failure until the...
Stephan Bosch [Fri, 23 Feb 2018 19:43:50 +0000 (20:43 +0100)] 
lib-smtp: client: transaction: Don't call the DATA callbacks upon failure until the transaction is complete.

The transaction is not complete until smtp_client_transaction_send() is called.

7 years agolib-smtp: client: transaction: Properly advance the transaction to the DATA state...
Stephan Bosch [Fri, 23 Feb 2018 17:21:49 +0000 (18:21 +0100)] 
lib-smtp: client: transaction: Properly advance the transaction to the DATA state once the DATA command is to be sent.

7 years agolib-smtp: client: transaction: Use the correct callback for finish timeout.
Stephan Bosch [Fri, 23 Feb 2018 17:16:57 +0000 (18:16 +0100)] 
lib-smtp: client: transaction: Use the correct callback for finish timeout.

7 years agolib-storage: Add NO-FS-VALIDATION flag
Aki Tuomi [Sat, 16 Dec 2017 16:16:10 +0000 (18:16 +0200)] 
lib-storage: Add NO-FS-VALIDATION flag

7 years agolib-storage: Never prevent using '/' in mailbox names with mail_full_filesystem_acces...
Timo Sirainen [Sat, 17 Feb 2018 20:10:17 +0000 (22:10 +0200)] 
lib-storage: Never prevent using '/' in mailbox names with mail_full_filesystem_access=yes

It was already allowed with LAYOUT=fs, but not with e.g. LAYOUT=Maildir++.
Now it's possible to use e.g. SELECT /home/shareduser/Maildir/test.box

7 years agoimapc: Avoid duplicate FETCH BODY.PEEK[] when mail is already expunged
Timo Sirainen [Thu, 22 Feb 2018 13:55:20 +0000 (15:55 +0200)] 
imapc: Avoid duplicate FETCH BODY.PEEK[] when mail is already expunged

When the first FETCH (e.g. as part of mail_prefetch()) indicated that the
mail is already expunged, there's no need to do it again.

7 years agolib: Fix buffer code to satisfy static analyzers
Aki Tuomi [Tue, 20 Feb 2018 10:04:13 +0000 (12:04 +0200)] 
lib: Fix buffer code to satisfy static analyzers

7 years agolib: randgen - Init seed to 0
Aki Tuomi [Thu, 8 Feb 2018 09:56:08 +0000 (11:56 +0200)] 
lib: randgen - Init seed to 0

Satisfies static analyzer, the seed is guaranteed to get
filled with random data.

7 years agotrash: Use TRASH_USER_CONTEXT_REQUIRE
Aki Tuomi [Thu, 8 Feb 2018 09:45:20 +0000 (11:45 +0200)] 
trash: Use TRASH_USER_CONTEXT_REQUIRE

Satisfies static analyzer

7 years agolib-storage: Assert unique_root_dir is set with MAIL_STORAGE_CLASS_FLAG_UNIQUE_ROOT
Timo Sirainen [Mon, 19 Feb 2018 11:21:25 +0000 (13:21 +0200)] 
lib-storage: Assert unique_root_dir is set with MAIL_STORAGE_CLASS_FLAG_UNIQUE_ROOT

7 years agolib-storage: shared driver - Remove copying the child storage's class_flags
Timo Sirainen [Mon, 19 Feb 2018 11:22:02 +0000 (13:22 +0200)] 
lib-storage: shared driver - Remove copying the child storage's class_flags

The shared storage root itself doesn't have any storage, so it shouldn't
need to copy the child storage's class_flags either.

This fixes a crash when shared namespace was created with mdbox storage, and
another mdbox namespace was created afterwards. This had
MAIL_STORAGE_CLASS_FLAG_UNIQUE_ROOT set, but its unique_root_dir is NULL,
which caused a crash in mail_storage_match_class().

7 years agoglobal: Use unix_socket capability in connection.c
Aki Tuomi [Mon, 19 Feb 2018 17:22:42 +0000 (19:22 +0200)] 
global: Use unix_socket capability in connection.c

This is more reliably way to correctly create input stream
with unix socket capability for passing fd's around

7 years agolib: connection - only switch created iostreams
Aki Tuomi [Mon, 19 Feb 2018 17:09:46 +0000 (19:09 +0200)] 
lib: connection - only switch created iostreams

Fixes imap-hibernate: Fatal: master: service(imap-hibernate):
child killed with signal 11 (core dumps disabled)

Broken in 086b73efd1a5812a64acc951366a499d325509a6

7 years agolib-storage: Unless LAYOUT=index, don't rebuild list index on missing INBOX
Timo Sirainen [Mon, 19 Feb 2018 12:44:04 +0000 (14:44 +0200)] 
lib-storage: Unless LAYOUT=index, don't rebuild list index on missing INBOX

7 years agolib-storage: mailbox_list_index_handle_corruption() - Lock mailbox list while rebuilding
Timo Sirainen [Mon, 19 Feb 2018 10:54:53 +0000 (12:54 +0200)] 
lib-storage: mailbox_list_index_handle_corruption() - Lock mailbox list while rebuilding

This guards against simultaneous mailbox create/delete/rename.

7 years agolib-storage: mailbox_list_index_handle_corruption() - Move actual handling to its...
Timo Sirainen [Mon, 19 Feb 2018 10:53:46 +0000 (12:53 +0200)] 
lib-storage: mailbox_list_index_handle_corruption() - Move actual handling to its own function

7 years agolib-storage: Generate snippet while saving new mails
Josef 'Jeff' Sipek [Sun, 18 Feb 2018 23:07:16 +0000 (18:07 -0500)] 
lib-storage: Generate snippet while saving new mails

7 years agolib-storage: Make index_mail_want_cache() global
Timo Sirainen [Mon, 19 Feb 2018 13:43:31 +0000 (15:43 +0200)] 
lib-storage: Make index_mail_want_cache() global

7 years agolib-storage: move snippet generation to mail-save-finish
Josef 'Jeff' Sipek [Sun, 18 Feb 2018 23:06:48 +0000 (18:06 -0500)] 
lib-storage: move snippet generation to mail-save-finish

This is necessary because some storage backends (most notably sdbox) do
not allow getting the mail stream before the mail is fully written out.
(See written_to_disk in sdbox-file.h.)

If we could avoid getting the stream to generate a snippet we could
leave this where it is.

7 years agodoveadm dump: Show body.snippet in human-readable form
Timo Sirainen [Mon, 19 Feb 2018 13:38:13 +0000 (15:38 +0200)] 
doveadm dump: Show body.snippet in human-readable form

7 years agolib-ssl-iostream: Use SSL_CTX_set_ecdh_auto macro
Aki Tuomi [Mon, 19 Feb 2018 07:57:17 +0000 (09:57 +0200)] 
lib-ssl-iostream: Use SSL_CTX_set_ecdh_auto macro

This macro is same for 1.0.2 and 1.1.0 and libressl.

7 years agoimap: If snippet is not available return NIL
Aki Tuomi [Sun, 18 Feb 2018 16:11:18 +0000 (18:11 +0200)] 
imap: If snippet is not available return NIL

7 years agoimap: Fix FETCH SNIPPET
Timo Sirainen [Sat, 17 Feb 2018 22:53:12 +0000 (00:53 +0200)] 
imap: Fix FETCH SNIPPET

1) _BUFFERED flag wasn't set, which caused a missing space before the "SNIPPET".
2) It caused \Seen flag to be added to the mail

7 years agodoveadm sync/backup: Don't override BROKENCHAR if it's already set
Timo Sirainen [Fri, 16 Feb 2018 14:03:46 +0000 (16:03 +0200)] 
doveadm sync/backup: Don't override BROKENCHAR if it's already set

This allows migrating invalid mailbox names by specifying BROKENCHAR.
Previously it would always try to use \003 control character, which isn't
valid character in mailbox names so the mailbox creation would fail.

7 years agocharset-alias: Fix keyvalues iteration
Martti Rannanjärvi [Fri, 16 Feb 2018 14:59:35 +0000 (16:59 +0200)] 
charset-alias: Fix keyvalues iteration

charset-alias-plugin.c:113:27: error: comparison between pointer and zero
character constant [-Werror=pointer-compare]
  for (i = 0; keyvalues[i] != '\0'; i++) {
                           ^~
charset-alias-plugin.c:113:14: note: did you mean to dereference the pointer?
  for (i = 0; keyvalues[i] != '\0'; i++) {

7 years agocharset-alias: Cleanup whitespace
Martti Rannanjärvi [Fri, 16 Feb 2018 14:53:04 +0000 (16:53 +0200)] 
charset-alias: Cleanup whitespace

Remove \r from end of lines and remove trailing whitespace.

7 years agolib-http: client: Simplified return code handling in http_client_request_send_real().
Stephan Bosch [Sat, 17 Feb 2018 14:02:53 +0000 (15:02 +0100)] 
lib-http: client: Simplified return code handling in http_client_request_send_real().

7 years agolib-http: client: Make sure output is used only when valid in http_client_request_sen...
Stephan Bosch [Sat, 17 Feb 2018 13:54:47 +0000 (14:54 +0100)] 
lib-http: client: Make sure output is used only when valid in http_client_request_send_real().

7 years agolib-http: client: Uncork and flush the output stream explicitly after continuing...
Stephan Bosch [Sat, 17 Feb 2018 11:03:41 +0000 (12:03 +0100)] 
lib-http: client: Uncork and flush the output stream explicitly after continuing request payload.

This allows detecting any output stream errors.

7 years agolib-http: client: Hold reference to the connection while continuing request payload.
Stephan Bosch [Sat, 17 Feb 2018 14:17:06 +0000 (15:17 +0100)] 
lib-http: client: Hold reference to the connection while continuing request payload.

Subsequent changes may cause the connection to be destroyed while sending.

7 years agolib-http: client: Continue sending request payload in a separate function.
Stephan Bosch [Sat, 17 Feb 2018 11:01:47 +0000 (12:01 +0100)] 
lib-http: client: Continue sending request payload in a separate function.

7 years agolib-http: client: Hold reference to the connection while sending the next request.
Stephan Bosch [Sat, 17 Feb 2018 14:08:44 +0000 (15:08 +0100)] 
lib-http: client: Hold reference to the connection while sending the next request.

Subsequent changes may cause the connection to be destroyed while sending.

7 years agolib-http: client: Perform output stream error handling in one place.
Stephan Bosch [Sat, 17 Feb 2018 10:32:37 +0000 (11:32 +0100)] 
lib-http: client: Perform output stream error handling in one place.

7 years agolib-http: client: Make http_client_connection_lost() available outside http-client...
Stephan Bosch [Sat, 17 Feb 2018 10:10:05 +0000 (11:10 +0100)] 
lib-http: client: Make http_client_connection_lost() available outside http-client-connection.c.

7 years agolib-http: client: Handle output stream errors in a separate function.
Stephan Bosch [Sat, 17 Feb 2018 10:08:20 +0000 (11:08 +0100)] 
lib-http: client: Handle output stream errors in a separate function.

7 years agolib-http: client: Flush and check output for errors after uncorking.
Stephan Bosch [Sat, 17 Feb 2018 00:25:50 +0000 (01:25 +0100)] 
lib-http: client: Flush and check output for errors after uncorking.

Otherwise, a disconnection event may be missed.

7 years agolib-http: server: Simplified return code handling in http_server_response_send_real().
Stephan Bosch [Sat, 17 Feb 2018 14:37:20 +0000 (15:37 +0100)] 
lib-http: server: Simplified return code handling in http_server_response_send_real().

7 years agolib-http: server: Make sure output is used only when valid in http_server_response_se...
Stephan Bosch [Sat, 17 Feb 2018 14:29:20 +0000 (15:29 +0100)] 
lib-http: server: Make sure output is used only when valid in http_server_response_send_real().

This avoids the need to hold a reference to it.

7 years agolib-http: server: Perform output stream error handling in one place.
Stephan Bosch [Sat, 17 Feb 2018 00:26:02 +0000 (01:26 +0100)] 
lib-http: server: Perform output stream error handling in one place.

7 years agolib-http: server: Flush and check output for errors after uncorking.
Stephan Bosch [Sat, 17 Feb 2018 13:44:49 +0000 (14:44 +0100)] 
lib-http: server: Flush and check output for errors after uncorking.

Otherwise, a disconnection event may be missed.

7 years agolib-http: server: Handle output stream errors in a separate function.
Stephan Bosch [Sat, 17 Feb 2018 13:28:36 +0000 (14:28 +0100)] 
lib-http: server: Handle output stream errors in a separate function.

7 years agolib-smtp: client: Uncork and flush the output stream explicitly after sending commands.
Stephan Bosch [Sat, 17 Feb 2018 09:26:30 +0000 (10:26 +0100)] 
lib-smtp: client: Uncork and flush the output stream explicitly after sending commands.

This allows detecting any output stream errors.

7 years agolib-smtp: client: Perform output stream error handling in one place.
Stephan Bosch [Sat, 17 Feb 2018 00:46:15 +0000 (01:46 +0100)] 
lib-smtp: client: Perform output stream error handling in one place.

7 years agolib-smtp: client: Flush and check output for errors after uncorking.
Stephan Bosch [Fri, 16 Feb 2018 22:49:31 +0000 (23:49 +0100)] 
lib-smtp: client: Flush and check output for errors after uncorking.

Otherwise, a disconnection event may be missed.

7 years agolib-smtp: client: Handle output stream errors in a separate function.
Stephan Bosch [Fri, 16 Feb 2018 22:40:29 +0000 (23:40 +0100)] 
lib-smtp: client: Handle output stream errors in a separate function.

7 years agolib-smtp: server: Perform output stream error handling in one place.
Stephan Bosch [Sat, 17 Feb 2018 00:46:25 +0000 (01:46 +0100)] 
lib-smtp: server: Perform output stream error handling in one place.

7 years agolib-smtp: server: Remove undefined smtp_server_reply_send_more() from smtp-server...
Stephan Bosch [Sat, 17 Feb 2018 09:37:55 +0000 (10:37 +0100)] 
lib-smtp: server: Remove undefined smtp_server_reply_send_more() from smtp-server-private.h.

7 years agolib-smtp: server: Flush and check output for errors after uncorking.
Stephan Bosch [Fri, 16 Feb 2018 09:05:26 +0000 (10:05 +0100)] 
lib-smtp: server: Flush and check output for errors after uncorking.

Otherwise, a disconnection event may be missed.

7 years agolib-smtp: server: STARTTLS command: Properly handle output stream flush error.
Stephan Bosch [Fri, 16 Feb 2018 09:13:35 +0000 (10:13 +0100)] 
lib-smtp: server: STARTTLS command: Properly handle output stream flush error.

7 years agolib-smtp: server: Handle output stream errors in a separate function.
Stephan Bosch [Fri, 16 Feb 2018 09:11:01 +0000 (10:11 +0100)] 
lib-smtp: server: Handle output stream errors in a separate function.

7 years agolib-smtp: server: Use the stream_errno to evaluate output stream errors.
Stephan Bosch [Fri, 16 Feb 2018 08:34:48 +0000 (09:34 +0100)] 
lib-smtp: server: Use the stream_errno to evaluate output stream errors.

Code was using global errno.

7 years agolib-smtp: server: Remove inappropriate assert from MAIL command.
Stephan Bosch [Thu, 15 Feb 2018 23:44:07 +0000 (00:44 +0100)] 
lib-smtp: server: Remove inappropriate assert from MAIL command.

When the MAIL command is next to reply, it is possible to have RCPT commands
that are still pending.

7 years agoimap: Don't enforce sending SNIPPET reply as literal
Timo Sirainen [Fri, 16 Feb 2018 12:49:59 +0000 (14:49 +0200)] 
imap: Don't enforce sending SNIPPET reply as literal

Also change it to use "cur_str" since the reply is never very long.

7 years agoimap: Add parenthesis to FETCH SNIPPET (FUZZY text) response
Timo Sirainen [Fri, 16 Feb 2018 12:46:36 +0000 (14:46 +0200)] 
imap: Add parenthesis to FETCH SNIPPET (FUZZY text) response

Otherwise it violates the RFC 3501 text about FETCH responses.

7 years agoimap: Don't set storage callbacks before namespaces are created
Timo Sirainen [Thu, 15 Feb 2018 16:16:15 +0000 (18:16 +0200)] 
imap: Don't set storage callbacks before namespaces are created

This fixes sending untagged OK/NO notifications from storage (e.g. lock
waits/override notifications). It was broken by
e031d9aaae59a9f79710dc1138b76b69272615a3

7 years agoimap: Add client_create_finish() to finish namespace creation.
Timo Sirainen [Thu, 15 Feb 2018 16:15:16 +0000 (18:15 +0200)] 
imap: Add client_create_finish() to finish namespace creation.

7 years agoimap: When running standalone, delay initializing namespaces until PREAUTH is sent
Timo Sirainen [Thu, 15 Feb 2018 16:13:20 +0000 (18:13 +0200)] 
imap: When running standalone, delay initializing namespaces until PREAUTH is sent

Most importantly this makes the code paths similar for standalone and
non-standalone clients, which is needed by the following commits.

7 years agolib: Fix compiler warning when arc4random_buf() is used for random_fill()
Timo Sirainen [Fri, 16 Feb 2018 12:33:33 +0000 (14:33 +0200)] 
lib: Fix compiler warning when arc4random_buf() is used for random_fill()

7 years agolib: Add o_stream_uncork_flush() to both uncork and flush
Timo Sirainen [Fri, 16 Feb 2018 12:26:11 +0000 (14:26 +0200)] 
lib: Add o_stream_uncork_flush() to both uncork and flush

7 years agocharset-alias-plugin
Hideo Yoshizane [Thu, 25 Jan 2018 00:36:22 +0000 (19:36 -0500)] 
charset-alias-plugin

7 years agolib-mail: message-parser: Fixed Clang 6.0 compiler warning.
Stephan Bosch [Thu, 15 Feb 2018 22:41:25 +0000 (23:41 +0100)] 
lib-mail: message-parser: Fixed Clang 6.0 compiler warning.

Warning was:

index-mail.c:1182:3: warning: arithmetic on a null pointer treated as a cast
from integer to pointer is a GNU extension [-Wnull-pointer-arithmetic]
                message_parser_parse_body(data->parser_ctx,
                ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../../src/lib-mail/message-parser.h:95:28: note: expanded from macro
'message_parser_parse_body'
                (void *)((char *)context + CALLBACK_TYPECHECK(callback, \
                         ~~~~~~~~~~~~~~~ ^

7 years agolib-master: Don't dup errors to service->set_pool in master_service_settings_read
Martti Rannanjärvi [Thu, 15 Feb 2018 15:50:43 +0000 (17:50 +0200)] 
lib-master: Don't dup errors to service->set_pool in master_service_settings_read

Use t_strdup() instead.

7 years agolib-http: server: Recreate connection IO after streams change.
Stephan Bosch [Fri, 9 Feb 2018 22:57:29 +0000 (23:57 +0100)] 
lib-http: server: Recreate connection IO after streams change.

7 years agolib-http: client: Recreate connection IO after streams change.
Stephan Bosch [Fri, 9 Feb 2018 22:56:55 +0000 (23:56 +0100)] 
lib-http: client: Recreate connection IO after streams change.

7 years agolib-smtp: server: Recreate connection IO after streams change.
Stephan Bosch [Fri, 9 Feb 2018 23:07:37 +0000 (00:07 +0100)] 
lib-smtp: server: Recreate connection IO after streams change.

7 years agolib-http: server: Use the new connection_input_halt/resume() functions.
Stephan Bosch [Sat, 10 Feb 2018 09:29:44 +0000 (10:29 +0100)] 
lib-http: server: Use the new connection_input_halt/resume() functions.

7 years agolib-http: client: Use the new connection_input_halt/resume() functions.
Stephan Bosch [Sat, 10 Feb 2018 09:27:19 +0000 (10:27 +0100)] 
lib-http: client: Use the new connection_input_halt/resume() functions.

7 years agolib-smtp: server: Use the new connection_input_halt/resume() functions.
Stephan Bosch [Sat, 10 Feb 2018 09:07:28 +0000 (10:07 +0100)] 
lib-smtp: server: Use the new connection_input_halt/resume() functions.

7 years agolib-smtp: client: Use the new connection_input_halt/resume() functions.
Stephan Bosch [Sat, 10 Feb 2018 09:01:20 +0000 (10:01 +0100)] 
lib-smtp: client: Use the new connection_input_halt/resume() functions.

7 years agolib-ssl-iostream: ostream-openssl: Fix behavior of o_stream_flush() so that 1 is...
Stephan Bosch [Fri, 9 Feb 2018 16:24:28 +0000 (17:24 +0100)] 
lib-ssl-iostream: ostream-openssl: Fix behavior of o_stream_flush() so that 1 is only returned when buffer is empty.

7 years agolib-ssl-iostream: ostream-openssl: Create local variable for sstream->ssl_io->plain_o...
Stephan Bosch [Thu, 15 Feb 2018 14:47:48 +0000 (15:47 +0100)] 
lib-ssl-iostream: ostream-openssl: Create local variable for sstream->ssl_io->plain_output in o_stream_ssl_flush().

7 years agolib: connection: Add connection_input_halt() and connection_input_resume().
Stephan Bosch [Sat, 10 Feb 2018 08:55:43 +0000 (09:55 +0100)] 
lib: connection: Add connection_input_halt() and connection_input_resume().

These are convenience functions that remove and add conn->io respectively.

7 years agolib-smtp: client: Moved smtp_client_init_ssl_ctx() from smtp-client.h to smtp-client...
Stephan Bosch [Sat, 10 Feb 2018 08:37:32 +0000 (09:37 +0100)] 
lib-smtp: client: Moved smtp_client_init_ssl_ctx() from smtp-client.h to smtp-client-private.h.

7 years agolib-http: client: Use conn->conn.ioloop rather than cctx->ioloop in connection.
Stephan Bosch [Sat, 10 Feb 2018 09:46:45 +0000 (10:46 +0100)] 
lib-http: client: Use conn->conn.ioloop rather than cctx->ioloop in connection.

This leads to somewhat simpler code, and makes having connections on different
ioloops easier in the future.

7 years agolib: connection: Record the ioloop the connection was last switched to.
Stephan Bosch [Sat, 10 Feb 2018 09:20:18 +0000 (10:20 +0100)] 
lib: connection: Record the ioloop the connection was last switched to.

7 years agolib-http: client: Move connection to shared context's ioloop, rather than the current...
Stephan Bosch [Sat, 10 Feb 2018 09:53:00 +0000 (10:53 +0100)] 
lib-http: client: Move connection to shared context's ioloop, rather than the current_ioloop.

This is an omission.

7 years agolib-smtp: server: Fix segfault occurring when XCLIENT command is handled.
Stephan Bosch [Wed, 14 Feb 2018 21:20:20 +0000 (22:20 +0100)] 
lib-smtp: server: Fix segfault occurring when XCLIENT command is handled.

Occurs only when the application (in this case LMTP) has a
conn_proxy_data_updated() callback. The context parameter was the struct
smtp_server_connection object itself, rather than the application context. This
caused the connection object to be overwritten.

7 years agolib-smtp: server: Fix segfault occurring during XCLIENT when no extension fields...
Stephan Bosch [Tue, 13 Feb 2018 19:42:30 +0000 (20:42 +0100)] 
lib-smtp: server: Fix segfault occurring during XCLIENT when no extension fields are configured.

7 years agolib-imap-storage: imap-msgpart-url: Perform the check for a proper messagepart URL...
Stephan Bosch [Tue, 13 Feb 2018 20:19:18 +0000 (21:19 +0100)] 
lib-imap-storage: imap-msgpart-url: Perform the check for a proper messagepart URL in imap_msgpart_url_create().

Before, this was an assert in imap_msgpart_url_create(). The actual check was
performed only in imap_msgpart_url_parse(), meaning that
imap_msgpart_url_create() would fail with an assertion when provided with an
inappropriate URL.

This surfaced as a problem for the submission BURL command.

7 years agolib-smtp: server: Fix reporting of XCLIENT capability in EHLO response.
Stephan Bosch [Wed, 14 Feb 2018 00:30:14 +0000 (01:30 +0100)] 
lib-smtp: server: Fix reporting of XCLIENT capability in EHLO response.

The trusted connection check logic was inverted.

7 years agoreplication: Don't trigger replication on changes not visible to dsync
Timo Sirainen [Thu, 8 Feb 2018 15:19:24 +0000 (17:19 +0200)] 
replication: Don't trigger replication on changes not visible to dsync

For example if there's a write to .cache file, it doesn't require
replication.

7 years agolib-storage: Replace mail_transaction_commit_changes.changed with changes_mask
Timo Sirainen [Thu, 8 Feb 2018 15:17:59 +0000 (17:17 +0200)] 
lib-storage: Replace mail_transaction_commit_changes.changed with changes_mask

This allows better finding out what changed in the transaction.

7 years agolib-storage: Include mail-index.h from mail-storage.h
Timo Sirainen [Thu, 8 Feb 2018 15:14:53 +0000 (17:14 +0200)] 
lib-storage: Include mail-index.h from mail-storage.h

This makes it a bit more acceptable to use mail-index.h API, without having
to go through the lib-storage layer. This is also needed by the next patch
to avoid duplicating the same enum in both lib-index and lib-storage layer.

7 years agolib-storage: Remove mailbox_transaction_context.nontransactional_changes
Timo Sirainen [Thu, 8 Feb 2018 15:00:38 +0000 (17:00 +0200)] 
lib-storage: Remove mailbox_transaction_context.nontransactional_changes

Nothing cares about them. It was only set for POP3 UIDL change with
Maildir. In theory dsync replication would want to replicate such a change,
but it doesn't actually support changing UIDLs for existing mails. Other
mailbox formats don't support it anyway.

7 years agolib-index: Add mail_index_transaction_commit_result.changes_mask
Timo Sirainen [Thu, 8 Feb 2018 14:53:15 +0000 (16:53 +0200)] 
lib-index: Add mail_index_transaction_commit_result.changes_mask

This can be used to determine what type of changes were committed in a
transaction.