]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
8 years agoquota-clone: Always update dict
Aki Tuomi [Wed, 4 Oct 2017 07:32:17 +0000 (10:32 +0300)] 
quota-clone: Always update dict

ret_count and ret_bytes become zero if no quota rules
are specified, so we need to update the dict anyways.

Broken in 81d10aff29baede9ae4944d6c89790871123d11d

8 years agodsync: Add hashed_headers setting
Aki Tuomi [Fri, 22 Sep 2017 10:30:43 +0000 (13:30 +0300)] 
dsync: Add hashed_headers setting

This makes it possible to configure them

8 years agodsync: Fix typo, it's ibc not icb
Aki Tuomi [Fri, 22 Sep 2017 11:08:45 +0000 (14:08 +0300)] 
dsync: Fix typo, it's ibc not icb

8 years agodsync: Add missing space to handshake optional keys
Aki Tuomi [Mon, 25 Sep 2017 07:28:03 +0000 (10:28 +0300)] 
dsync: Add missing space to handshake optional keys

8 years agodoveadm proxy: Avoid DNS lookup for "host" if passdb also returns "hostip"
Timo Sirainen [Fri, 8 Sep 2017 08:02:29 +0000 (11:02 +0300)] 
doveadm proxy: Avoid DNS lookup for "host" if passdb also returns "hostip"

8 years agolmtp proxy: Avoid DNS lookup for "host" if passdb also returns "hostip"
Timo Sirainen [Fri, 8 Sep 2017 08:02:07 +0000 (11:02 +0300)] 
lmtp proxy: Avoid DNS lookup for "host" if passdb also returns "hostip"

8 years agoauth: Avoid DNS lookup for "host" if passdb returns also "hostip"
Timo Sirainen [Fri, 8 Sep 2017 08:01:20 +0000 (11:01 +0300)] 
auth: Avoid DNS lookup for "host" if passdb returns also "hostip"

8 years agolib: Fix compiler warning in var-expand-if
Timo Sirainen [Tue, 25 Jul 2017 07:39:43 +0000 (10:39 +0300)] 
lib: Fix compiler warning in var-expand-if

8 years agolib: Fix static analyzer warnings in var-expand-if
Timo Sirainen [Tue, 25 Jul 2017 06:43:56 +0000 (09:43 +0300)] 
lib: Fix static analyzer warnings in var-expand-if

8 years agovar-expand-if: Remove unused variable par_start
Aki Tuomi [Mon, 24 Jul 2017 15:30:01 +0000 (18:30 +0300)] 
var-expand-if: Remove unused variable par_start

8 years agovar-expand: Add tests for var_expand conditionals
Aki Tuomi [Mon, 24 Jul 2017 10:31:49 +0000 (13:31 +0300)] 
var-expand: Add tests for var_expand conditionals

8 years agovar-expand: Add support for conditionals
Aki Tuomi [Mon, 24 Jul 2017 10:31:02 +0000 (13:31 +0300)] 
var-expand: Add support for conditionals

%{if;value-a,op,value-b:true-value:false-value}

8 years agodirector: Remember backends' hostnames and send them in login reply.
Timo Sirainen [Mon, 19 Oct 2015 10:49:54 +0000 (13:49 +0300)] 
director: Remember backends' hostnames and send them in login reply.
This allows login processes to verify the remote server's hostname in SSL
certificate.

8 years agodirector: Run director/host changing doveadm commands only after ring is synced
Timo Sirainen [Fri, 18 Aug 2017 08:51:36 +0000 (11:51 +0300)] 
director: Run director/host changing doveadm commands only after ring is synced

If the ring sync is still pending, the doveadm command may become reverted.
This doesn't fully prevent problems caused by sending doveadm commands
simultaneously to multiple directors, but it should prevent issues when
only a single director is used for doveadm commands.

It would have been nice to enable this also for HOST/DIRECTOR-LIST commands,
but they don't support returning a ring timeout error without changing the
protocol. It's a bit too much effort to change that for now.

8 years agodirector: doveadm HOST-* commands now wait for ring sync before returning OK
Timo Sirainen [Mon, 14 Aug 2017 07:29:47 +0000 (10:29 +0300)] 
director: doveadm HOST-* commands now wait for ring sync before returning OK

This should make it easier for tests and maybe for scripts in general, so
they won't think the command failed when it just takes a while to finish.

8 years agodirector: Cleanup - Doveadm commands now return enum doveadm_director_cmd_ret
Timo Sirainen [Mon, 14 Aug 2017 07:06:34 +0000 (10:06 +0300)] 
director: Cleanup - Doveadm commands now return enum doveadm_director_cmd_ret

8 years agodirector: Cleanup - Move all doveadm commands into an array.
Timo Sirainen [Mon, 14 Aug 2017 07:01:01 +0000 (10:01 +0300)] 
director: Cleanup - Move all doveadm commands into an array.

8 years agocassandra: Timestamp should be in microseconds, not milliseconds
Timo Sirainen [Tue, 19 Sep 2017 11:48:54 +0000 (14:48 +0300)] 
cassandra: Timestamp should be in microseconds, not milliseconds

8 years agocassandra: Fix paged queries to work again
Timo Sirainen [Wed, 13 Sep 2017 12:16:59 +0000 (15:16 +0300)] 
cassandra: Fix paged queries to work again

When continuing the result, consistency was reset to 0 (=ANY), which caused
the queries to fail. There's no need to initialize the statement again when
continuing it. Also set result->consistency to be correct mainly for
debugging purposes.

8 years agocassandra: Disable prepared statements with protocol v3 and older
Timo Sirainen [Tue, 12 Sep 2017 10:23:51 +0000 (13:23 +0300)] 
cassandra: Disable prepared statements with protocol v3 and older

8 years agocassandra: Add support for prepared statements
Timo Sirainen [Tue, 22 Aug 2017 11:35:11 +0000 (14:35 +0300)] 
cassandra: Add support for prepared statements

8 years agocassandra: Cleanup - Create statement earlier
Timo Sirainen [Tue, 22 Aug 2017 10:55:15 +0000 (13:55 +0300)] 
cassandra: Cleanup - Create statement earlier

Simplifies the following changes

8 years agocassandra: sql_transaction_commit*() cleanup - handle multiple query failures earlier
Timo Sirainen [Thu, 24 Aug 2017 08:56:38 +0000 (11:56 +0300)] 
cassandra: sql_transaction_commit*() cleanup - handle multiple query failures earlier

This makes the handling same for the sync and async method. It also
simplifies code for the following commits.

8 years agocassandra: sql_transaction_commit_s() - Set query_type correctly
Timo Sirainen [Thu, 24 Aug 2017 08:13:32 +0000 (11:13 +0300)] 
cassandra: sql_transaction_commit_s() - Set query_type correctly

The queries were all sent with READ type instead of WRITE/DELETE. This
meant they were using potentially wrong consistency values. Although
synchronous commits aren't actually used anywhere, so this practically
this doesn't fix anything right now.

8 years agocassandra: sql_transaction_commit_s() - Don't allow multi-query transactions
Timo Sirainen [Thu, 24 Aug 2017 08:09:05 +0000 (11:09 +0300)] 
cassandra: sql_transaction_commit_s() - Don't allow multi-query transactions

They were already denied for asynchronous commits. Also the synchronous
commits aren't actually used anywhere, so this shouldn't break anything.

8 years agodict-sql: Use prepared statements
Timo Sirainen [Thu, 7 Sep 2017 12:40:16 +0000 (15:40 +0300)] 
dict-sql: Use prepared statements

Create a hash table of query template -> prepared statement and fill it out
as needed. This could have been done some alternative ways that wouldn't
require building the string first, but this should still be fast enough and
much easier to implement.

8 years agodict-sql: Flush pending atomic_inc on set, and pending set on atomic_inc
Timo Sirainen [Sat, 26 Aug 2017 20:27:21 +0000 (23:27 +0300)] 
dict-sql: Flush pending atomic_inc on set, and pending set on atomic_inc

8 years agodict-sql: Cleanup - change query generator functions to return statement
Timo Sirainen [Sat, 26 Aug 2017 20:17:45 +0000 (23:17 +0300)] 
dict-sql: Cleanup - change query generator functions to return statement

Instead of query+params. This is in preparation for the following changes.

8 years agodict-sql: Cleanup - Remove unnecessary code
Timo Sirainen [Tue, 15 Aug 2017 13:50:16 +0000 (16:50 +0300)] 
dict-sql: Cleanup - Remove unnecessary code

The values are explicitly added to params. sql_dict_update_query() doesn't
add them again. Since the "diff" parameter is already a long long type,
this avoids unnecessary conversion to string and back.

8 years agodict-sql: Use sql_statement_bind_*()
Timo Sirainen [Tue, 15 Aug 2017 13:38:33 +0000 (16:38 +0300)] 
dict-sql: Use sql_statement_bind_*()

8 years agodict-sql: Add signed "int" type
Timo Sirainen [Tue, 15 Aug 2017 12:37:01 +0000 (15:37 +0300)] 
dict-sql: Add signed "int" type

8 years agodict-sql: Use sql_statement_set_timestamp() instead of adding it to query
Timo Sirainen [Tue, 15 Aug 2017 11:55:48 +0000 (14:55 +0300)] 
dict-sql: Use sql_statement_set_timestamp() instead of adding it to query

8 years agodict-sql: Initial change to use sql_statement API
Timo Sirainen [Tue, 15 Aug 2017 11:46:10 +0000 (14:46 +0300)] 
dict-sql: Initial change to use sql_statement API

sql_statement_bind_*() will be followed by later changes.

8 years agodict-sql: Remove dict_sql_build_query.inc
Timo Sirainen [Tue, 15 Aug 2017 13:44:27 +0000 (16:44 +0300)] 
dict-sql: Remove dict_sql_build_query.inc

It's no longer useful with the current code.

8 years agolib-dict: Moved/removed explicit stack frames in dict drivers.
Timo Sirainen [Fri, 6 May 2016 09:19:21 +0000 (12:19 +0300)] 
lib-dict: Moved/removed explicit stack frames in dict drivers.

Added them back to dict_set/unset/atomic_inc() in dict.c. Others are
unlikely to be called many times.

8 years agodict-sql: Change "uint" type to mean 64bit instead of 32bit integer.
Timo Sirainen [Tue, 15 Aug 2017 11:27:40 +0000 (14:27 +0300)] 
dict-sql: Change "uint" type to mean 64bit instead of 32bit integer.

This is likely what is usually wanted (especially in e.g. quotas).
If someone actually wants it to be restricted to 32bit, we could add
uint32 later on.

8 years agolib-sql: Add support for prepared SQL statements.
Timo Sirainen [Tue, 22 Aug 2017 08:37:17 +0000 (11:37 +0300)] 
lib-sql: Add support for prepared SQL statements.

This initial implementation doesn't use prepared statements in drivers, but
simply generates the query string internally.

8 years agolib-sql: Explicitly specify used *_vfuncs methods for drivers.
Timo Sirainen [Tue, 22 Aug 2017 08:31:51 +0000 (11:31 +0300)] 
lib-sql: Explicitly specify used *_vfuncs methods for drivers.

This allows adding more methods without modifying all the existing drivers.

8 years agolib: When logging I/O or timeout leak, log also raw backtrace
Timo Sirainen [Tue, 8 Aug 2017 17:07:18 +0000 (20:07 +0300)] 
lib: When logging I/O or timeout leak, log also raw backtrace

This can be useful when trying to figure out where the io_loop_destroy() was
called from.

8 years agolib-storage: index: Made MIME FILENAME search criterion match case-insensitively.
Stephan Bosch [Tue, 23 May 2017 12:05:02 +0000 (14:05 +0200)] 
lib-storage: index: Made MIME FILENAME search criterion match case-insensitively.

8 years agodirector: Fix flush to kick the user also when all backends are down
Timo Sirainen [Tue, 19 Sep 2017 22:47:38 +0000 (01:47 +0300)] 
director: Fix flush to kick the user also when all backends are down

The user's host can't change, because there are no other hosts. So add a
new parameter to force the kick anyway.

8 years agodirector: Avoid "ring sync timeout" errors when all backends are down
Timo Sirainen [Thu, 14 Sep 2017 09:50:29 +0000 (12:50 +0300)] 
director: Avoid "ring sync timeout" errors when all backends are down

doveadm commands were failing with it. Also pending request failures were
logged as failing due to ring sync timeout, instead of because no hosts.

8 years agodirector: Delay calling state_change_callback() after user kick is finished
Timo Sirainen [Thu, 14 Sep 2017 10:02:40 +0000 (13:02 +0300)] 
director: Delay calling state_change_callback() after user kick is finished

Otherwise it can get into recursive loop and cause problems.

8 years agodoveadm director: Improve logging unexpected disconnections from director socket
Timo Sirainen [Thu, 14 Sep 2017 09:42:13 +0000 (12:42 +0300)] 
doveadm director: Improve logging unexpected disconnections from director socket

Previously it just logged "failed", which wasn't very understandable.

8 years agodirector: Fix crash when flush is run and all backends are down.
Timo Sirainen [Tue, 22 Aug 2017 13:32:32 +0000 (16:32 +0300)] 
director: Fix crash when flush is run and all backends are down.

Instead of moving the users elsewhere, just kill them and flush the backend.

8 years agonotify-status plugin: Use priv/status/<mailbox> for keys
Timo Sirainen [Wed, 20 Sep 2017 12:03:55 +0000 (15:03 +0300)] 
notify-status plugin: Use priv/status/<mailbox> for keys

priv/<mailbox>/status can't be used with dict-sql when <mailbox> has '/'.

8 years agonotify-status: Remove first_unseen_seq field
Timo Sirainen [Mon, 18 Sep 2017 20:04:55 +0000 (23:04 +0300)] 
notify-status: Remove first_unseen_seq field

The sequence number keeps changing, so it's very unlikely to be useful.
It's also not always as efficiently available as the other fields, so
better to avoid having it.

8 years agonotify-status: Provide access to all easy fields
Aki Tuomi [Mon, 4 Sep 2017 12:32:24 +0000 (15:32 +0300)] 
notify-status: Provide access to all easy fields

8 years agonotify-status: Add notify-status plugin
Aki Tuomi [Tue, 4 Jul 2017 11:22:19 +0000 (14:22 +0300)] 
notify-status: Add notify-status plugin

This enables updating a dictionary with mailbox
status information when the mailbox changes.

It requires notify_status_dict setting for specifying
the dict where the data is stored.

One can optionally use notify_status_mailbox patterns
for specifying which box(es) the status update is done.
Subsequent patterns are notify_status_mailbox2 and so forth.

One can also specify data format using notify_status_value
plugin setting.

8 years agolib: file_lock_set_unlink_on_free() - Avoid unlink() if another process is waiting...
Timo Sirainen [Tue, 12 Sep 2017 11:54:57 +0000 (14:54 +0300)] 
lib: file_lock_set_unlink_on_free() - Avoid unlink() if another process is waiting on the lock

8 years agolib-compression: Fix assert in i_stream_zlib_seek
Anton Yuzhaninov [Thu, 31 Aug 2017 00:49:17 +0000 (20:49 -0400)] 
lib-compression: Fix assert in i_stream_zlib_seek

Also fix same bug in i_stream_bzlib_seek, i_stream_lz4_seek, i_stream_lzma_seek.

8 years agomaster: Change service "connections are being dropped" warning interval to 1 second
Timo Sirainen [Fri, 14 Jul 2017 14:00:21 +0000 (17:00 +0300)] 
master: Change service "connections are being dropped" warning interval to 1 second

When this is happening, it's often accompanied with all kinds of other errors and
these warnings drown in them. Make them easier to notice by reducing the interval
from 60 seconds to 1 second.

8 years agodsync: Fix panic if syncing fails during attribute iteration
Timo Sirainen [Tue, 13 Jun 2017 18:00:23 +0000 (21:00 +0300)] 
dsync: Fix panic if syncing fails during attribute iteration

Fixes:
Panic: file dict.c: line 104 (dict_deinit): assertion failed: (dict->iter_count == 0)

8 years agolib-storage: mail_storage_set_critical() - don't free old error_string too early
Timo Sirainen [Fri, 25 Aug 2017 15:02:44 +0000 (18:02 +0300)] 
lib-storage: mail_storage_set_critical() - don't free old error_string too early

It may be used in one of the parameters.

8 years agolib-smtp: lmtp-client: Fixed handling of unexpected reply while sending RCPT TO commands.
Stephan Bosch [Tue, 12 Sep 2017 22:28:38 +0000 (00:28 +0200)] 
lib-smtp: lmtp-client: Fixed handling of unexpected reply while sending RCPT TO commands.

It caused a segfault.

8 years agodoveadm director kick: Fix -f parameter to work
Timo Sirainen [Fri, 8 Sep 2017 13:00:53 +0000 (16:00 +0300)] 
doveadm director kick: Fix -f parameter to work

It already worked as --passdb-field, but now it matches the usage string.

8 years agodsync: Ignore missing remote mailbox when doing unidirectional sync
Aki Tuomi [Tue, 5 Sep 2017 07:43:46 +0000 (10:43 +0300)] 
dsync: Ignore missing remote mailbox when doing unidirectional sync

If there are some folders on remote system that
are being ignored by remote brain, do not error out.

8 years agodoveadm: Actually use resolved IP address(es) in director flush
Aki Tuomi [Fri, 18 Aug 2017 11:58:37 +0000 (14:58 +0300)] 
doveadm: Actually use resolved IP address(es) in director flush

It left the IP variable unitialized which caused host parameter
to be left empty causing flush all. Flushing with IP address
was not affected.

8 years agodirector: Make sure users gets expired even on an idle director
Timo Sirainen [Thu, 10 Aug 2017 14:50:04 +0000 (17:50 +0300)] 
director: Make sure users gets expired even on an idle director

Normally expiring gets done while looking up users, but if nothing is doing
that on an idle director the users won't get expired. This can cause confusion
in "doveadm director status" output.

8 years agodoveconf: Preserve import_environment when execing binary
Timo Sirainen [Wed, 7 Jun 2017 22:03:13 +0000 (01:03 +0300)] 
doveconf: Preserve import_environment when execing binary

This allows import_environment setting to work with doveadm and other
standalone tools.

8 years agolib-master, config: Move the responsibility of cleaning environment to doveconf
Timo Sirainen [Wed, 7 Jun 2017 21:40:12 +0000 (00:40 +0300)] 
lib-master, config: Move the responsibility of cleaning environment to doveconf

8 years agolib-master: Use master_service_import_environment() for preserving environments
Timo Sirainen [Wed, 7 Jun 2017 21:35:08 +0000 (00:35 +0300)] 
lib-master: Use master_service_import_environment() for preserving environments

8 years agolib-master: master_service_import_environment() - use a data stack frame
Timo Sirainen [Wed, 7 Jun 2017 21:33:32 +0000 (00:33 +0300)] 
lib-master: master_service_import_environment() - use a data stack frame

This way the caller doesn't have to do it.

8 years agomaster: Move master_set_import_environment() to lib-master
Timo Sirainen [Wed, 7 Jun 2017 21:24:19 +0000 (00:24 +0300)] 
master: Move master_set_import_environment() to lib-master

8 years agomaster: Append to existing DOVECOT_PRESERVE_ENVS instead of overwriting it
Timo Sirainen [Wed, 7 Jun 2017 21:20:38 +0000 (00:20 +0300)] 
master: Append to existing DOVECOT_PRESERVE_ENVS instead of overwriting it

8 years agomaster: Move import_environment setting to lib-master's master_service_settings
Timo Sirainen [Wed, 7 Jun 2017 21:14:30 +0000 (00:14 +0300)] 
master: Move import_environment setting to lib-master's master_service_settings

8 years agolib-storage: Fix mailbox list notification assert-crash when mailbox is deleted
Timo Sirainen [Mon, 11 Sep 2017 09:27:17 +0000 (12:27 +0300)] 
lib-storage: Fix mailbox list notification assert-crash when mailbox is deleted

Reproduced with if IMAP NOTIFY is used for non-selected mailboxes without
MailboxName being specified. Another session then does changes to a
mailbox and immediately deletes it, which causes the crash.

Fixes:
Panic: file mailbox-list-index-notify.c: line 751: unreached

8 years agolib-index: mail_index_use_existing_permissions() - Ignore with INDEX=MEMORY
Timo Sirainen [Mon, 11 Sep 2017 09:59:27 +0000 (12:59 +0300)] 
lib-index: mail_index_use_existing_permissions() - Ignore with INDEX=MEMORY

8 years agolib-index: mail_index_use_existing_permissions() - Log error if stat() unexpectedly...
Timo Sirainen [Mon, 11 Sep 2017 09:58:28 +0000 (12:58 +0300)] 
lib-index: mail_index_use_existing_permissions() - Log error if stat() unexpectedly fails

8 years agolib-http: message parser: Reject messages with invalid Date header when HTTP_MESSAGE_...
Stephan Bosch [Thu, 27 Jul 2017 14:34:34 +0000 (16:34 +0200)] 
lib-http: message parser: Reject messages with invalid Date header when HTTP_MESSAGE_PARSE_FLAG_STRICT flag is enabled.

8 years agolib-http: Fixed bug in date parser: sometimes read one byte past end of input.
Stephan Bosch [Thu, 27 Jul 2017 14:30:20 +0000 (16:30 +0200)] 
lib-http: Fixed bug in date parser: sometimes read one byte past end of input.

This caused spurious parse errors.

8 years agolib-http: test-http-response-parser: Show error message for tests of invalid responses.
Stephan Bosch [Thu, 27 Jul 2017 14:03:44 +0000 (16:03 +0200)] 
lib-http: test-http-response-parser: Show error message for tests of invalid responses.

8 years ago*-login: Cache director_username_hash between KICK-DIRECTOR-HASH commands
Timo Sirainen [Wed, 19 Jul 2017 13:53:17 +0000 (16:53 +0300)] 
*-login: Cache director_username_hash between KICK-DIRECTOR-HASH commands

This should make the kicking much faster, which is important when director
is moving thousands of users.

8 years agolib-mail: Make sure mail_user_hash() won't return 0 as the hash.
Timo Sirainen [Wed, 19 Jul 2017 13:49:18 +0000 (16:49 +0300)] 
lib-mail: Make sure mail_user_hash() won't return 0 as the hash.

It doesn't seem to actually happen, but this makes sure of it.

8 years agolmtp: Fix for wrong session id of mail user when saving mail, quota checking on
Sergey Kitov [Thu, 6 Jul 2017 12:45:24 +0000 (15:45 +0300)] 
lmtp: Fix for wrong session id of mail user when saving mail, quota checking on

When quota is checked mail user is allocated with custom ":quota" session id
suffix without incrementing service user session id counter

8 years agosdbox: Don't open mail files when expunging
Timo Sirainen [Fri, 25 Aug 2017 15:40:23 +0000 (18:40 +0300)] 
sdbox: Don't open mail files when expunging

It was done when mail_attachment_fs was non-empty (and default is
non-empty), even though mail_attachment_dir was empty.

8 years agomdbox: Use mail_storage_set_index_error() instead of poorly duplicating it
Timo Sirainen [Mon, 21 Aug 2017 12:44:41 +0000 (15:44 +0300)] 
mdbox: Use mail_storage_set_index_error() instead of poorly duplicating it

8 years agolib-storage: Add mail_storage_set_index_error()
Timo Sirainen [Mon, 21 Aug 2017 12:34:40 +0000 (15:34 +0300)] 
lib-storage: Add mail_storage_set_index_error()

8 years agolib-storage: index_mail_set_cache_corrupted() - Don't reset internal error string
Timo Sirainen [Mon, 21 Aug 2017 12:29:46 +0000 (15:29 +0300)] 
lib-storage: index_mail_set_cache_corrupted() - Don't reset internal error string

It's already set correctly by the earlier functions.

8 years agolib-storage: mail_set_mail_cache_corrupted() - set also internal error string
Timo Sirainen [Mon, 21 Aug 2017 12:27:48 +0000 (15:27 +0300)] 
lib-storage: mail_set_mail_cache_corrupted() - set also internal error string

8 years agolib-storage: mailbox_set_index_error() - Set internal error string to index's error
Timo Sirainen [Mon, 21 Aug 2017 12:26:13 +0000 (15:26 +0300)] 
lib-storage: mailbox_set_index_error() - Set internal error string to index's error

8 years agolib-storage: Fix error logging after mail_storage_set_internal_error()
Timo Sirainen [Mon, 21 Aug 2017 12:11:30 +0000 (15:11 +0300)] 
lib-storage: Fix error logging after mail_storage_set_internal_error()

The function doesn't actually set the last_internal_error and it also
doesn't update last_error_is_internal, so calling
mail_storage_get_last_internal_error() afterwards could be returning an
error for some different older error.

Since there's no parameter to set the internal error string, just reset
last_error_is_internal=FALSE.

8 years agolib-storage: Preserve messages' vsize record when rebuilding index
Timo Sirainen [Fri, 8 Sep 2017 09:20:21 +0000 (12:20 +0300)] 
lib-storage: Preserve messages' vsize record when rebuilding index

Since vsize is often used by quota, losing this can be very expensive.
If the vsize is wrong, it gets fixed automatically when fetching the
message body.

8 years agolib-index: Avoid opening .log.2 file if .log was reset
Timo Sirainen [Fri, 25 Aug 2017 12:12:06 +0000 (15:12 +0300)] 
lib-index: Avoid opening .log.2 file if .log was reset

After a reset there's no point in trying to read the older log files.
This avoids trying to open .log.2 at least for newly created mailboxes
when trying to lookup log file sequence 1 (since due to some bug/feature
the log files start from sequence 2).

8 years agolib-settings: Escape comma in section name.
Sergey Kitov [Thu, 24 Aug 2017 07:01:02 +0000 (10:01 +0300)] 
lib-settings: Escape comma in section name.

Comma is valid symbol in encoded non-ascii section names, so it
shouldn't be used as splitting symbol in section name.

8 years agoglobal: Add/change switch case "fall through" comments
Timo Sirainen [Thu, 17 Aug 2017 10:20:26 +0000 (13:20 +0300)] 
global: Add/change switch case "fall through" comments

These fix warnings with gcc 7's -Wimplicit-fallthrough

8 years agolib: Add missing parenthesis to timeout_add()'s msecs parameter checks
Timo Sirainen [Thu, 17 Aug 2017 11:42:07 +0000 (14:42 +0300)] 
lib: Add missing parenthesis to timeout_add()'s msecs parameter checks

This caused wrong results when the msecs parameter contained e.g. var?1:2

8 years agolib: Fix compiler warning about mixing boolean with multiplication
Timo Sirainen [Thu, 17 Aug 2017 10:14:16 +0000 (13:14 +0300)] 
lib: Fix compiler warning about mixing boolean with multiplication

8 years agopush-notification plugin: properly terminate strings
Michael Koch [Wed, 16 Aug 2017 10:53:55 +0000 (13:53 +0300)] 
push-notification plugin: properly terminate strings

Without this fix, if the new message does not contain a from, a subject, and
a snippet the generated JSON will be malformed (the status check at the end
appended a '"' when it shouldn't have).

8 years agolib-storage: If root dir already exists as file, log better error message.
Timo Sirainen [Tue, 25 Jul 2017 06:35:31 +0000 (09:35 +0300)] 
lib-storage: If root dir already exists as file, log better error message.

8 years agolib-storage: Try to get mailbox list index's permissions from its parent directory
Timo Sirainen [Mon, 24 Jul 2017 18:08:33 +0000 (21:08 +0300)] 
lib-storage: Try to get mailbox list index's permissions from its parent directory

This avoids stat()ing the mail/index root directory, which is especially
useful when mailbox list index is stored in tmpfs.

8 years agolib-index: Add mail_index_use_existing_permissions()
Timo Sirainen [Mon, 24 Jul 2017 18:07:44 +0000 (21:07 +0300)] 
lib-index: Add mail_index_use_existing_permissions()

This has annoyingly lot of copy&pasting from
mailbox_list_get_permissions_stat(), but there didn't seem to be any nice
place where to share the code.

8 years agolib-storage: If ITERINDEX is set, delay checking whether mail root exists
Timo Sirainen [Mon, 24 Jul 2017 17:48:25 +0000 (20:48 +0300)] 
lib-storage: If ITERINDEX is set, delay checking whether mail root exists

In future this could be done even without ITERINDEX. It's not done yet,
since it might break backwards compatibility with some systems.

8 years agolib-storage: Fix INBOX notifications to set correct events
Timo Sirainen [Mon, 4 Sep 2017 14:48:52 +0000 (17:48 +0300)] 
lib-storage: Fix INBOX notifications to set correct events

This fixes IMAP NOTIFY so it doesn't send STATUS notifications to INBOX when
it doesn't have to.

8 years agolib-storage: List index notify cleanup - move code to separate functions
Timo Sirainen [Mon, 4 Sep 2017 14:37:05 +0000 (17:37 +0300)] 
lib-storage: List index notify cleanup - move code to separate functions

No functional changes. In preparation for the next commit.

8 years agolib-storage: Remove INBOX notification checks if mailbox events aren't requested
Timo Sirainen [Mon, 4 Sep 2017 13:59:52 +0000 (16:59 +0300)] 
lib-storage: Remove INBOX notification checks if mailbox events aren't requested

Nothing would be done with the results of those checks.

Note that MAILBOX_LIST_NOTIFY_UIDVALIDITY can be handled using mailbox list
index, even for INBOX with mailbox_list_index_include_inbox=no.

8 years agolib-storage: Optimize INBOX notifications with mailbox_list_index_include_inbox=yes
Timo Sirainen [Mon, 4 Sep 2017 13:55:30 +0000 (16:55 +0300)] 
lib-storage: Optimize INBOX notifications with mailbox_list_index_include_inbox=yes

There's no need for special INBOX checks in that case, because INBOX is
tracked in the mailbox list index the same as any other mailbox.

8 years agopop3-migration: Fail if all IMAP mails were matched by size, but POP3 had extra mails
Timo Sirainen [Mon, 4 Sep 2017 16:37:12 +0000 (19:37 +0300)] 
pop3-migration: Fail if all IMAP mails were matched by size, but POP3 had extra mails

This makes the handling same as what happens when the same situation happens
and the last mails were matched by headers. That's an error, unless
pop3_migration_ignore_*_uidls=yes.

8 years agopop3-migration: Add pop3_migration_ignore_extra_uidls=yes setting
Timo Sirainen [Mon, 4 Sep 2017 15:32:15 +0000 (18:32 +0300)] 
pop3-migration: Add pop3_migration_ignore_extra_uidls=yes setting

8 years agopop3-migration: Strip away invalid header lines.
Timo Sirainen [Mon, 4 Sep 2017 09:40:49 +0000 (12:40 +0300)] 
pop3-migration: Strip away invalid header lines.

If there's no ":" in the header, remove it. Fixes matching mails with
Zimbra.