]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
10 years agoLink all libstorage.la dependencies into the library itself instead.
Timo Sirainen [Fri, 13 Feb 2015 14:38:35 +0000 (16:38 +0200)] 
Link all libstorage.la dependencies into the library itself instead.
Instead of keeping a lot of different libraries in LIBDOVECOT_STORAGE, which
have circular dependencies and may cause linking issues.

10 years agodovecot-config: Added DOVECOT_INSTALLED parameter.
Timo Sirainen [Fri, 13 Feb 2015 12:35:54 +0000 (14:35 +0200)] 
dovecot-config: Added DOVECOT_INSTALLED parameter.
Also added dovecot_installed_moduledir to dovecot.m4

These can be used by external plugins to access some headers and libraries
that don't already have existing DOVECOT_* parameters in dovecot-config.

10 years agodovecot-config: Added LIBDOVECOT_NOTIFY_INCLUDE
Timo Sirainen [Thu, 12 Feb 2015 12:38:18 +0000 (14:38 +0200)] 
dovecot-config: Added LIBDOVECOT_NOTIFY_INCLUDE

10 years agodovecot-config: Added lib-storage/index/imapc also to LIBDOVECOT_IMAPC_INCLUDE
Timo Sirainen [Thu, 12 Feb 2015 11:29:23 +0000 (13:29 +0200)] 
dovecot-config: Added lib-storage/index/imapc also to LIBDOVECOT_IMAPC_INCLUDE

10 years agodovecot-config: Added LIBDOVECOT_IMAPC_INCLUDE and LIBDOVECOT_FTS_INCLUDE
Timo Sirainen [Thu, 12 Feb 2015 10:42:39 +0000 (12:42 +0200)] 
dovecot-config: Added LIBDOVECOT_IMAPC_INCLUDE and LIBDOVECOT_FTS_INCLUDE

10 years agofts: Fixed memory leak in HTML parsing
Timo Sirainen [Thu, 12 Feb 2015 08:49:28 +0000 (10:49 +0200)] 
fts: Fixed memory leak in HTML parsing

10 years agofts: Fixed error printing if fts wasn't enabled for user's default namespace.
Timo Sirainen [Wed, 11 Feb 2015 09:56:59 +0000 (11:56 +0200)] 
fts: Fixed error printing if fts wasn't enabled for user's default namespace.

10 years agodovecot-config: Added lib-sasl path into LIBDOVECOT_INCLUDE.
Timo Sirainen [Tue, 10 Feb 2015 15:29:31 +0000 (17:29 +0200)] 
dovecot-config: Added lib-sasl path into LIBDOVECOT_INCLUDE.

10 years agodovecot.m4: External plugins can now more easily run their tests via Valgrind.
Timo Sirainen [Tue, 10 Feb 2015 11:12:42 +0000 (13:12 +0200)] 
dovecot.m4: External plugins can now more easily run their tests via Valgrind.
DC_DOVECOT macro automatically adds RUN_TEST variable to Makefiles, which
can be used to call any test programs. If valgrind exists, the tests are run
through it. This is done by writing run-test.sh to the build directory, so
the original run-test.sh in hg is no longer needed.

10 years agolib: istream create helpers for common cases
Phil Carmody [Tue, 10 Feb 2015 10:31:12 +0000 (12:31 +0200)] 
lib: istream create helpers for common cases
Several clients want to create streams from buffer_t and
string_t, we may as well make it easy for them

Signed-off-by: Phil Carmody <phil@dovecot.fi>
10 years agodsync: Don't try to rename namespace prefixes.
Timo Sirainen [Mon, 9 Feb 2015 19:58:13 +0000 (21:58 +0200)] 
dsync: Don't try to rename namespace prefixes.

10 years agodsync: Fixed assert-crash when the two mailbox trees differed only by their directory...
Timo Sirainen [Mon, 9 Feb 2015 19:45:04 +0000 (21:45 +0200)] 
dsync: Fixed assert-crash when the two mailbox trees differed only by their directory names.

10 years agodoveadm copy/move/import: Delay initializing source user until run()
Timo Sirainen [Mon, 9 Feb 2015 13:38:42 +0000 (15:38 +0200)] 
doveadm copy/move/import: Delay initializing source user until run()
This fixes using them with doveadm proxying.

10 years agodoveadm: Added comments to struct doveadm_mail_cmd_vfuncs
Timo Sirainen [Mon, 9 Feb 2015 13:21:55 +0000 (15:21 +0200)] 
doveadm: Added comments to struct doveadm_mail_cmd_vfuncs

10 years agodoveadm: Reverted changeset 3b89f2f4ffb3, which avoided calling init() for proxied...
Timo Sirainen [Mon, 9 Feb 2015 11:03:47 +0000 (13:03 +0200)] 
doveadm: Reverted changeset 3b89f2f4ffb3, which avoided calling init() for proxied commands.
The init() is required for all commands that print something, because
otherwise the doveadm_print_header*() isn't called and the commands crash.

The reason for the original change was that some commands' init() attempted
to do too much work on the proxy, which ended up failing. So looks like the
proper fix is to just remove this kind of extra work from init().

10 years agolog: If too much logging data is sent, show it in process title.
Timo Sirainen [Mon, 9 Feb 2015 02:03:12 +0000 (04:03 +0200)] 
log: If too much logging data is sent, show it in process title.

10 years agolog: Log a warning if some connection is logging faster than we can write.
Timo Sirainen [Sat, 7 Feb 2015 16:39:05 +0000 (18:39 +0200)] 
log: Log a warning if some connection is logging faster than we can write.

10 years agolog: Don't spend more than 100 msecs at a time logging one connection.
Timo Sirainen [Sat, 7 Feb 2015 16:23:58 +0000 (18:23 +0200)] 
log: Don't spend more than 100 msecs at a time logging one connection.

10 years agolog: Small cleanup: Include log connection prefix when logging read() errors.
Timo Sirainen [Sat, 7 Feb 2015 16:17:59 +0000 (18:17 +0200)] 
log: Small cleanup: Include log connection prefix when logging read() errors.

10 years agolog: Minor cleanup: Update ioloop_timeval whenever reading input from log client.
Timo Sirainen [Sat, 7 Feb 2015 16:14:53 +0000 (18:14 +0200)] 
log: Minor cleanup: Update ioloop_timeval whenever reading input from log client.

10 years agolib: Accidentally committed a nonexistent function call in previous commit.
Timo Sirainen [Fri, 6 Feb 2015 17:03:20 +0000 (19:03 +0200)] 
lib: Accidentally committed a nonexistent function call in previous commit.

10 years agolib-storage: Use module_dir_try_load_missing() to load user plugins.
Timo Sirainen [Fri, 6 Feb 2015 16:18:19 +0000 (18:18 +0200)] 
lib-storage: Use module_dir_try_load_missing() to load user plugins.

10 years agolib: Added module_dir_try_load_missing() that returns error instead of logging it.
Timo Sirainen [Fri, 6 Feb 2015 16:18:10 +0000 (18:18 +0200)] 
lib: Added module_dir_try_load_missing() that returns error instead of logging it.
Also module_names now can be given for it without i_fatal() being called.

10 years agolib-storage: Previous log prefix changing code started accessing freed memory.
Timo Sirainen [Fri, 6 Feb 2015 16:17:10 +0000 (18:17 +0200)] 
lib-storage: Previous log prefix changing code started accessing freed memory.

10 years agolib-storage: Set the user log prefix earlier when initializing user.
Timo Sirainen [Fri, 6 Feb 2015 15:06:36 +0000 (17:06 +0200)] 
lib-storage: Set the user log prefix earlier when initializing user.
So the full prefix with session and other useful information is included in
the log message as early as possible. Some fatal/panic errors wouldn't even
have shown the username.

10 years agolib: Added i_get_failure_prefix()
Timo Sirainen [Fri, 6 Feb 2015 15:04:52 +0000 (17:04 +0200)] 
lib: Added i_get_failure_prefix()

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.