]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
10 years agodsync: Fixed crash in earlier patch if node didn't have a namespace.
Timo Sirainen [Thu, 5 Feb 2015 17:40:25 +0000 (19:40 +0200)] 
dsync: Fixed crash in earlier patch if node didn't have a namespace.
This shouldn't have happened except in test-dsync-mailbox-tree-sync, but
easier and safer to fix it here.

10 years agodsync: Added assert to make sure namespace prefix isn't attempted to be renamed.
Timo Sirainen [Thu, 5 Feb 2015 17:36:29 +0000 (19:36 +0200)] 
dsync: Added assert to make sure namespace prefix isn't attempted to be renamed.
This can happen, I'm just not sure how exactly.. The previous behavior
caused assert-crashes also, this change just makes it happen earlier.

10 years agodsync: Don't assert-crash in configs where INBOX doesn't have a parent namespace.
Timo Sirainen [Thu, 5 Feb 2015 17:20:17 +0000 (19:20 +0200)] 
dsync: Don't assert-crash in configs where INBOX doesn't have a parent namespace.
The inbox=yes namespace of course exists, but if there is no prefix="" or
prefix=INBOX/ namespace, then INBOX doesn't clearly belong to any namespace.

10 years agodsync: Make sure when fixing mailbox names we don't try to change the namespace prefix.
Timo Sirainen [Tue, 3 Feb 2015 18:27:49 +0000 (20:27 +0200)] 
dsync: Make sure when fixing mailbox names we don't try to change the namespace prefix.
Although in normal installations this it wouldn't have happened in any case.

10 years agolib-storage: Avoid assert-crashing on mailbox_verify_*_name() with invalid namespace...
Timo Sirainen [Tue, 3 Feb 2015 18:23:52 +0000 (20:23 +0200)] 
lib-storage: Avoid assert-crashing on mailbox_verify_*_name() with invalid namespace prefix.

10 years agoimapc: Fixed modseq search for previous imapc_features=search change
Timo Sirainen [Tue, 3 Feb 2015 16:47:54 +0000 (18:47 +0200)] 
imapc: Fixed modseq search for previous imapc_features=search change

10 years agoimapc: Added imapc_features=search support for sending SEARCH commands.
Timo Sirainen [Tue, 3 Feb 2015 16:33:12 +0000 (18:33 +0200)] 
imapc: Added imapc_features=search support for sending SEARCH commands.
Currently requires the remote server to support ESEARCH (but this would be
easy to avoid). This is only minimally tested for now, so bugs may exist
(especially related to sub-queries).

10 years agolib-imap-client: Implemented support for GMail [THROTTLED] resp-text-code.
Timo Sirainen [Tue, 3 Feb 2015 08:15:38 +0000 (10:15 +0200)] 
lib-imap-client: Implemented support for GMail [THROTTLED] resp-text-code.
If we receive it, start throttling future commands by waiting exponentially
longer until we no longer receive [THROTTLED]. Max wait time is currently
16 seconds.

10 years agolib-http: client: Fixed double unref of request when error occurs during http_client_...
Stephan Bosch [Mon, 2 Feb 2015 21:48:30 +0000 (23:48 +0200)] 
lib-http: client: Fixed double unref of request when error occurs during http_client_request_try_retry().
Much like when the request is first submitted, any errors that occur while attempting a retry from within the callback are now delayed in a zero timer.

10 years agolib: array - test count/isempty/nonepty
Phil Carmody [Mon, 2 Feb 2015 08:26:44 +0000 (10:26 +0200)] 
lib: array - test count/isempty/nonepty
Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: array - two helpers to avoid wasteful array_count
Phil Carmody [Mon, 2 Feb 2015 08:24:42 +0000 (10:24 +0200)] 
lib: array - two helpers to avoid wasteful array_count
There's no need to dereference array->element_size and
perform a division when all you care about is the boolean
isempty/nonempty predicate:

$ git grep 'array_count(.*) > 0' | wc -l
77
$ git grep 'array_count(.*) == 0' | wc -l
95

Changing 6 of them has the following impact on the code:

$ size src/lib-imap-client/imapc-connection.o
   text    data     bss     dec     hex filename
  20879       0       4   20883    5193 src/lib-imap-client/imapc-connection.o
$ size src/lib-imap-client/imapc-connection.o
   text    data     bss     dec     hex filename
  20796       0       4   20800    5140 src/lib-imap-client/imapc-connection.o

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agoreplicator: Previous "last successful sync" timestamp change wrote data wrong to...
Timo Sirainen [Fri, 30 Jan 2015 23:10:56 +0000 (01:10 +0200)] 
replicator: Previous "last successful sync" timestamp change wrote data wrong to replicator.db
Patch by Matthew Via / Rackspace

10 years agoimap: If GETMETADATA fails for some mailbox, don't send the error message mixed in...
Timo Sirainen [Fri, 30 Jan 2015 10:29:25 +0000 (12:29 +0200)] 
imap: If GETMETADATA fails for some mailbox, don't send the error message mixed in the METADATA reply line.

10 years agoimap: Dynamic capabilities weren't being added correctly when imap_capability setting...
Timo Sirainen [Fri, 30 Jan 2015 10:19:58 +0000 (12:19 +0200)] 
imap: Dynamic capabilities weren't being added correctly when imap_capability setting was used.
They were supposed to be added when '+' prefix was used in imap_capability
and not added when it wasn't. But the behavior was exactly the opposite.

10 years agolib: str_sanitize*() max_len parameter renamed to max_bytes to describe it more accur...
Timo Sirainen [Fri, 30 Jan 2015 09:53:12 +0000 (11:53 +0200)] 
lib: str_sanitize*() max_len parameter renamed to max_bytes to describe it more accurately.

10 years agolib: Various fixes to str_sanitize*()
Timo Sirainen [Fri, 30 Jan 2015 09:52:33 +0000 (11:52 +0200)] 
lib: Various fixes to str_sanitize*()
 - UTF-8 sequences could have been truncated to become partial sequences
 - Truncation may not have happened at all to text containing UTF-8
 - str_sanitize_append() might have truncated string beyond what we were
   appending, although that happened only if max_len was very small

10 years agoreplicator: Remember last successful sync and show it in "doveadm replicator status"
Timo Sirainen [Fri, 30 Jan 2015 01:12:37 +0000 (03:12 +0200)] 
replicator: Remember last successful sync and show it in "doveadm replicator status"
Patch by Matthew Via / Rackspace

10 years agolib-ssl-iostream: Don't set EPIPE/ECONNRESET error to istream when connection is...
Timo Sirainen [Thu, 29 Jan 2015 16:43:15 +0000 (18:43 +0200)] 
lib-ssl-iostream: Don't set EPIPE/ECONNRESET error to istream when connection is closed.
Several istream users verify at EOF that stream_errno=0 and fail if it
isn't.

10 years agofts: When indexing address headers, don't add MISSING_MAILBOX or MISSING_DOMAIN.
Timo Sirainen [Tue, 27 Jan 2015 00:19:01 +0000 (02:19 +0200)] 
fts: When indexing address headers, don't add MISSING_MAILBOX or MISSING_DOMAIN.

10 years agofts: Added back fts_expunge_log_uid_count()
Timo Sirainen [Tue, 27 Jan 2015 00:07:10 +0000 (02:07 +0200)] 
fts: Added back fts_expunge_log_uid_count()
This was accidentally removed by commit 5091f03d70e1

10 years agolib-mail: Test program wasn't linked with libiconv, causing linking failures.
Timo Sirainen [Sun, 25 Jan 2015 18:37:35 +0000 (10:37 -0800)] 
lib-mail: Test program wasn't linked with libiconv, causing linking failures.

10 years agolib: array - helper to swap array buffer ownership
Phil Carmody [Sat, 24 Jan 2015 00:15:45 +0000 (02:15 +0200)] 
lib: array - helper to swap array buffer ownership
Currently there's no simple way to create a replacement for an array,
and then atomically switch in that replacement. With this helper,
you can just exchange ownership of the two lists and then free the
new list (which now contains the old buffer).

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agoimapc: Merged gmail-pop3 and gmail-labels-keyword features into a single gmail-migrat...
Timo Sirainen [Fri, 23 Jan 2015 21:19:24 +0000 (23:19 +0200)] 
imapc: Merged gmail-pop3 and gmail-labels-keyword features into a single gmail-migration feature
There's really no other reason to use them except for migration.

10 years agoimapc: With gmail-labels-keyword feature add the $GMailHaveLabels only to \All mailbox
Timo Sirainen [Fri, 23 Jan 2015 21:18:01 +0000 (23:18 +0200)] 
imapc: With gmail-labels-keyword feature add the $GMailHaveLabels only to \All mailbox
This is primarily intended for migration, and with this behavior dsync can
be run just once so it's faster.

10 years agosdbox: Fixed assert-crash when copying mails due to earlier change.
Timo Sirainen [Wed, 21 Jan 2015 00:21:35 +0000 (02:21 +0200)] 
sdbox: Fixed assert-crash when copying mails due to earlier change.

10 years agoplugins/fts: use common guid_128 helpers
Phil Carmody [Tue, 20 Jan 2015 23:53:34 +0000 (01:53 +0200)] 
plugins/fts: use common guid_128 helpers
Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agoplugins/fts: expunge-log - query function to lookup GUID/UID
Phil Carmody [Tue, 20 Jan 2015 23:52:59 +0000 (01:52 +0200)] 
plugins/fts: expunge-log - query function to lookup GUID/UID
Constant time hash lookup for GUID. Log time lookup in seq_range array.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agoplugins/fts: expunge-log - create flattened in-RAM log with no backing storage
Phil Carmody [Tue, 20 Jan 2015 23:51:46 +0000 (01:51 +0200)] 
plugins/fts: expunge-log - create flattened in-RAM log with no backing storage
Combine each record in a source expunge log. This source log does not get
deleted afterwards.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agoplugins/fts: expunge-log - pull mailbox finding/creating into a helper
Phil Carmody [Tue, 20 Jan 2015 23:48:00 +0000 (01:48 +0200)] 
plugins/fts: expunge-log - pull mailbox finding/creating into a helper
There will be more clients than just this one.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agoplugins/fts: expunge-log - permit append helpers to have no log to write to
Phil Carmody [Tue, 20 Jan 2015 23:47:25 +0000 (01:47 +0200)] 
plugins/fts: expunge-log - permit append helpers to have no log to write to
This is for creating an in-RAM, later queriable, structure which you do not
want to be written to backing storage. As when you've finished with one, there's
no concept of a "commit", provide an alternative "abort" way out. These are
identical apart from the call to the write() routine, so refactor the two.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agoplugins/fts: expung-log - add the concept of not unlinking at the end
Phil Carmody [Tue, 20 Jan 2015 23:46:13 +0000 (01:46 +0200)] 
plugins/fts: expung-log - add the concept of not unlinking at the end
No behavioural differences, the default is to unlink.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: seq-range-array - add range changes
Phil Carmody [Tue, 20 Jan 2015 23:44:31 +0000 (01:44 +0200)] 
lib: seq-range-array - add range changes
Pull the _add_range() guts into a private helper function, and add a new
_add_range_count() helper which also returns the number of SEQs added.

Expand the tests to test this new functionality.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: data-stack - fix pointer arithmetic compiler warning
Phil Carmody [Tue, 20 Jan 2015 23:42:01 +0000 (01:42 +0200)] 
lib: data-stack - fix pointer arithmetic compiler warning
Clang's -fsanitize=unsigned-integer-overflow barfs as follows:

data-stack.c:477:29: runtime error: negation of 8 cannot be represented in type 'unsigned long'
data-stack.c:495:15: runtime error: negation of 8 cannot be represented in type 'unsigned long'

Which is of course complete bollocks. There is no 8, there's only an 8ul, and
the negation of 8ul is 0xfffffff8ul (or a wider equivalent). That's the law.

However, the pointer arithmetic which follows the negation, whilst almost
certainly working in practice, is probably bogus, so just make the thing
signed before the negation, and both problems go away.

Reported-by: Teemu Huovila <teemu.huovila@dovecot.fi>
Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agomaster: Fixed a check to see if login directory has any unix listeners.
Timo Sirainen [Tue, 20 Jan 2015 22:19:17 +0000 (00:19 +0200)] 
master: Fixed a check to see if login directory has any unix listeners.

10 years agoimapc: Implemented imapc_features=gmail-pop3 that also migrates pop3_deleted_flag.
Timo Sirainen [Tue, 20 Jan 2015 19:54:58 +0000 (21:54 +0200)] 
imapc: Implemented imapc_features=gmail-pop3 that also migrates pop3_deleted_flag.
This also caused gmail-pop3-uidl feature to be renamed to simply gmail-pop3,
which includes both the features.

10 years agolib-imap-client: Added imapc_command_get_tag()
Timo Sirainen [Tue, 20 Jan 2015 19:49:04 +0000 (21:49 +0200)] 
lib-imap-client: Added imapc_command_get_tag()

10 years agoimapc: Added imapc_features=gmail-pop3-uidl
Timo Sirainen [Tue, 20 Jan 2015 03:41:23 +0000 (05:41 +0200)] 
imapc: Added imapc_features=gmail-pop3-uidl
This allows imapc to generate GMail POP3 compatible UIDL so that
pop3-migration plugin isn't needed.

10 years agodsync: Allow -m parameter to specify \Special-use mailboxes.
Timo Sirainen [Tue, 20 Jan 2015 02:46:51 +0000 (04:46 +0200)] 
dsync: Allow -m parameter to specify \Special-use mailboxes.
Similarly to how -x parameter allows them.

10 years agodsync: Crashfix to -F parameter handling.
Timo Sirainen [Tue, 20 Jan 2015 02:46:26 +0000 (04:46 +0200)] 
dsync: Crashfix to -F parameter handling.

10 years agoimapc: Added imapc_features=gmail-labels-keyword
Timo Sirainen [Tue, 20 Jan 2015 02:30:27 +0000 (04:30 +0200)] 
imapc: Added imapc_features=gmail-labels-keyword
This is a bit kludgy feature mainly intended for migrations from GMail.
Unfortunately I couldn't figure out any nicer way to do this for now.
GMail's "All Mail" folder contains all messages in all folders, but it also
contains some messages that don't exist in other folders. For migrations we
want to copy only those messages that don't exist elsewhere. This can now be
achieved with something like:

doveadm -o imapc_features='gmail-labels-keyword ...' \
  backup -F '-$GmailHaveLabels' mdbox:~/mdbox

Note that dsync can't handle inserting mails into folders, so if doveadm
backup is already run once and one of the existing mails loses all labels,
doveadm backup will delete the whole folder and start again.

10 years agodsync: Added -F parameter to sync only mails with[out] specific flag.
Timo Sirainen [Tue, 20 Jan 2015 02:07:09 +0000 (04:07 +0200)] 
dsync: Added -F parameter to sync only mails with[out] specific flag.

10 years agodsync: If same GUID already exists in storage, try to copy it instead of recreating...
Timo Sirainen [Tue, 20 Jan 2015 01:23:29 +0000 (03:23 +0200)] 
dsync: If same GUID already exists in storage, try to copy it instead of recreating the mail.
This way most mailbox backends can reduce disk space by only doing a
reference count update.

This feature isn't enabled by default. A virtual "All Mails" mailbox needs
to be configured using the virtual plugin. Then you need to give this
mailbox as -a parameter, e.g.:
doveadm sync -a "Virtual/All Mails" ...

Currently this is implemented by reading through all the GUIDs in the
virtual mailbox. This of course isn't very efficient for things like
incremental replication. An upcoming conversation plugin will keep track of
all the mails' GUIDs, so in future replication should be able to have this
functionality efficiently as well.

10 years agovirtual plugin: Read virtual index header when opening virtual mailbox.
Timo Sirainen [Tue, 20 Jan 2015 01:14:37 +0000 (03:14 +0200)] 
virtual plugin: Read virtual index header when opening virtual mailbox.
This allows doing some mailbox accessing without actually syncing the
mailbox. For example MAIL_FETCH_MAILBOX_NAME can be used without crashing.

10 years agodsync: Added more debug logging.
Timo Sirainen [Mon, 19 Jan 2015 22:20:27 +0000 (00:20 +0200)] 
dsync: Added more debug logging.

10 years agodsync: Added -t <timestamp> parameter to save only mails newer than <timestamp>
Timo Sirainen [Mon, 19 Jan 2015 21:43:37 +0000 (23:43 +0200)] 
dsync: Added -t <timestamp> parameter to save only mails newer than <timestamp>
If one side has old mails that don't exist on the other side, they are
ignored (not synced and not deleted).

10 years agolib-storage: Added mail_parse_human_timestamp() to parse human-writable timestamps.
Timo Sirainen [Mon, 19 Jan 2015 21:40:27 +0000 (23:40 +0200)] 
lib-storage: Added mail_parse_human_timestamp() to parse human-writable timestamps.
This isn't really the ideal location for the function, but since it uses
both lib-settings and lib-imap, there's not any good location for it that I
can think of..

10 years agodoveadm: Added missing error handling to various mail commands.
Timo Sirainen [Mon, 19 Jan 2015 20:24:42 +0000 (22:24 +0200)] 
doveadm: Added missing error handling to various mail commands.
This fixes assert-crash that happened when the commands failed, because they
hadn't set any exit_code.

10 years agolib-storage: Comment updates to mailbox_list_iter_*()
Timo Sirainen [Mon, 19 Jan 2015 20:12:58 +0000 (22:12 +0200)] 
lib-storage: Comment updates to mailbox_list_iter_*()

10 years agodoveadm: If mailbox list iteration fails, log the error reason.
Timo Sirainen [Mon, 19 Jan 2015 20:11:29 +0000 (22:11 +0200)] 
doveadm: If mailbox list iteration fails, log the error reason.

10 years agoimap-urlauth: If mailbox list iteration fails, log the error.
Timo Sirainen [Mon, 19 Jan 2015 20:10:17 +0000 (22:10 +0200)] 
imap-urlauth: If mailbox list iteration fails, log the error.

10 years agovirtual plugin: If mailbox list iteration fails, log the error.
Timo Sirainen [Mon, 19 Jan 2015 20:09:14 +0000 (22:09 +0200)] 
virtual plugin: If mailbox list iteration fails, log the error.

10 years agolib-storage: Removed caching body snippet while message is being saved.
Timo Sirainen [Mon, 19 Jan 2015 19:58:19 +0000 (21:58 +0200)] 
lib-storage: Removed caching body snippet while message is being saved.
This broke saving mails with dbox, because it attempts to open the mails
too early. Also the generation was a bit costly operation to do if it wasn't
actually wanted to be cached.

So in future we'd first want to check if body snippet is actually wanted. If
it is, then generate the potential snippets while the message is being
parsed (always generate the snippet for the best found MIME part, replacing
existing snippets when needed). This requires the message_snippet_generate()
API to support sending input as partial message_blocks.

10 years agolib-storage: MAIL_FETCH_BODY_SNIPPET should seek the mail stream back to original...
Timo Sirainen [Mon, 19 Jan 2015 19:53:00 +0000 (21:53 +0200)] 
lib-storage: MAIL_FETCH_BODY_SNIPPET should seek the mail stream back to original position.

10 years agodbox: Added asserts to make sure the mail body isn't tried to be read too early while...
Timo Sirainen [Mon, 19 Jan 2015 19:52:21 +0000 (21:52 +0200)] 
dbox: Added asserts to make sure the mail body isn't tried to be read too early while saving.
If the mail headers are still being written, the opening will just fail
thinking the mail is corrupted.

10 years agofts: Fixed assert-crash in HTML parsing, broken by the earlier changes.
Timo Sirainen [Mon, 19 Jan 2015 19:11:29 +0000 (21:11 +0200)] 
fts: Fixed assert-crash in HTML parsing, broken by the earlier changes.

10 years agolib: iostream-rawlog now writes to ostreams instead of directly to fds.
Timo Sirainen [Sat, 17 Jan 2015 02:14:58 +0000 (04:14 +0200)] 
lib: iostream-rawlog now writes to ostreams instead of directly to fds.

10 years agolib: Added o_stream_create_passthrough() for creating simple wrapper ostreams
Timo Sirainen [Sat, 17 Jan 2015 02:14:09 +0000 (04:14 +0200)] 
lib: Added o_stream_create_passthrough() for creating simple wrapper ostreams

10 years agolib: Added o_stream_add_destroy_callback()
Timo Sirainen [Sat, 17 Jan 2015 02:13:13 +0000 (04:13 +0200)] 
lib: Added o_stream_add_destroy_callback()

10 years agoauth: Changed passdb { continue-ok } handling for credentials lookups.
Timo Sirainen [Sat, 17 Jan 2015 00:40:11 +0000 (02:40 +0200)] 
auth: Changed passdb { continue-ok } handling for credentials lookups.
If the last passdb after it doesn't return credentials, use the first
passdb's credentials. This allows implementing plugins that modify the
passdb result without actually changing the credentials.

10 years agolib-storage: Added mail_user_init_fs_settings()
Timo Sirainen [Sat, 17 Jan 2015 00:31:24 +0000 (02:31 +0200)] 
lib-storage: Added mail_user_init_fs_settings()
Also changed mailbox_list_init_fs() to use it internally.

10 years agodoveadm user: If username is changed by userdb lookup, return it.
Timo Sirainen [Fri, 16 Jan 2015 23:19:42 +0000 (01:19 +0200)] 
doveadm user: If username is changed by userdb lookup, return it.

10 years agodoveadm fetch: Added body.snippet field.
Timo Sirainen [Fri, 16 Jan 2015 22:32:10 +0000 (00:32 +0200)] 
doveadm fetch: Added body.snippet field.

10 years agolib-storage: Added MAIL_FETCH_BODY_SNIPPET.
Timo Sirainen [Fri, 16 Jan 2015 22:31:35 +0000 (00:31 +0200)] 
lib-storage: Added MAIL_FETCH_BODY_SNIPPET.

10 years agofts: Parse HTML MIME parts using lib-mail's mail-html2text.
Timo Sirainen [Fri, 16 Jan 2015 22:24:36 +0000 (00:24 +0200)] 
fts: Parse HTML MIME parts using lib-mail's mail-html2text.

10 years agolib-mail: Added message_snippet_generate() to produce a short text snippet of a mail.
Timo Sirainen [Fri, 16 Jan 2015 22:23:36 +0000 (00:23 +0200)] 
lib-mail: Added message_snippet_generate() to produce a short text snippet of a mail.

10 years agolib-mail: Added mail-html2text API
Timo Sirainen [Fri, 16 Jan 2015 22:15:44 +0000 (00:15 +0200)] 
lib-mail: Added mail-html2text API
What makes it mail-specific is that it allows skipping over data inside
<blockquote>. This code probably doesn't parse HTML perfectly, but hopefully
good enough for HTML emails.

10 years agolib-mail: Forgot to commit .h file for message_decoder_current_content_type() change.
Timo Sirainen [Wed, 14 Jan 2015 23:26:02 +0000 (01:26 +0200)] 
lib-mail: Forgot to commit .h file for message_decoder_current_content_type() change.

10 years agolib-mail: Added message_decoder_current_content_type()
Timo Sirainen [Wed, 14 Jan 2015 23:22:04 +0000 (01:22 +0200)] 
lib-mail: Added message_decoder_current_content_type()

10 years agolib-mail: message-decoder now always sets output->size=0 when headers are returned.
Timo Sirainen [Wed, 14 Jan 2015 23:11:34 +0000 (01:11 +0200)] 
lib-mail: message-decoder now always sets output->size=0 when headers are returned.

10 years agolib-mail: Fixed crash in message-decoder with unknown charsets.
Timo Sirainen [Wed, 14 Jan 2015 23:10:11 +0000 (01:10 +0200)] 
lib-mail: Fixed crash in message-decoder with unknown charsets.
Caused by earlier changes.

10 years agolib-mail: Replaced MAX_TRANSLATION_BUF_SIZE with the new CHARSET_MAX_PENDING_BUF_SIZE
Timo Sirainen [Wed, 14 Jan 2015 23:08:00 +0000 (01:08 +0200)] 
lib-mail: Replaced MAX_TRANSLATION_BUF_SIZE with the new CHARSET_MAX_PENDING_BUF_SIZE

10 years agolib-charset: Added CHARSET_MAX_PENDING_BUF_SIZE macro and asserts for it.
Timo Sirainen [Wed, 14 Jan 2015 23:05:36 +0000 (01:05 +0200)] 
lib-charset: Added CHARSET_MAX_PENDING_BUF_SIZE macro and asserts for it.

10 years agolib-charset: Added charset_utf8_to_utf8_begin() wrapper function.
Timo Sirainen [Wed, 14 Jan 2015 23:05:13 +0000 (01:05 +0200)] 
lib-charset: Added charset_utf8_to_utf8_begin() wrapper function.
It's never supposed to fail, so it makes it nicer for the callers who need
to use it.

10 years agolib: Fixed NUL-handling in uni_utf8_*strlen*()
Timo Sirainen [Wed, 14 Jan 2015 23:03:58 +0000 (01:03 +0200)] 
lib: Fixed NUL-handling in uni_utf8_*strlen*()
uni_utf8_strlen() could have skipped over the ending NUL byte and caused
read buffer overflows with invalid input.

uni_utf8_strlen_n() and uni_utf8_partial_strlen_n() now allow NUL bytes in
the input and they're treated as regular control characters. Previously the
size was actually treated as max_size with early NUL byte termination.
Technically this is an API change, but I'm not aware of anything using these
functions in an incompatible way.

10 years agolib-storage: Added "oldestonly" search arg to stop searching after the first non...
Timo Sirainen [Wed, 14 Jan 2015 22:10:56 +0000 (00:10 +0200)] 
lib-storage: Added "oldestonly" search arg to stop searching after the first non-match.
This parameter works only for doveadm search queries. It's not fully exact
currently, because if mailbox.search_next_update_seq() skips over
non-matching messages we don't stop if the next message matches. So this
parameter is mainly useful for optimization of commands like:

doveadm expunge -u user@domain mailbox inbox savedsince 30d oldestonly

Where the timestamps should be ascending all the time anyway and there's no
point in continuing to search for more mails after the first timestamp is
too high.

10 years agolib-mail: message-decoder no longer skips lib-charset for UTF8 -> UTF8 translations.
Timo Sirainen [Sat, 10 Jan 2015 02:32:42 +0000 (04:32 +0200)] 
lib-mail: message-decoder no longer skips lib-charset for UTF8 -> UTF8 translations.
With the previous lib-charset fix this makes message-decoder handle partial
UTF-8 text in input blocks correctly.

10 years agolib: Added uni_utf8_partial_strlen_n()
Timo Sirainen [Sat, 10 Jan 2015 02:30:40 +0000 (04:30 +0200)] 
lib: Added uni_utf8_partial_strlen_n()

10 years agolib-charset: UTF-8 -> UTF-8 translation was never returning CHARSET_RET_INCOMPLETE_INPUT
Timo Sirainen [Sat, 10 Jan 2015 02:25:21 +0000 (04:25 +0200)] 
lib-charset: UTF-8 -> UTF-8 translation was never returning CHARSET_RET_INCOMPLETE_INPUT
Instead the incomplete input was just being modified into broken output.

10 years agolib-imap-client: Compiler warning fixes
Timo Sirainen [Thu, 8 Jan 2015 21:07:54 +0000 (23:07 +0200)] 
lib-imap-client: Compiler warning fixes

10 years agoimapc: Added imapc_sasl_mechanisms setting
Timo Sirainen [Thu, 8 Jan 2015 20:52:11 +0000 (22:52 +0200)] 
imapc: Added imapc_sasl_mechanisms setting
The first supported SASL mechanism is used, otherwise the login fails
entirely.

10 years agolib-imap-client: Use lib-sasl to perform the AUTHENTICATE command handling.
Timo Sirainen [Thu, 8 Jan 2015 20:32:20 +0000 (22:32 +0200)] 
lib-imap-client: Use lib-sasl to perform the AUTHENTICATE command handling.

10 years agolib: Defined array type for guid_128_t
Timo Sirainen [Tue, 6 Jan 2015 22:37:50 +0000 (00:37 +0200)] 
lib: Defined array type for guid_128_t

10 years agolib: Remove OpenBSD workaround in i_getpw*()
Timo Sirainen [Tue, 6 Jan 2015 01:15:11 +0000 (03:15 +0200)] 
lib: Remove OpenBSD workaround in i_getpw*()
Originally added in 801714cba91b. It was requested to be removed now that 1)
it's fixed in OpenBSD v5.6+ and 2) The workaround caused nonexistent users
to not work correctly (process running out of memory I guess?)

10 years agofts: Correct returned value to match type signature.
Teemu Huovila [Mon, 5 Jan 2015 13:48:55 +0000 (15:48 +0200)] 
fts: Correct returned value to match type signature.

10 years agoglobal: freshen copyright
Phil Carmody [Mon, 5 Jan 2015 20:20:10 +0000 (22:20 +0200)] 
global: freshen copyright
Robomatically:
  git ls-files | xargs perl -p -i -e 's/(\d+)-201[0-4]/$1-2015/g;s/ (201[0-4]) Dovecot/ $1-2015 Dovecot/'

Happy 2015 everyone!

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: guid - centralise a 'reset to the empty value' helper function
Phil Carmody [Mon, 5 Jan 2015 20:16:59 +0000 (22:16 +0200)] 
lib: guid - centralise a 'reset to the empty value' helper function
This helper just ensures that the caller never has to get the sizeof()
right. (Were a guid passed as a function parameter, mistakes could happen.)

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: guid - declare some functions as pure
Phil Carmody [Mon, 5 Jan 2015 20:15:31 +0000 (22:15 +0200)] 
lib: guid - declare some functions as pure
As the functions aren't inline, the compiler can't know if they
can be optimised away, so give it a helping hand.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: array - explain implications of ARRAY_TYPE() in comment
Phil Carmody [Mon, 5 Jan 2015 20:15:07 +0000 (22:15 +0200)] 
lib: array - explain implications of ARRAY_TYPE() in comment
If you use ARRAY_TYPE() to pass an array around, then you must also
use ARRAY_TYPE() to define the array itself, ARRAY() will no longer do.

Reported-by: Arnt Gulbrandsen <arnt@gulbrandsen.priv.no>
Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: test-array - test new lsearch helper
Phil Carmody [Mon, 5 Jan 2015 20:13:59 +0000 (22:13 +0200)] 
lib: test-array - test new lsearch helper
Just piggy-back on to the current reverse test, as that's got an array
nicely set up for us already.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agolib: array - new linear search helper
Phil Carmody [Mon, 5 Jan 2015 20:12:48 +0000 (22:12 +0200)] 
lib: array - new linear search helper
There are large numbers of array_foreach loops which do nothing but search
for the first element which matches some key. This can be abstracted out
into a helper.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agoconfigure: Don't break when using --without-shared-libs and CC with '/' chars.
Timo Sirainen [Fri, 26 Dec 2014 15:28:30 +0000 (17:28 +0200)] 
configure: Don't break when using --without-shared-libs and CC with '/' chars.

10 years agoauth: Don't crash if master user login is attempted without master=yes passdbs
Timo Sirainen [Wed, 17 Dec 2014 13:43:30 +0000 (14:43 +0100)] 
auth: Don't crash if master user login is attempted without master=yes passdbs

10 years agolib: Small optimization / unnecessary code removal from array_*() functions.
Timo Sirainen [Wed, 17 Dec 2014 12:39:57 +0000 (13:39 +0100)] 
lib: Small optimization / unnecessary code removal from array_*() functions.

10 years agolib-storage: Mail prefetching was still not working right.
Timo Sirainen [Fri, 5 Dec 2014 03:50:19 +0000 (05:50 +0200)] 
lib-storage: Mail prefetching was still not working right.
I wonder if it ever actually worked (except for SEARCH TEXT).

10 years agodoveadm: Avoid calling init() in doveadm binary if the command is sent to doveadm...
Timo Sirainen [Fri, 5 Dec 2014 02:39:11 +0000 (04:39 +0200)] 
doveadm: Avoid calling init() in doveadm binary if the command is sent to doveadm-server.
The init() is still always called when -A or -u *wildcards* are used though.
I'm not sure if that can be delayed. At least all commands should be
verified that they don't rely on the current init() location.

10 years agodoveadm: Support changing proxy destination username with "user" and "destuser" passd...
Timo Sirainen [Fri, 5 Dec 2014 01:53:02 +0000 (03:53 +0200)] 
doveadm: Support changing proxy destination username with "user" and "destuser" passdb field.

10 years agoauth: Don't allow changing username to an empty string.
Timo Sirainen [Fri, 5 Dec 2014 01:38:08 +0000 (03:38 +0200)] 
auth: Don't allow changing username to an empty string.
This is most likely always accidental and Dovecot in general hasn't been
designed to support empty usernames.

10 years agofts: Install some of the header files that other external plugins might want to use.
Timo Sirainen [Fri, 5 Dec 2014 01:11:14 +0000 (03:11 +0200)] 
fts: Install some of the header files that other external plugins might want to use.

10 years agofts: Compiler warning fix when using fts-indexer.h directly
Timo Sirainen [Fri, 5 Dec 2014 01:10:32 +0000 (03:10 +0200)] 
fts: Compiler warning fix when using fts-indexer.h directly

10 years agodict-redis: Use timeout_msecs parameter also for transaction commit waits.
Timo Sirainen [Tue, 2 Dec 2014 08:29:13 +0000 (00:29 -0800)] 
dict-redis: Use timeout_msecs parameter also for transaction commit waits.