]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agolib-storage: imapc - Ensure search ctx is not NULL
Aki Tuomi [Mon, 22 Jan 2018 11:57:12 +0000 (13:57 +0200)] 
lib-storage: imapc - Ensure search ctx is not NULL

Satisfies static analyzers

7 years agolib-storage: Add and use MAIL_STORAGE_CONTEXT_REQUIRE
Aki Tuomi [Mon, 22 Jan 2018 11:54:58 +0000 (13:54 +0200)] 
lib-storage: Add and use MAIL_STORAGE_CONTEXT_REQUIRE

Satisfies static analyzers

7 years agolib-storage: Add and use MAIL_THREAD_CONTEXT_REQUIRE
Aki Tuomi [Mon, 22 Jan 2018 11:52:37 +0000 (13:52 +0200)] 
lib-storage: Add and use MAIL_THREAD_CONTEXT_REQUIRE

Satisfies static analyzers

7 years agolib-index: Add and use CACHE_TRANS_CONTEXT_REQUIRE
Aki Tuomi [Mon, 22 Jan 2018 11:50:37 +0000 (13:50 +0200)] 
lib-index: Add and use CACHE_TRANS_CONTEXT_REQUIRE

Satisfies static analyzers

7 years agolib-storage: Add and use INDEX_LIST_CONTEXT_REQUIRE
Aki Tuomi [Mon, 22 Jan 2018 07:38:26 +0000 (09:38 +0200)] 
lib-storage: Add and use INDEX_LIST_CONTEXT_REQUIRE

Satisfies static analyzers

7 years agomail-log: Contexts are now required or checked
Aki Tuomi [Sat, 20 Jan 2018 18:42:02 +0000 (20:42 +0200)] 
mail-log: Contexts are now required or checked

Satisfies static analyzers

7 years agoold-stats-plugin: Fix context requirements
Aki Tuomi [Fri, 19 Jan 2018 08:27:09 +0000 (10:27 +0200)] 
old-stats-plugin: Fix context requirements

Fixes Panic: Module context stats_storage_module missing

Broken by 6afdf0b6fce26c5492d5e56f6f16fb8a4d869566

7 years agopop3-migration-plugin: Fix context requirements
Aki Tuomi [Thu, 18 Jan 2018 13:29:42 +0000 (15:29 +0200)] 
pop3-migration-plugin: Fix context requirements

Fixes Panic: Module context pop3_migration_storage_module missing

Broken by a8703ce24540b7efaa51a8c7d3c72e72727f9789

7 years agolast-login: Contexts are now required or checked
Aki Tuomi [Wed, 17 Jan 2018 10:15:16 +0000 (12:15 +0200)] 
last-login: Contexts are now required or checked

Satisfies static analyzers

7 years agomail-crypt: Contexts are now required or checked
Aki Tuomi [Wed, 17 Jan 2018 10:14:22 +0000 (12:14 +0200)] 
mail-crypt: Contexts are now required or checked

Satisfies static analyzers

7 years agoold-stats: Contexts are now required or checked
Aki Tuomi [Wed, 17 Jan 2018 08:28:48 +0000 (10:28 +0200)] 
old-stats: Contexts are now required or checked

Satisfies static analyzers

7 years agoquota-clone: Contexts are now required or checked
Aki Tuomi [Wed, 17 Jan 2018 08:23:05 +0000 (10:23 +0200)] 
quota-clone: Contexts are now required or checked

Satisfies static analyzers

7 years agozlib: Contexts are now required or checked
Aki Tuomi [Wed, 17 Jan 2018 08:21:52 +0000 (10:21 +0200)] 
zlib: Contexts are now required or checked

Satisfies static analyzers

7 years agomailbox-alias: Contexts are now required or checked
Aki Tuomi [Wed, 17 Jan 2018 08:10:41 +0000 (10:10 +0200)] 
mailbox-alias: Contexts are now required or checked

Satisfies static analyzers

7 years agomail-filter: Contexts are now required or checked
Aki Tuomi [Wed, 17 Jan 2018 08:07:37 +0000 (10:07 +0200)] 
mail-filter: Contexts are now required or checked

Satisfies static analyzers

7 years agonotify: Contexts are now required or checked
Aki Tuomi [Wed, 17 Jan 2018 08:06:25 +0000 (10:06 +0200)] 
notify: Contexts are now required or checked

Satisfied static analyzers

7 years agopop3-migration: Contexts are now required or checked
Aki Tuomi [Wed, 17 Jan 2018 07:31:44 +0000 (09:31 +0200)] 
pop3-migration: Contexts are now required or checked

Satisfies static analyzers

7 years agoquota: Contexts are now required or checked
Aki Tuomi [Sun, 14 Jan 2018 18:40:11 +0000 (20:40 +0200)] 
quota: Contexts are now required or checked

Satisfied static analyzers

7 years agoapparmor: Ensure auser is not NULL
Aki Tuomi [Sun, 14 Jan 2018 18:33:48 +0000 (20:33 +0200)] 
apparmor: Ensure auser is not NULL

Satisfies static analyzers

7 years agolazy-expunge: Contexts are now required or checked
Aki Tuomi [Sun, 14 Jan 2018 18:25:16 +0000 (20:25 +0200)] 
lazy-expunge: Contexts are now required or checked

Satisfied static analyzers

7 years agofts: Contexts are now required or checked
Aki Tuomi [Sun, 14 Jan 2018 18:18:45 +0000 (20:18 +0200)] 
fts: Contexts are now required or checked

Satisfied static analyzer

7 years agosnarf: If sstorage is NULL, do not allocate box
Aki Tuomi [Sun, 14 Jan 2018 18:08:11 +0000 (20:08 +0200)] 
snarf: If sstorage is NULL, do not allocate box

Old code would continue if sstorage was NULL.

Found by static analyzer

7 years agosnarf: Contexts are now required or checked
Aki Tuomi [Sun, 14 Jan 2018 18:07:31 +0000 (20:07 +0200)] 
snarf: Contexts are now required or checked

Satisfies static analyzers

7 years agoexpire: Contexts are now required or checked
Aki Tuomi [Sun, 14 Jan 2018 18:00:04 +0000 (20:00 +0200)] 
expire: Contexts are now required or checked

Satisfied static analyzers

7 years agotrash: Ensure quser is not NULL
Aki Tuomi [Sun, 14 Jan 2018 17:57:16 +0000 (19:57 +0200)] 
trash: Ensure quser is not NULL

Satisfies static analyzers

7 years agoacl: Contexts are now required or checked
Aki Tuomi [Sun, 14 Jan 2018 17:56:19 +0000 (19:56 +0200)] 
acl: Contexts are now required or checked

Satisfies static analyzers

7 years agoreplication: Check ruser for NULL
Aki Tuomi [Sun, 14 Jan 2018 17:46:13 +0000 (19:46 +0200)] 
replication: Check ruser for NULL

Satisfies static analyzers

7 years agoimap-old-stats-plugins: Check suser for NULL
Aki Tuomi [Sun, 14 Jan 2018 17:43:39 +0000 (19:43 +0200)] 
imap-old-stats-plugins: Check suser for NULL

Satisfies static analyzers

7 years agolib-sql: SQL_DB_CACHE_CONTEXT now requires context
Aki Tuomi [Wed, 17 Jan 2018 10:25:18 +0000 (12:25 +0200)] 
lib-sql: SQL_DB_CACHE_CONTEXT now requires context

Satisfies static analyzers

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.