]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agolib-storage: MBOX_LIST_CONTEXT now requires context
Aki Tuomi [Wed, 17 Jan 2018 07:29:23 +0000 (09:29 +0200)] 
lib-storage: MBOX_LIST_CONTEXT now requires context

Satisfies static analyzers

7 years agolib-storage: INDEX_LIST_STORAGE_CONTEXT now requires context
Aki Tuomi [Wed, 17 Jan 2018 07:29:53 +0000 (09:29 +0200)] 
lib-storage: INDEX_LIST_STORAGE_CONTEXT now requires context

Satisfies static analyzers

7 years agolib-storage: INDEX_STORAGE_CONTEXT now requires context
Aki Tuomi [Wed, 17 Jan 2018 07:25:26 +0000 (09:25 +0200)] 
lib-storage: INDEX_STORAGE_CONTEXT now requires context

Satisfies static analyzers

7 years agolib-lda: Require context in mail-deliver
Aki Tuomi [Wed, 17 Jan 2018 10:24:21 +0000 (12:24 +0200)] 
lib-lda: Require context in mail-deliver

Satisfies static analyzers

7 years agolib: Add MODULE_CONTEXT_REQUIRE
Aki Tuomi [Fri, 12 Jan 2018 13:10:48 +0000 (15:10 +0200)] 
lib: Add MODULE_CONTEXT_REQUIRE

This will panic instead of return NULL. Should satisfy static
analyzers when used.

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 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 agoglobal: Flip MAIL_STORAGE_SERVICE_FLAG_DISALLOW_ROOT to ..._ALLOW_ROOT
Martti Rannanjärvi [Wed, 13 Dec 2017 17:05:30 +0000 (19:05 +0200)] 
global: Flip MAIL_STORAGE_SERVICE_FLAG_DISALLOW_ROOT to ..._ALLOW_ROOT

7 years agolib-storage: Flip disallow_root in service_drop_privileges()
Martti Rannanjärvi [Fri, 29 Sep 2017 11:16:52 +0000 (14:16 +0300)] 
lib-storage: Flip disallow_root in service_drop_privileges()

7 years agomaster: Flip disallow_root in drop_privileges()
Martti Rannanjärvi [Fri, 29 Sep 2017 10:47:22 +0000 (13:47 +0300)] 
master: Flip disallow_root in drop_privileges()

7 years agolib: Add restrict_access_flags enum to use with restrict_access[_by_env]()
Martti Rannanjärvi [Fri, 29 Sep 2017 10:40:12 +0000 (13:40 +0300)] 
lib: Add restrict_access_flags enum to use with restrict_access[_by_env]()

Swap parameter locations in the functions to make sure plugins are
updated to use the new api.

7 years agolib: Flip drop_setuid_root in restrict_access_settings
Martti Rannanjärvi [Mon, 18 Dec 2017 09:35:27 +0000 (11:35 +0200)] 
lib: Flip drop_setuid_root in restrict_access_settings

7 years agolib-program-client: Remove extra drop_setuid_root flag copy
Martti Rannanjärvi [Mon, 18 Dec 2017 10:44:14 +0000 (12:44 +0200)] 
lib-program-client: Remove extra drop_setuid_root flag copy

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-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 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 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 agocharset-alias-plugin
Hideo Yoshizane [Thu, 25 Jan 2018 00:36:22 +0000 (19:36 -0500)] 
charset-alias-plugin

7 years agolmtp: local: Use recipient index in lmtp_local_rcpt_reply_overquota().
Stephan Bosch [Wed, 31 Jan 2018 09:27:54 +0000 (10:27 +0100)] 
lmtp: local: Use recipient index in lmtp_local_rcpt_reply_overquota().

When used during the DATA command, it should send a reply for the correct
recipient. During the RCPT command there is only one reply due. Added assert
that checks this.

7 years agolmtp: local: Add explicit cmd parameter to lmtp_local_rcpt_reply_overquota().
Stephan Bosch [Wed, 31 Jan 2018 09:34:11 +0000 (10:34 +0100)] 
lmtp: local: Add explicit cmd parameter to lmtp_local_rcpt_reply_overquota().

Using the RCPT cmd is only valid for the RCPT command and not when quota excess
is detected during DATA. That would cause a segmentation fault, since
rcpt->rcpt.rcpt_cmd == NULL.

7 years agolmtp: local: Make local variable for rcpt->rcpt.rcpt_cmd in lmtp_local_rcpt_check_quo...
Stephan Bosch [Wed, 31 Jan 2018 09:30:23 +0000 (10:30 +0100)] 
lmtp: local: Make local variable for rcpt->rcpt.rcpt_cmd in lmtp_local_rcpt_check_quota().

7 years agolmtp: local: Fix segfault occurring when quota is exceeded.
Stephan Bosch [Wed, 17 Jan 2018 20:26:44 +0000 (21:26 +0100)] 
lmtp: local: Fix segfault occurring when quota is exceeded.

7 years agolib-smtp: client: Fix ignoring invalid certificate from server.
Stephan Bosch [Thu, 25 Jan 2018 21:24:05 +0000 (22:24 +0100)] 
lib-smtp: client: Fix ignoring invalid certificate from server.

Although it initially allowed the invalid certificate, it would still fail later
on while reading/writing the SSL streams.

7 years agoauth: Set correct context type when bypassing reporting in auth_success
Aki Tuomi [Mon, 12 Feb 2018 10:28:37 +0000 (12:28 +0200)] 
auth: Set correct context type when bypassing reporting in auth_success

Broken in 41ff6e6a4a085786d4c15a58c7c50a28e2110c3f

7 years agoauth: Add policy check configuration options
Aki Tuomi [Tue, 6 Feb 2018 07:48:11 +0000 (09:48 +0200)] 
auth: Add policy check configuration options

Allows disabling before/after auth checks, or reporting.

7 years agoauth: Use correct username is auth policy requests
Aki Tuomi [Mon, 5 Feb 2018 12:26:15 +0000 (14:26 +0200)] 
auth: Use correct username is auth policy requests

When doing master authentication as first, use
the username of the user, not master user, for policy lookup.

7 years agolib-ssl-iostream: Assert-crash if input stream has IO already set
Timo Sirainen [Thu, 8 Feb 2018 00:26:23 +0000 (02:26 +0200)] 
lib-ssl-iostream: Assert-crash if input stream has IO already set

7 years agolib: Add i_stream_get_root_io() and use it to deduplicate code
Timo Sirainen [Thu, 8 Feb 2018 00:22:18 +0000 (02:22 +0200)] 
lib: Add i_stream_get_root_io() and use it to deduplicate code

7 years agolib-smtp: Recreate connection IO after streams change
Timo Sirainen [Thu, 8 Feb 2018 08:53:50 +0000 (10:53 +0200)] 
lib-smtp: Recreate connection IO after streams change

This fixes hangs after STARTTLS.

Originally by Stephan Bosch

7 years agolib: Add connection_streams_changed()
Timo Sirainen [Thu, 8 Feb 2018 08:52:57 +0000 (10:52 +0200)] 
lib: Add connection_streams_changed()

Originally by Stephan Bosch

7 years agodoveadm: client: Set IO only after enabling SSL
Timo Sirainen [Thu, 8 Feb 2018 00:38:23 +0000 (02:38 +0200)] 
doveadm: client: Set IO only after enabling SSL

io_add_istream() needs to be used with the SSL istream, otherwise it can
cause hangs.

7 years agolib-imap-client: Fix IO after enabling SSL
Timo Sirainen [Thu, 8 Feb 2018 00:28:54 +0000 (02:28 +0200)] 
lib-imap-client: Fix IO after enabling SSL

io_add_istream() needs to be used with the SSL istream, otherwise it can
cause hangs.

7 years agoreplication: Don't send notification for changes done by dsync transactions
Timo Sirainen [Tue, 6 Feb 2018 13:12:26 +0000 (15:12 +0200)] 
replication: Don't send notification for changes done by dsync transactions

7 years agolib-storage: Set mailbox_transaction_context.flags earlier
Timo Sirainen [Tue, 6 Feb 2018 13:10:48 +0000 (15:10 +0200)] 
lib-storage: Set mailbox_transaction_context.flags earlier

Set it in index_transaction_init() so plugins' transaction_begin() methods
see it after calling super.transaction_begin().

7 years agoold-stats: Set process dumpable during stats gathering
Aki Tuomi [Thu, 8 Feb 2018 11:04:48 +0000 (13:04 +0200)] 
old-stats: Set process dumpable during stats gathering

/proc/self/io is not accessible otherwise

7 years agolib: Add restrict_access_get/set_dumpable
Aki Tuomi [Thu, 8 Feb 2018 11:03:37 +0000 (13:03 +0200)] 
lib: Add restrict_access_get/set_dumpable

7 years agolib: Clarify restrict_access_allow_coredumps
Aki Tuomi [Thu, 8 Feb 2018 11:01:50 +0000 (13:01 +0200)] 
lib: Clarify restrict_access_allow_coredumps

7 years agolib-index: Fix assert-crash with lock_method=dotlock
Timo Sirainen [Wed, 7 Feb 2018 14:17:13 +0000 (16:17 +0200)] 
lib-index: Fix assert-crash with lock_method=dotlock

The dotlock wasn't deleted in all code paths. Fix this by simplifying
the unlocking to be done the same way with and without dotlock.

Fixes:
Panic: file mail-cache.c: line 624 (mail_cache_lock_file): assertion failed: (cache->dotlock == NULL)

7 years agolib-storage: Lock mailbox_list for mailbox create/delete/rename
Timo Sirainen [Tue, 9 Jan 2018 20:37:25 +0000 (15:37 -0500)] 
lib-storage: Lock mailbox_list for mailbox create/delete/rename

This is only required for mailbox creation to fix a race condition with
LAYOUT=index: If INBOX doesn't exist it will rescan the mailboxes to
find out if there are any missing ones. If INBOX creation isn't locked,
it's possible that the first process hasn't finished creating INBOX
before the second process find it and attempts to open it.

The delete and rename locking are probably useful to guard against race
conditions when clients intentionally issues create/delete/rename commands
concurrently.

7 years agolib-storage: Add mailbox_list_[un]lock()
Timo Sirainen [Tue, 9 Jan 2018 20:36:58 +0000 (15:36 -0500)] 
lib-storage: Add mailbox_list_[un]lock()

7 years agolib-storage: mailbox_delete() - Fix cleanup in error handling
Timo Sirainen [Tue, 9 Jan 2018 20:35:13 +0000 (15:35 -0500)] 
lib-storage: mailbox_delete() - Fix cleanup in error handling

If removing index deletion mark failed, box->deleting wasn't set to FALSE
and the mailbox was left opened.

7 years agolib-storage: mailbox_rename() - Use source storage for errors
Timo Sirainen [Tue, 9 Jan 2018 20:33:26 +0000 (15:33 -0500)] 
lib-storage: mailbox_rename() - Use source storage for errors

It was documented to use source storage for errors, but some of the errors
were set to destination storage.

7 years agolib-storage: mail_storage_lock_create() - add support for dotlocks
Timo Sirainen [Tue, 6 Feb 2018 16:01:04 +0000 (18:01 +0200)] 
lib-storage: mail_storage_lock_create() - add support for dotlocks

7 years agolib-storage: Change mail_user_lock_file_create() to use mail_storage_lock_create()
Timo Sirainen [Tue, 6 Feb 2018 15:49:15 +0000 (17:49 +0200)] 
lib-storage: Change mail_user_lock_file_create() to use mail_storage_lock_create()

7 years agolib-storage: Add mail_storage_lock_create()
Timo Sirainen [Tue, 6 Feb 2018 15:47:37 +0000 (17:47 +0200)] 
lib-storage: Add mail_storage_lock_create()

This is split off of mailbox_lock_file_create().

7 years agolib: Add file_lock_from_dotlock()
Timo Sirainen [Tue, 6 Feb 2018 15:35:18 +0000 (17:35 +0200)] 
lib: Add file_lock_from_dotlock()

The dotlock creation requires various settings, so the file-lock.h API can't
easily be used to create it. But once created, it's simpler to keep all lock
types in the same struct file_lock, which can be unlocked/freed once
finished.

7 years agolib-smtp: server: Fix assertion failure occurring for a second failed BDAT/BURL command.
Stephan Bosch [Mon, 25 Dec 2017 23:38:58 +0000 (00:38 +0100)] 
lib-smtp: server: Fix assertion failure occurring for a second failed BDAT/BURL command.

Assertion was:

Panic: file smtp-server-cmd-data.c: line 420 (smtp_server_connection_data_chunk_init): assertion failed: (data_cmd->chunk_first)

7 years agosubmission: EHLO command: Remove obsolete pending_ehlo handling.
Stephan Bosch [Wed, 27 Dec 2017 13:38:41 +0000 (14:38 +0100)] 
submission: EHLO command: Remove obsolete pending_ehlo handling.

This was used to wait with sending an EHLO reply until the proxy connection to the relay server completes.
The previous commit made this functionality obsolete, since command input handling is blocked entirely until the proxy connection is ready.

7 years agosubmission: Block server input handling until proxy connection to relay server completes.
Stephan Bosch [Wed, 27 Dec 2017 13:36:10 +0000 (14:36 +0100)] 
submission: Block server input handling until proxy connection to relay server completes.

This makes sure we are aware of the full extent of the backend server's capabilities, before we start handling commands.
Before, only EHLO commands were blocked this way, but this did not account for MAIL/RCPT parameters, which are equally dependent.
Fixes problems with clients that send no EHLO after AUTH, like Thunderbird.

7 years agolib-smtp: server: Add APIs for halting and resuming connection command handling.
Stephan Bosch [Wed, 27 Dec 2017 16:02:12 +0000 (17:02 +0100)] 
lib-smtp: server: Add APIs for halting and resuming connection command handling.

Also adds function to start the connection in a pending (halted) state. This way the greeting can already be sent (over SSL if needed), while deferring command handling until some external activity is completed.

7 years agolib-smtp: server: Prevent calling smtp_server_connection_login() after smtp_server_co...
Stephan Bosch [Wed, 27 Dec 2017 15:31:12 +0000 (16:31 +0100)] 
lib-smtp: server: Prevent calling smtp_server_connection_login() after smtp_server_connection_start().

Added assertion.

7 years agolib-smtp: server: Protect smpt_server_connection_start() from being called multiple...
Stephan Bosch [Wed, 27 Dec 2017 15:22:22 +0000 (16:22 +0100)] 
lib-smtp: server: Protect smpt_server_connection_start() from being called multiple times.

7 years agolib-smtp: server: Delay handling initial input (from login service) until after smtp_...
Stephan Bosch [Wed, 27 Dec 2017 15:18:16 +0000 (16:18 +0100)] 
lib-smtp: server: Delay handling initial input (from login service) until after smtp_server_connection_start().

Instead, it is now handled in normal io callback.

7 years agolib-smtp: server: Remove implicit smtp_server_connection_start() from smtp_server_con...
Stephan Bosch [Wed, 27 Dec 2017 14:56:03 +0000 (15:56 +0100)] 
lib-smtp: server: Remove implicit smtp_server_connection_start() from smtp_server_connection_login().

7 years agolib-smtp: server: Moved smtp_server_connection_start() after smtp_server_connection_l...
Stephan Bosch [Wed, 27 Dec 2017 14:59:23 +0000 (15:59 +0100)] 
lib-smtp: server: Moved smtp_server_connection_start() after smtp_server_connection_login().

Also fixes an indent problem in the header comment implicitly.

7 years agolib-smtp: server: Moved ssl_start argument from smtp_server_connection_start() to...
Stephan Bosch [Wed, 27 Dec 2017 14:52:13 +0000 (15:52 +0100)] 
lib-smtp: server: Moved ssl_start argument from smtp_server_connection_start() to smtp_server_connection_create().

This frees smtp_server_connection_start() for general use.

7 years agofs-posix: Fix iterating directories when readdir() returns DT_UNKNOWN
Timo Sirainen [Tue, 6 Feb 2018 10:37:34 +0000 (12:37 +0200)] 
fs-posix: Fix iterating directories when readdir() returns DT_UNKNOWN

Files were iterated correctly, but directories weren't. This mainly broke
directory iteration with NFS when nordirplus mount option was used.

7 years agofts: Don't reindex FTS mails if .cache file is deleted
Timo Sirainen [Mon, 5 Feb 2018 20:21:13 +0000 (22:21 +0200)] 
fts: Don't reindex FTS mails if .cache file is deleted

This means that if fts is enabled, "doveadm index" no longer adds mails
to dovecot.index.cache if it's deleted. However, it was rarely used for
that purpose. More likely due to a corrupted cache file all the mails were
unnecessarily being opened and reindexed.

7 years agocassandra: Make sure timestamp is always logged (if set) with debug_queries=y
Timo Sirainen [Wed, 7 Feb 2018 13:28:45 +0000 (15:28 +0200)] 
cassandra: Make sure timestamp is always logged (if set) with debug_queries=y

It wasn't logged in some code paths.

7 years agocassandra: Fix setting timestamp for transaction queries with v3 protocol
Timo Sirainen [Wed, 7 Feb 2018 13:27:07 +0000 (15:27 +0200)] 
cassandra: Fix setting timestamp for transaction queries with v3 protocol

It was working for prepared statements, but not for non-prepared statements.

7 years agofts: Fix searching headers with TEXT/BODY
Timo Sirainen [Mon, 5 Feb 2018 21:54:33 +0000 (23:54 +0200)] 
fts: Fix searching headers with TEXT/BODY

TEXT is searching headers and BODY is searching MIME headers. Those headers
were indexed with data language, so search must also include data language
when looking up words. We'll just include the data language for all
searches now, so it should always work correctly.

7 years agofts: Fix searching SEARCH_HEADER_ADDRESS/COMPRESS_LWSP
Timo Sirainen [Mon, 5 Feb 2018 21:51:51 +0000 (23:51 +0200)] 
fts: Fix searching SEARCH_HEADER_ADDRESS/COMPRESS_LWSP

These are "non-language" headers that are being searched, so they need to be
searched using data language.

7 years agolib-http: queue: Update the correct timout while dropping a request from the delay...
Stephan Bosch [Fri, 12 Jan 2018 20:03:41 +0000 (21:03 +0100)] 
lib-http: queue: Update the correct timout while dropping a request from the delay queue.

The absolute request timeout rather than the delay timeout was updated for the
removal of the request from the delay queue.

7 years agolib: time-util: Fix timeval_cmp_margin() to correctly handle a margin crossing the...
Stephan Bosch [Tue, 6 Feb 2018 14:50:19 +0000 (15:50 +0100)] 
lib: time-util: Fix timeval_cmp_margin() to correctly handle a margin crossing the second boundary.

The timeval_cmp_margin() function incorrectly assumed that the margin is
irrelevent when the tv_sec values are different.

7 years agolib: test-time-util: Put all test data for timeval_cmp() test in a single struct...
Stephan Bosch [Tue, 6 Feb 2018 15:51:23 +0000 (16:51 +0100)] 
lib: test-time-util: Put all test data for timeval_cmp() test in a single struct array.

7 years agosubmission: Add settings that configure the connect and command reply timeouts.
Stephan Bosch [Sat, 27 Jan 2018 22:20:08 +0000 (23:20 +0100)] 
submission: Add settings that configure the connect and command reply timeouts.

7 years agolib-smtp: client: Assign only connection settings during connection initialization.
Stephan Bosch [Fri, 19 Jan 2018 22:32:31 +0000 (23:32 +0100)] 
lib-smtp: client: Assign only connection settings during connection initialization.

Due to some copy-paste mistake, some global client settings were assigned
instead.

7 years agolib-smtp: client: Always use per-connection settings in connection.
Stephan Bosch [Fri, 19 Jan 2018 22:31:05 +0000 (23:31 +0100)] 
lib-smtp: client: Always use per-connection settings in connection.

Some part of the connection code referred to global client settings.

7 years agolib-smtp: client: Properly allow per-connection SSL configuration.
Stephan Bosch [Fri, 19 Jan 2018 15:05:18 +0000 (16:05 +0100)] 
lib-smtp: client: Properly allow per-connection SSL configuration.

Although this was already partially possible, the connection was still always
using the global client SSL context.

7 years agolib-smtp: client: Fix segfault occurring in connection when SSL certificate is invalid.
Stephan Bosch [Fri, 19 Jan 2018 13:44:50 +0000 (14:44 +0100)] 
lib-smtp: client: Fix segfault occurring in connection when SSL certificate is invalid.

The connection is using its own local SSL settings to determine whether an
invalid certificate is allowed. However, these local settings were not properly
initialized.

7 years agosubmission: Enable verbose reporting of relay server certificate problems.
Stephan Bosch [Mon, 22 Jan 2018 17:51:21 +0000 (18:51 +0100)] 
submission: Enable verbose reporting of relay server certificate problems.

7 years agoimap: Iterate over ns settings when deciding to add SPECIAL-USE capability
Josef 'Jeff' Sipek [Mon, 29 Jan 2018 14:55:51 +0000 (09:55 -0500)] 
imap: Iterate over ns settings when deciding to add SPECIAL-USE capability

To determine whether we should add the SPECIAL-USE capability to the
OK response to LOGIN, we have to iterate over namespace and mailbox
*settings* since the namespaces haven't been set up yet.

7 years agolib-storage: Fix adding body.snippet to cache
Timo Sirainen [Thu, 25 Jan 2018 10:27:41 +0000 (12:27 +0200)] 
lib-storage: Fix adding body.snippet to cache

Unless body.snippet was in mail_always_cache_fields, it didn't get added to
the cache file.

7 years agolib-storage: Add comment to how mail_cache_field_can/want_add() is used
Timo Sirainen [Thu, 25 Jan 2018 10:35:51 +0000 (12:35 +0200)] 
lib-storage: Add comment to how mail_cache_field_can/want_add() is used

7 years agolib-index: Update comments for mail_cache_decision_*()
Timo Sirainen [Thu, 25 Jan 2018 10:35:35 +0000 (12:35 +0200)] 
lib-index: Update comments for mail_cache_decision_*()

7 years agolib-mail: mail-html2text - Validate UCS4 codepoint
Aki Tuomi [Fri, 5 Jan 2018 07:51:00 +0000 (09:51 +0200)] 
lib-mail: mail-html2text - Validate UCS4 codepoint

Fixes: Panic: file unichar.c: line 160 (uni_ucs4_to_utf8_c): assertion failed: (uni_is_valid_ucs4(chr))
7 years agolib-imap-urlauth: Fix segfault occurring when userid part is missing for "user+"...
Stephan Bosch [Wed, 31 Jan 2018 21:14:49 +0000 (22:14 +0100)] 
lib-imap-urlauth: Fix segfault occurring when userid part is missing for "user+" or "submit+" URLAUTH access.

7 years agosubmission-login: Fail CLIENT_AUTH_RESULT_MECH_SSL_REQUIRED authentication result...
Stephan Bosch [Sat, 23 Dec 2017 22:49:02 +0000 (23:49 +0100)] 
submission-login: Fail CLIENT_AUTH_RESULT_MECH_SSL_REQUIRED authentication result with 523 5.7.10 error.

Defined in RFC5248, Section 2.4.

7 years agosubmission: BURL command: Return more appropriate 554 5.7.14 error when BURL/URLAUTH...
Stephan Bosch [Wed, 27 Dec 2017 14:18:14 +0000 (15:18 +0100)] 
submission: BURL command: Return more appropriate 554 5.7.14 error when BURL/URLAUTH is not configured.

Defined in RFC5248, Section 2.4.

7 years agolib-imap-client: continue imapc operation on parsing errors.
Sergey Kitov [Mon, 8 Jan 2018 09:38:37 +0000 (11:38 +0200)] 
lib-imap-client: continue imapc operation on parsing errors.

7 years agolib-storage: Set keyword based on attachment presence when saving
Aki Tuomi [Sat, 11 Nov 2017 08:07:42 +0000 (10:07 +0200)] 
lib-storage: Set keyword based on attachment presence when saving

If attachment is detected, use $HasAttachment, if not
use $HasNoAttachment

7 years agolib-storage: Add attachment detection settings
Aki Tuomi [Mon, 20 Nov 2017 08:09:23 +0000 (10:09 +0200)] 
lib-storage: Add attachment detection settings

7 years agolib-mail: Add message_part_has_attachment
Aki Tuomi [Fri, 10 Nov 2017 12:32:44 +0000 (14:32 +0200)] 
lib-mail: Add message_part_has_attachment

7 years agolib-smtp: client: Fix timeout leak sometimes occurring at unexpected remote disconnect.
Stephan Bosch [Sun, 28 Jan 2018 10:44:26 +0000 (11:44 +0100)] 
lib-smtp: client: Fix timeout leak sometimes occurring at unexpected remote disconnect.

While disconnected, newly submitted commands are queued, yet scheduled for
immediate failure. The timeout used for that was not cleaned up.

7 years agodovecot-config: Update lib-stats directory to lib-old-stats
Timo Sirainen [Wed, 27 Dec 2017 10:05:50 +0000 (12:05 +0200)] 
dovecot-config: Update lib-stats directory to lib-old-stats

7 years agosubmission-login: Fixed handling of ssl=required for trusted connections.
Stephan Bosch [Sat, 23 Dec 2017 18:40:09 +0000 (19:40 +0100)] 
submission-login: Fixed handling of ssl=required for trusted connections.

Normally, SSL is not required for trusted connections (e.g. localhost), but submission-login did not follow this standard.

7 years agosubmission: Restructure handling of QUIT command.
Stephan Bosch [Sun, 24 Dec 2017 14:12:36 +0000 (15:12 +0100)] 
submission: Restructure handling of QUIT command.

- Avoid explicitly proxying QUIT command when the proxy connection is not ready: in that case the SMTP client connection will just send QUIT if appropriate, without waiting for reply.
- Add timeout for proxied QUIT command, so that there are no problems when the relay server hangs after QUIT (addresses FIXME).

7 years agosubmission: Dropped unused field from struct client.
Stephan Bosch [Sun, 24 Dec 2017 13:52:07 +0000 (14:52 +0100)] 
submission: Dropped unused field from struct client.

7 years agosubmission-login: Fix pipelining of commands beyond AUTH.
Stephan Bosch [Sun, 24 Dec 2017 11:17:48 +0000 (12:17 +0100)] 
submission-login: Fix pipelining of commands beyond AUTH.

The master_data_prefix was initialized wrong; it omitted the expected '\0' byte after the helo field.