]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agosubmission: Truly enforce a configurable message size limit (default 40 MB).
Stephan Bosch [Fri, 6 Apr 2018 23:09:12 +0000 (01:09 +0200)] 
submission: Truly enforce a configurable message size limit (default 40 MB).

Before, it was only checking a provided SIZE parameter to the MAIL command and
not the size of the actually submitted message.

7 years agolmtp: Explicitly disable message size limit enforcement.
Stephan Bosch [Fri, 6 Apr 2018 23:08:34 +0000 (01:08 +0200)] 
lmtp: Explicitly disable message size limit enforcement.

7 years agosubmission: Actively enforce message size limit while copying message data.
Stephan Bosch [Fri, 6 Apr 2018 23:08:11 +0000 (01:08 +0200)] 
submission: Actively enforce message size limit while copying message data.

7 years agolmtp: Actively enforce message size limit while copying message data.
Stephan Bosch [Fri, 6 Apr 2018 23:06:13 +0000 (01:06 +0200)] 
lmtp: Actively enforce message size limit while copying message data.

This is actually currently not relevant to LMTP, but for future implementation
this code is added here already.

7 years agolib-smtp: server: Implement enforcement of maximum message size.
Stephan Bosch [Fri, 6 Apr 2018 23:05:15 +0000 (01:05 +0200)] 
lib-smtp: server: Implement enforcement of maximum message size.

7 years agolib-smtp: command parser: Provide more details in command data size limit error.
Stephan Bosch [Fri, 6 Apr 2018 23:03:58 +0000 (01:03 +0200)] 
lib-smtp: command parser: Provide more details in command data size limit error.

7 years agoconfigure: Create a definition for UOFF_T_MAX.
Stephan Bosch [Fri, 6 Apr 2018 23:00:46 +0000 (01:00 +0200)] 
configure: Create a definition for UOFF_T_MAX.

7 years agolib-smtp: server: Fix error message logged for errors occurring in data wrapper strea...
Stephan Bosch [Wed, 4 Apr 2018 22:34:49 +0000 (00:34 +0200)] 
lib-smtp: server: Fix error message logged for errors occurring in data wrapper stream during DATA transfer.

Used the connection stream rather than the data stream to obtain the error.
Obviously, there is no error on the low-level connection when there is a data
istream (e.g. message size) error.

7 years agolib-smtp: server: DATA command: Restore input handling upon failure.
Stephan Bosch [Fri, 11 May 2018 17:26:45 +0000 (19:26 +0200)] 
lib-smtp: server: DATA command: Restore input handling upon failure.

Fixes command hanging upon failure during data transfer.

7 years agoauth: Use PRIuUOFF_t to print process VSZ limit
Josef 'Jeff' Sipek [Fri, 11 May 2018 14:41:01 +0000 (10:41 -0400)] 
auth: Use PRIuUOFF_t to print process VSZ limit

This doesn't change the behavior, but it makes it more obviously correct.

7 years agoauth: Avoid comparison of ints of different signs on FreeBSD
Josef 'Jeff' Sipek [Fri, 11 May 2018 14:38:32 +0000 (10:38 -0400)] 
auth: Avoid comparison of ints of different signs on FreeBSD

For legacy reasons, rlim_t on FreeBSD is defined as int64_t.

7 years agoauth: test - make sure memory gets free'd
Aki Tuomi [Tue, 17 Apr 2018 09:11:05 +0000 (12:11 +0300)] 
auth: test - make sure memory gets free'd

7 years agoauth: Add test for lua password verify
Aki Tuomi [Tue, 17 Apr 2018 07:55:53 +0000 (10:55 +0300)] 
auth: Add test for lua password verify

7 years agoauth: db-lua - Add password_verify to auth request
Aki Tuomi [Thu, 12 Apr 2018 10:39:58 +0000 (13:39 +0300)] 
auth: db-lua - Add password_verify to auth request

Allows verifying passwords with dovecot when necessary

7 years agoauth: db-lua - Expose some auth request members
Aki Tuomi [Wed, 11 Apr 2018 09:39:51 +0000 (12:39 +0300)] 
auth: db-lua - Expose some auth request members

These are particularly useful for finding out if user
has already been authenticated.

7 years agoauth: db-lua - Remove extra space from log_error
Aki Tuomi [Wed, 11 Apr 2018 09:29:41 +0000 (12:29 +0300)] 
auth: db-lua - Remove extra space from log_error

This makes it possible to use the log_error method.

Broken in 9698cd24

7 years agoauth: Improve auth-master connections' error logging
Timo Sirainen [Fri, 4 May 2018 12:27:14 +0000 (15:27 +0300)] 
auth: Improve auth-master connections' error logging

Include connect and handshake times in the error message.

7 years agolib-master: Add auth connect & handshake times to master_login_auth_request errors
Timo Sirainen [Fri, 4 May 2018 11:14:35 +0000 (14:14 +0300)] 
lib-master: Add auth connect & handshake times to master_login_auth_request errors

7 years agolib-master: Add request time also for internal failure error messages
Timo Sirainen [Fri, 4 May 2018 11:10:49 +0000 (14:10 +0300)] 
lib-master: Add request time also for internal failure error messages

7 years agolib-master: Use more exact timestamp in master_login_auth_request failures
Timo Sirainen [Fri, 4 May 2018 11:03:46 +0000 (14:03 +0300)] 
lib-master: Use more exact timestamp in master_login_auth_request failures

7 years agolib-master: Improve error logging for master_auth_connection failures
Timo Sirainen [Fri, 4 May 2018 10:56:45 +0000 (13:56 +0300)] 
lib-master: Improve error logging for master_auth_connection failures

7 years agolib-master: Improve error logging for post-login script failures
Timo Sirainen [Fri, 4 May 2018 10:42:23 +0000 (13:42 +0300)] 
lib-master: Improve error logging for post-login script failures

7 years agolib-master: Improve error logging when master_login_connection gets disconnected
Timo Sirainen [Fri, 4 May 2018 10:23:07 +0000 (13:23 +0300)] 
lib-master: Improve error logging when master_login_connection gets disconnected

7 years agolib-master: Keep linked list of master_login_clients per connection
Timo Sirainen [Fri, 4 May 2018 10:07:50 +0000 (13:07 +0300)] 
lib-master: Keep linked list of master_login_clients per connection

This allows improving logging on connection errors.

7 years agofts: When indexing virtual mailbox, index each real mailbox entirely
Timo Sirainen [Thu, 3 May 2018 15:33:25 +0000 (18:33 +0300)] 
fts: When indexing virtual mailbox, index each real mailbox entirely

Index all the unindexed messages in them at once, instead of jumping between
real mailboxes and indexing them in small pieces.

7 years agofts: Indexing virtual mailbox didn't always index the last mails
Timo Sirainen [Thu, 3 May 2018 15:33:00 +0000 (18:33 +0300)] 
fts: Indexing virtual mailbox didn't always index the last mails

7 years agofts: Make sure indexing virtual mailbox doesn't recurse and index mail multiple times
Timo Sirainen [Thu, 3 May 2018 15:30:51 +0000 (18:30 +0300)] 
fts: Make sure indexing virtual mailbox doesn't recurse and index mail multiple times

7 years agocassandra: Use fallback_consistency on more types of errors
Timo Sirainen [Thu, 3 May 2018 14:06:04 +0000 (17:06 +0300)] 
cassandra: Use fallback_consistency on more types of errors

This could allow for example read_consistency=local-quorum with
read_fallback_consistency=quorum, so most of the time the reads are
from local datacenter, but in case it has problems you can switch to
other datacenters.

7 years agocassandra: Cleanup - Move code to query_error_want_fallback()
Timo Sirainen [Thu, 3 May 2018 13:58:21 +0000 (16:58 +0300)] 
cassandra: Cleanup - Move code to query_error_want_fallback()

This allows extending it more easily.

7 years agofs-posix: mkdir missing directory if it's changed by FS_METADATA_WRITE_FNAME
Timo Sirainen [Thu, 3 May 2018 12:22:09 +0000 (15:22 +0300)] 
fs-posix: mkdir missing directory if it's changed by FS_METADATA_WRITE_FNAME

The temp file is created to the initial directory. If the directory is
changed by FS_METADATA_WRITE_FNAME, the new destination directory didn't
necessarily exist. If the link() or rename() fails with ENOENT, try to
mkdir the missing directories.

7 years agolib-index: mail_index_sync_map() - Don't try to-resync extension updates
Timo Sirainen [Sun, 29 Apr 2018 09:31:23 +0000 (12:31 +0300)] 
lib-index: mail_index_sync_map() - Don't try to-resync extension updates

This was done to call extension record sync handlers, but the previous
commit removes them. Fixes a problem where obsolete cache offsets were
used in some situations:

 - Some cache updates are from external transactions and some are from
non-external transactions. This is because cache offset updates are being
added by whatever the parent index transaction is.

 - When mail_index_sync_map() is mapping MAIL_INDEX_SYNC_HANDLER_FILE, it
has already synced the map. But it's calling mail_index_sync_record()
for non-external transactions to call expunge handlers and extension
update handlers. It's calling the regular mail_index_sync_record() to do
this work.

 - But mail_index_sync_record() is actually still updating the map. So now
mail_index_sync_record() is called for all non-external cache updates,
but not for external cache updates! And since these are somewhat
randomly either external or non-external, the end result is that the
cache offset may be obsolete.

7 years agolib-index: Remove extension record sync handlers
Timo Sirainen [Sun, 29 Apr 2018 09:23:49 +0000 (12:23 +0300)] 
lib-index: Remove extension record sync handlers

This is no longer used by anything, and it makes the fix in the following
commit much easier.

This was originally added in 6a19e109ee8c5a6f688da83a86a7f6abeb71abdd to
allow dovecot.index.cache updating to hook into updating cache offsets to
link cache records together. This was reimplemented in a different way in
131b073bdc3650083b00616dc778dd3017c2bbb5

7 years agolib-http: server: Properly handle corrupt payload while finishing a request.
Stephan Bosch [Tue, 20 Mar 2018 17:14:39 +0000 (18:14 +0100)] 
lib-http: server: Properly handle corrupt payload while finishing a request.

The HTTP_REQUEST_PARSE_ERROR_BROKEN_REQUEST was not handled, causing an
assertion panic. This situation occurred when the chunked transfer encoding was
invalid.

7 years agolib-http: server: Properly handle payload stream errors while finishing a request.
Stephan Bosch [Tue, 20 Mar 2018 17:10:42 +0000 (18:10 +0100)] 
lib-http: server: Properly handle payload stream errors while finishing a request.

Errors from the (chunked) payload stream would cause assertion panics at that point.

7 years agolib-http: server: Allow resubmitting a response, as long as it is not sent yet.
Stephan Bosch [Tue, 20 Mar 2018 17:04:36 +0000 (18:04 +0100)] 
lib-http: server: Allow resubmitting a response, as long as it is not sent yet.

7 years agocassandra: Add proper log levels to logged messages
Timo Sirainen [Thu, 26 Apr 2018 18:07:31 +0000 (21:07 +0300)] 
cassandra: Add proper log levels to logged messages

If logging to "internal handler", i.e. to log process, write the log prefix
that includes the log level. This way Cassandra's trace/debug/info messages
won't end up in error log.

7 years agolib: Add i_failure_handler_is_internal()
Timo Sirainen [Thu, 26 Apr 2018 18:07:22 +0000 (21:07 +0300)] 
lib: Add i_failure_handler_is_internal()

7 years agolib-fs: fs-posix - Add accurate-mtime parameter
Timo Sirainen [Thu, 26 Apr 2018 16:38:55 +0000 (19:38 +0300)] 
lib-fs: fs-posix - Add accurate-mtime parameter

This is mainly useful for testing to find out whether one file was created
after another.

7 years agolib-fs: Update FS_METADATA_WRITE_FNAME comment
Timo Sirainen [Thu, 26 Apr 2018 15:23:54 +0000 (18:23 +0300)] 
lib-fs: Update FS_METADATA_WRITE_FNAME comment

7 years agolib-fs: fs-posix - FS_METADATA_WRITE_FNAME replaces the full path
Timo Sirainen [Thu, 26 Apr 2018 15:14:27 +0000 (18:14 +0300)] 
lib-fs: fs-posix - FS_METADATA_WRITE_FNAME replaces the full path

This is how all the other fs drivers work, although the macro name is a bit
confusing.

7 years agolib-fs: fs-metawrap - Pass FS_METADATA_WRITE_FNAME through to parent fs
Timo Sirainen [Thu, 26 Apr 2018 15:14:46 +0000 (18:14 +0300)] 
lib-fs: fs-metawrap - Pass FS_METADATA_WRITE_FNAME through to parent fs

fs-metawrap in the middle pervented the renaming from working.

7 years agolib-storage: Remove mail_attachment_detection_options=add-flags-on-fetch parsing
Timo Sirainen [Thu, 26 Apr 2018 13:42:40 +0000 (16:42 +0300)] 
lib-storage: Remove mail_attachment_detection_options=add-flags-on-fetch parsing

It wasn't actually used yet.

7 years agolib-storage: Fail if mail_attachment_detection_options has invalid options
Timo Sirainen [Thu, 26 Apr 2018 13:41:55 +0000 (16:41 +0300)] 
lib-storage: Fail if mail_attachment_detection_options has invalid options

7 years agolib-storage: Set $Has[No]Attachment earlier among other cached data
Timo Sirainen [Thu, 19 Apr 2018 13:38:22 +0000 (16:38 +0300)] 
lib-storage: Set $Has[No]Attachment earlier among other cached data

7 years agolib: Fix returning error from unlink_directory()
Timo Sirainen [Thu, 26 Apr 2018 23:39:10 +0000 (02:39 +0300)] 
lib: Fix returning error from unlink_directory()

On non-ENOENT errors it was returning 1 instead of -1.

7 years agolib-storage: Fix event leak when failing to create storage
Timo Sirainen [Thu, 26 Apr 2018 20:05:21 +0000 (23:05 +0300)] 
lib-storage: Fix event leak when failing to create storage

7 years agomdbox: Assume that empty uid maps found during sync are harmless
Josef 'Jeff' Sipek [Mon, 23 Apr 2018 22:15:51 +0000 (18:15 -0400)] 
mdbox: Assume that empty uid maps found during sync are harmless

Instead of failing the sync and causing index rebuild, just skip over
the empty uid maps.  Chances are that they these records came from
various plugins that create fake mails.

7 years agoman: Document doveadm mailbox cache commands
Aki Tuomi [Wed, 25 Apr 2018 07:56:04 +0000 (10:56 +0300)] 
man: Document doveadm mailbox cache commands

7 years agoplugins/old-stats: Remove restrict_access_set_dumpable calls from process_io_open().
Sergey Kitov [Thu, 26 Apr 2018 06:48:39 +0000 (09:48 +0300)] 
plugins/old-stats: Remove restrict_access_set_dumpable calls from process_io_open().

proc_io_fd is opened in preinit(), while process have root access, so
restrict_access_set_dumpable() calls are not needed.

7 years ago.gitignore: Ignore doc/man/doveadm-rebuild.1
Martti Rannanjärvi [Thu, 26 Apr 2018 10:18:01 +0000 (13:18 +0300)] 
.gitignore: Ignore doc/man/doveadm-rebuild.1

7 years agoglobal - migrate more complicated strncmp expressions to str_begins
Phil Carmody [Thu, 11 Jan 2018 13:35:42 +0000 (15:35 +0200)] 
global - migrate more complicated strncmp expressions to str_begins

Simplify a bunch of verbose var=strlen(); strncmp(,,var) calls.
Fortunately, all of these examples use the length variable, so no
"unused value" warnings occur.

--- 8< --- strncmp2.cocci ---
@@
expression e1, e2;
identifier i2;
@@

  i2 = strlen(e2)
  ...
- strncmp(e1, e2, i2) == 0
+ str_begins(e1, e2)

@@
expression e1, e2;
identifier i2;
@@

  i2 = strlen(e2)
  ...
- strncmp(e1, e2, i2) != 0
+ !str_begins(e1, e2)

@@
expression e1, e2;
identifier i1;
@@

  i1 = strlen(e1)
  ...
- strncmp(e1, e2, i1) == 0
+ str_begins(e2, e1)

@@
expression e1, e2;
identifier i1;
@@

  i1 = strlen(e1)
  ...
- strncmp(e1, e2, i1) != 0
+ !str_begins(e2, e1)

--- 8< ---------------------

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agoglobal - migrate from strncmp to str_begins
Phil Carmody [Thu, 11 Jan 2018 13:20:09 +0000 (15:20 +0200)] 
global - migrate from strncmp to str_begins

Simplify a bunch of verbose strncmp(,,strlen()) calls.

--- 8< --- strncmp.cocci ---
@@
expression e1, e2;
@@

- strncmp(e1, e2, strlen(e2)) == 0
+ str_begins(e1, e2)

@@
expression e1, e2;
@@

- strncmp(e1, e2, strlen(e2)) != 0
+ !str_begins(e1, e2)

@@
expression e1, e2;
@@

- strncmp(e1, e2, strlen(e1)) == 0
+ str_begins(e2, e1)

@@
expression e1, e2;
@@

- strncmp(e1, e2, strlen(e1)) != 0
+ !str_begins(e2, e1)

--- 8< ---------------------

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agoglobal - migrate strncmp literals to str_begins
Phil Carmody [Thu, 11 Jan 2018 13:03:36 +0000 (15:03 +0200)] 
global - migrate strncmp literals to str_begins

Simplify a bunch of strncmp(,,number) calls.

git ls-files \*.[ch] | xargs perl -p -i -e 's/strncmp\((.*?), ?(\".*?\"), ?(\d+)\) == 0/str_begins($1, $2)/g'
git ls-files \*.[ch] | xargs perl -p -i -e 's/strncmp\((.*?), ?(\".*?\"), ?(\d+)\) != 0/!str_begins($1, $2)/g'

I ran a longer script to verify that all of the string literals and
the length matched. They didn't:

$ git grep strncmp | perl -ne 'print if(m/strncmp\([^,]*,\s*"(.*?)",\s*(\d+)/ and ($s=$1,$t=$2,$s=~s/\\[tn]/#/g,length($s)) != $t)'
src/auth/db-oauth2.c:               if (strncmp(field, "oauth2:", 8) == 0 &&

With the new functions, that kind of typo is impossible.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib: strfuncs - string match length and prefix checking helpers
Phil Carmody [Thu, 2 Feb 2017 12:27:58 +0000 (14:27 +0200)] 
lib: strfuncs - string match length and prefix checking helpers

strncmp(input, "literal", 7) is an idiom used everywhere, but leaves
room for human error in calculating the length.

strncmp(input, "literal", strlen("literal")) is an idiom also used
everywhere, but is both verbose and might be inefficient on some
legacy or ultralightweight compilers.

The old techniques are presumed to be optimal code-wise, but are
verbose (and, containing redundancy, they leave room for human error),
so make the macro fall back onto this operation, simply avoiding the
redundancy/verbosity.

The macro expansion does not multiply evaluate any of its parameters,
so should be safe even in the strangest of situations.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib: uni_utf8_get_valid_data() - Add ATTR_WARN_UNUSED_RESULT
Timo Sirainen [Wed, 25 Apr 2018 12:23:35 +0000 (15:23 +0300)] 
lib: uni_utf8_get_valid_data() - Add ATTR_WARN_UNUSED_RESULT

Ignoring the return value most likely leads to buggy code, so make sure it's
checked.

7 years agolib-storage: Don't ignore uni_utf8_get_valid_data() return value
Timo Sirainen [Wed, 25 Apr 2018 12:22:37 +0000 (15:22 +0300)] 
lib-storage: Don't ignore uni_utf8_get_valid_data() return value

It's not supposed to happen, so call i_unreached()

7 years agolib-fts: Minor fix to randomness test in test-fts-tokenizer
Timo Sirainen [Wed, 25 Apr 2018 12:20:58 +0000 (15:20 +0300)] 
lib-fts: Minor fix to randomness test in test-fts-tokenizer

If the random input was entirely valid UTF-8, the input was truncated to
empty.

7 years agofts: Fix indexing input that contains NULs
Timo Sirainen [Wed, 25 Apr 2018 12:17:53 +0000 (15:17 +0300)] 
fts: Fix indexing input that contains NULs

Any message_block that contained NULs, but otherwise was valid UTF-8, was
simply dropped.

7 years agolast-login: Remove superfluous semicolon
Michael Slusarz [Mon, 16 Apr 2018 16:38:21 +0000 (10:38 -0600)] 
last-login: Remove superfluous semicolon

7 years agolast-login: Username is already output as part of log prefix
Michael Slusarz [Mon, 16 Apr 2018 16:37:32 +0000 (10:37 -0600)] 
last-login: Username is already output as part of log prefix

7 years agolib-http: test-http-client - Only load existing CAs
Aki Tuomi [Wed, 28 Mar 2018 06:11:55 +0000 (09:11 +0300)] 
lib-http: test-http-client - Only load existing CAs

Otherwise the SSL tests do not properly work.

Fixes Error: HTTP Request failed: Couldn't initialize SSL context: Can't load CA certs from directory /etc/ssl/certs: error:02001002:system library:fopen:No such file or directory: fopen('/etc/pki/tls/cert.pem','r'), error:2006D080:BIO routines:BIO_new_file:no such file, error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib

7 years agolib-http: test-http-client - Test against missing SAN name
Aki Tuomi [Tue, 27 Mar 2018 07:31:53 +0000 (10:31 +0300)] 
lib-http: test-http-client - Test against missing SAN name

Add test to make sure http client validates and ignores
missing subjectAltName in cert, when not validating names.

7 years agolib-ssl-iostream: Do not skip cert name check if invalid cert is allowed
Aki Tuomi [Tue, 27 Mar 2018 07:20:54 +0000 (10:20 +0300)] 
lib-ssl-iostream: Do not skip cert name check if invalid cert is allowed

Caller should be responsible for ignoring this error, not us.
All the locations calling here are dealing this correctly.

7 years agolib-ssl-iostream: Fix missing altName handling in openssl_cert_match_name
Aki Tuomi [Tue, 27 Mar 2018 07:29:49 +0000 (10:29 +0300)] 
lib-ssl-iostream: Fix missing altName handling in openssl_cert_match_name

If name is not found in subjectAltNames, report it as error.

Fixes Panic: file iostream-openssl-common.c: line 177 (openssl_cert_match_name): assertion failed: (*reason_r != NULL)

7 years agolib-mail: Remove MESSAGE_HEADER_REPLACE_NULS_WITH_0x80 flag
Timo Sirainen [Wed, 25 Apr 2018 11:19:27 +0000 (14:19 +0300)] 
lib-mail: Remove MESSAGE_HEADER_REPLACE_NULS_WITH_0x80 flag

As mentioned in previous commit, 0x80 isn't valid UTF-8 and we shouldn't
encourage using it. This implementation also can't be easily changed to
use unicode replacement character without larger changes to istream-nonuls.

Reverts 95fba2c295bb84639dc64ca5c9f2ccb9edc00ba7.

7 years agolib-mail: Change NUL -> 0x80 replacement to use unicode replacement char instead
Timo Sirainen [Wed, 25 Apr 2018 11:17:34 +0000 (14:17 +0300)] 
lib-mail: Change NUL -> 0x80 replacement to use unicode replacement char instead

Using 0x80 produces invalid UTF-8 output, which we should avoid. Some places
in Dovecot code already requires that input is valid UTF-8, so it's also
safer and easier to use the unicode replacement character.

Fixes: Panic: file fts-tokenizer-generic.c: line 210 (fts_tokenizer_generic_simple_next): assertion failed: (char_size > 0)
7 years agolib-mail: Change rfc822_parser_context.nul_replacement_char to string
Timo Sirainen [Wed, 25 Apr 2018 11:11:43 +0000 (14:11 +0300)] 
lib-mail: Change rfc822_parser_context.nul_replacement_char to string

7 years agolib: Call module's preinit function, when loading
Sergey Kitov [Wed, 18 Apr 2018 10:30:50 +0000 (13:30 +0300)] 
lib: Call module's preinit function, when loading

7 years agoplugins/old-stats: Add old-stats preinit() which opens mail stats io.
Sergey Kitov [Fri, 9 Mar 2018 13:17:29 +0000 (15:17 +0200)] 
plugins/old-stats: Add old-stats preinit() which opens mail stats io.

7 years agodoveadm: Add rebuild attachments command
Aki Tuomi [Thu, 12 Apr 2018 11:09:10 +0000 (14:09 +0300)] 
doveadm: Add rebuild attachments command

Goes thru given mails and resets the attachment indicator.

7 years agolib-storage: Parse mail parts in mail_set_attachment_keywords if not present
Aki Tuomi [Thu, 12 Apr 2018 11:07:54 +0000 (14:07 +0300)] 
lib-storage: Parse mail parts in mail_set_attachment_keywords if not present

7 years agolib-storage: Add error reporting to mail_set_attachment_keywords
Aki Tuomi [Thu, 19 Apr 2018 07:19:15 +0000 (10:19 +0300)] 
lib-storage: Add error reporting to mail_set_attachment_keywords

7 years agodoveadm: mailbox cache decisions - Fatally fail if fields are missing
Aki Tuomi [Wed, 25 Apr 2018 08:04:08 +0000 (11:04 +0300)] 
doveadm: mailbox cache decisions - Fatally fail if fields are missing

7 years agodoveadm stats dump: Add stddev field
Timo Sirainen [Tue, 24 Apr 2018 14:22:00 +0000 (17:22 +0300)] 
doveadm stats dump: Add stddev field

Include it in default output as well.

7 years agodoveadm stats dump: Add -f <fields> parameter
Timo Sirainen [Tue, 24 Apr 2018 13:29:49 +0000 (16:29 +0300)] 
doveadm stats dump: Add -f <fields> parameter

This allows specifying which fields are wanted to be dumped.

7 years agostats: Support dumping any given percentile
Timo Sirainen [Tue, 24 Apr 2018 14:32:21 +0000 (17:32 +0300)] 
stats: Support dumping any given percentile

7 years agostats: Support dumping variance
Timo Sirainen [Tue, 24 Apr 2018 06:52:32 +0000 (09:52 +0300)] 
stats: Support dumping variance

7 years agolib-mail: message_part_*_parse_from_header() - Replace NULs with 0x80
Timo Sirainen [Tue, 24 Apr 2018 15:01:03 +0000 (18:01 +0300)] 
lib-mail: message_part_*_parse_from_header() - Replace NULs with 0x80

This avoids truncation of Content-*, Subject, Message-ID, In-Reply-To and
Date headers in IMAP ENVELOPE, BODY and BODYSTRUCTURE replies. Of course,
NULs in headers are violating RFCs already, so the previous behavior wasn't
really wrong either.

7 years agodsync: If lock file can't be created because home is missing, mkdir the home
Timo Sirainen [Tue, 24 Apr 2018 15:50:38 +0000 (18:50 +0300)] 
dsync: If lock file can't be created because home is missing, mkdir the home

7 years agolib-storage: Add mail_user_home_mkdir()
Timo Sirainen [Tue, 24 Apr 2018 15:47:28 +0000 (18:47 +0300)] 
lib-storage: Add mail_user_home_mkdir()

7 years agodoveadm: Add mailbox cache manipulation commands
Aki Tuomi [Fri, 13 Apr 2018 10:28:47 +0000 (13:28 +0300)] 
doveadm: Add mailbox cache manipulation commands

This allows changing cache decisions and dropping cache pointer
for wanted mails.

7 years agodoveadm-mail: Handle field conversion to short opt better
Aki Tuomi [Sat, 14 Apr 2018 11:31:44 +0000 (14:31 +0300)] 
doveadm-mail: Handle field conversion to short opt better

Convert non-string types as well

7 years agodoveadm save: Fix using <file without panic
Timo Sirainen [Mon, 23 Apr 2018 12:05:06 +0000 (15:05 +0300)] 
doveadm save: Fix using <file without panic

When getting input with <file with Linux/epoll, it crashed with:

Panic: epoll_ctl(add, 0) failed: Operation not permitted (fd doesn't support epoll - instead of '<file', try 'cat file|')

7 years agolib: Add test for rng
Aki Tuomi [Sun, 25 Mar 2018 16:54:48 +0000 (19:54 +0300)] 
lib: Add test for rng

7 years agolib: stats-dist - Add accessor for samples
Aki Tuomi [Sun, 25 Mar 2018 18:04:49 +0000 (21:04 +0300)] 
lib: stats-dist - Add accessor for samples

7 years agolib: stats-dist - Add variance
Aki Tuomi [Sun, 25 Mar 2018 16:59:15 +0000 (19:59 +0300)] 
lib: stats-dist - Add variance

7 years agolib: rand - Fix potential modulo bias
Aki Tuomi [Sun, 25 Mar 2018 16:49:13 +0000 (19:49 +0300)] 
lib: rand - Fix potential modulo bias

7 years agoimap-hibernate: Log error when connect(imap-master) fails
Timo Sirainen [Sun, 22 Apr 2018 10:11:16 +0000 (13:11 +0300)] 
imap-hibernate: Log error when connect(imap-master) fails

It was previously logged only with info-level.

7 years agolib-storage: Don't add trailing NUL to strings in dovecot.index.cache
Timo Sirainen [Mon, 23 Apr 2018 10:39:13 +0000 (13:39 +0300)] 
lib-storage: Don't add trailing NUL to strings in dovecot.index.cache

They are unnecessary and just unnecessarily consume disk space. The
existing reading code works even if they don't exist, so this change won't
break backwards compatibility.

7 years agolib: Mark str_append_n() deprecated
Timo Sirainen [Sat, 21 Apr 2018 13:21:33 +0000 (16:21 +0300)] 
lib: Mark str_append_n() deprecated

It was almost always used wrongly. Most of the time str_append_data()
should have been used instead. str_append_max() has the old functionality.

7 years agolib: Add ATTR_DEPRECATED macro
Timo Sirainen [Sat, 21 Apr 2018 13:19:43 +0000 (16:19 +0300)] 
lib: Add ATTR_DEPRECATED macro

7 years agoglobal: Replace str_append_n() with str_append_max()
Timo Sirainen [Sat, 21 Apr 2018 13:17:03 +0000 (16:17 +0300)] 
global: Replace str_append_n() with str_append_max()

7 years agolib-fts: fts-tokenizer-address - Cleanup NUL handling in parent_data
Timo Sirainen [Sat, 21 Apr 2018 13:07:21 +0000 (16:07 +0300)] 
lib-fts: fts-tokenizer-address - Cleanup NUL handling in parent_data

The end result is anyway that the token will be truncated at the first NUL.
This change just makes the code a bit more understandable on where the
truncation will happen.

7 years agolib: str_append_[tab]unescaped(): Don't truncate input at NULs
Timo Sirainen [Sat, 21 Apr 2018 12:44:11 +0000 (15:44 +0300)] 
lib: str_append_[tab]unescaped(): Don't truncate input at NULs

For str_append_tabunescaped() the input is supposed to have NULs already
escaped though, so it was truncating only with invalid input.

7 years agoglobal: Replace str_append_n() with str_append_data() wherever possible
Timo Sirainen [Sat, 21 Apr 2018 12:24:28 +0000 (15:24 +0300)] 
global: Replace str_append_n() with str_append_data() wherever possible

It shouldn't be possible for input to have NULs in any of these places.
This makes the extra NUL-check in str_append_n() unnecessary.

7 years agolib: Add str_append_max()
Timo Sirainen [Sat, 21 Apr 2018 13:11:48 +0000 (16:11 +0300)] 
lib: Add str_append_max()

It's otherwise the same as str_append_n(), except it takes const char* as
input instead of const void*. This, as well as its name, should make it
less likely to be used wrong when the input may legitimately have NULs.

The unit test is changed from str_append_n() to str_append_max(), because
str_append_n() will be deprecated.

7 years agolib: Improve str_append_n() comment
Timo Sirainen [Sat, 21 Apr 2018 13:10:03 +0000 (16:10 +0300)] 
lib: Improve str_append_n() comment

7 years agolib-mail: Add MESSAGE_HEADER_REPLACE_NULS_WITH_0x80 flag
Sergey Kitov [Wed, 11 Apr 2018 11:41:45 +0000 (14:41 +0300)] 
lib-mail: Add MESSAGE_HEADER_REPLACE_NULS_WITH_0x80 flag

The flag signals that input stream for message_parse_header() should replace
0x0 symbols with 0x80.

7 years agolib-mail: rfc2231_parse() - Replace NULs with 0x80
Timo Sirainen [Sat, 21 Apr 2018 13:47:16 +0000 (16:47 +0300)] 
lib-mail: rfc2231_parse() - Replace NULs with 0x80

Instead of truncating the strings at NULs.

7 years agolib-mail: message_address_parse*() - Replace NULs with 0x80
Timo Sirainen [Sat, 21 Apr 2018 13:34:05 +0000 (16:34 +0300)] 
lib-mail: message_address_parse*() - Replace NULs with 0x80

Instead of truncating the strings at NULs.