]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
8 years agolib-imap: imap-bodystructure: Renamed imap_bodystructure_is_plain_7bit() to message_p...
Stephan Bosch [Sun, 23 Oct 2016 17:47:12 +0000 (19:47 +0200)] 
lib-imap: imap-bodystructure: Renamed imap_bodystructure_is_plain_7bit() to message_part_data_is_plain_7bit().

8 years agolib-imap: imap-envelope: Renamed imap_envelope_parse_header() to message_part_envelop...
Stephan Bosch [Sun, 23 Oct 2016 17:00:10 +0000 (19:00 +0200)] 
lib-imap: imap-envelope: Renamed imap_envelope_parse_header() to message_part_envelope_parse_from_header().

8 years agolib-imap: imap-evenvelope: Changed imap_envelope_get_field() into a private equivalent.
Stephan Bosch [Sun, 23 Oct 2016 16:10:01 +0000 (18:10 +0200)] 
lib-imap: imap-evenvelope: Changed imap_envelope_get_field() into a private equivalent.

8 years agolib-imap: imap-bodystructure: Renamed imap_bodystructure_parse_header() to message_pa...
Stephan Bosch [Sun, 23 Oct 2016 15:51:59 +0000 (17:51 +0200)] 
lib-imap: imap-bodystructure: Renamed imap_bodystructure_parse_header() to message_part_data_parse_from_header().

8 years agolib-imap: imap-bodystructure: Grouped together functions relating to the conversion...
Stephan Bosch [Sun, 23 Oct 2016 15:27:07 +0000 (17:27 +0200)] 
lib-imap: imap-bodystructure: Grouped together functions relating to the conversion of BODYSTRUCTURE to BODY.

This only moves code.

8 years agolib-imap: imap-bodystructure: Changed struct message_part_body to contain fully decod...
Stephan Bosch [Sun, 23 Oct 2016 14:50:25 +0000 (16:50 +0200)] 
lib-imap: imap-bodystructure: Changed struct message_part_body to contain fully decoded data.

Contained unparsed IMAP string data before.

8 years agolib-imap: imap-envelope: Added function to parse struct message_part_envelope_data...
Stephan Bosch [Sun, 23 Oct 2016 14:49:37 +0000 (16:49 +0200)] 
lib-imap: imap-envelope: Added function to parse struct message_part_envelope_data from parsed imap args.

8 years agolib-imap: imap-bodystructure: Renamed `d' parameter to `data' in parse_content_header...
Stephan Bosch [Sun, 23 Oct 2016 12:06:44 +0000 (14:06 +0200)] 
lib-imap: imap-bodystructure: Renamed `d' parameter to `data' in parse_content_header() function.

8 years agolib-imap: imap-envelope: Removed useless pool field from struct message_part_envelope...
Stephan Bosch [Sun, 23 Oct 2016 11:52:10 +0000 (13:52 +0200)] 
lib-imap: imap-envelope: Removed useless pool field from struct message_part_envelope_data.

8 years agolib-imap: imap-bodystructure: Removed useless pool field from struct message_part_data.
Stephan Bosch [Sun, 23 Oct 2016 11:50:05 +0000 (13:50 +0200)] 
lib-imap: imap-bodystructure: Removed useless pool field from struct message_part_data.

8 years agolib-mail: Gave message_part_data its own field in struct message_part.
Stephan Bosch [Sun, 23 Oct 2016 11:29:43 +0000 (13:29 +0200)] 
lib-mail: Gave message_part_data its own field in struct message_part.

8 years agolib-imap: imap-bodystructure: Renamed struct message_part_body_data to message_part_data.
Stephan Bosch [Sun, 23 Oct 2016 11:10:11 +0000 (13:10 +0200)] 
lib-imap: imap-bodystructure: Renamed struct message_part_body_data to message_part_data.

8 years agolib-imap: Removed existing envelope parsing function.
Stephan Bosch [Sun, 23 Oct 2016 10:10:44 +0000 (12:10 +0200)] 
lib-imap: Removed existing envelope parsing function.

This is currently only used by imaptest. Alternative API is provided in later commit.

8 years agolib-imap: test-imap-bodystructure: Added normalization tests.
Stephan Bosch [Sun, 8 Jan 2017 11:00:15 +0000 (12:00 +0100)] 
lib-imap: test-imap-bodystructure: Added normalization tests.

8 years agolib-imap: imap-bodystructure: Allow alternative syntax and omitted optional elements...
Stephan Bosch [Mon, 9 Jan 2017 01:03:25 +0000 (02:03 +0100)] 
lib-imap: imap-bodystructure: Allow alternative syntax and omitted optional elements in parser input.

This makes the parser accept any RFC-compliant BODYSTRUCTURE syntax, instead of only what Dovecot itself produces.
This way the parser could reliably be used in the lib-imap-client if ever needed.

8 years agolib-imap: test-imap-bodystructure: Added more tests.
Stephan Bosch [Mon, 9 Jan 2017 15:29:26 +0000 (16:29 +0100)] 
lib-imap: test-imap-bodystructure: Added more tests.

8 years agolib-imap: test-imap-bodystructure: Improved handing of parse errors.
Stephan Bosch [Mon, 9 Jan 2017 15:20:29 +0000 (16:20 +0100)] 
lib-imap: test-imap-bodystructure: Improved handing of parse errors.

Actually show the parse error.

8 years agolib-imap: test-imap-bodystructure: Added support for more than one test case.
Stephan Bosch [Mon, 9 Jan 2017 15:16:46 +0000 (16:16 +0100)] 
lib-imap: test-imap-bodystructure: Added support for more than one test case.

8 years agolib-imap: imap-bodystructure: Fixed parse error message about invalid Content-M5...
Stephan Bosch [Sun, 8 Jan 2017 21:50:02 +0000 (22:50 +0100)] 
lib-imap: imap-bodystructure: Fixed parse error message about invalid Content-M5 field.

8 years agoexample-config: Add mail_sort_max_read_count setting.
Timo Sirainen [Sun, 19 Feb 2017 23:24:09 +0000 (01:24 +0200)] 
example-config: Add mail_sort_max_read_count setting.

8 years agoexample-config: Add mail_vsize_bg_after_count setting.
Timo Sirainen [Sun, 19 Feb 2017 23:16:56 +0000 (01:16 +0200)] 
example-config: Add mail_vsize_bg_after_count setting.

8 years agoexample-config: Add imap_fetch_failure setting.
Timo Sirainen [Sun, 19 Feb 2017 23:00:05 +0000 (01:00 +0200)] 
example-config: Add imap_fetch_failure setting.

8 years agolib-mail: Fix matched-parameter in HEADER_FILTER_ADD_MISSING_EOH callback
Timo Sirainen [Sun, 19 Feb 2017 22:26:28 +0000 (00:26 +0200)] 
lib-mail: Fix matched-parameter in HEADER_FILTER_ADD_MISSING_EOH callback

The matched-parameter in the regular EOH callback is the reverse of what
it's in v2.3 tree. So preserve it here.

8 years ago.gitignore: Fixed location of ignored m4 files.
Stephan Bosch [Sun, 19 Feb 2017 22:03:40 +0000 (23:03 +0100)] 
.gitignore: Fixed location of ignored m4 files.

Probably got cherry-picked wrong from development branch.

8 years agolib-http: test-http-response-parse: Properly test multiple sequential responses.
Stephan Bosch [Sat, 4 Feb 2017 15:15:57 +0000 (16:15 +0100)] 
lib-http: test-http-response-parse: Properly test multiple sequential responses.

8 years agoauth: oauth2 mechanism: Fixed implicit boolean expression involving a pointer.
Stephan Bosch [Sun, 19 Feb 2017 20:58:54 +0000 (21:58 +0100)] 
auth: oauth2 mechanism: Fixed implicit boolean expression involving a pointer.

Found with Clang -Wstrict-bool.

8 years agolib-storage: Add explicit MAIL_ERROR_LOOKUP_ABORT error
Timo Sirainen [Sat, 18 Feb 2017 03:01:50 +0000 (05:01 +0200)] 
lib-storage: Add explicit MAIL_ERROR_LOOKUP_ABORT error

The MAIL_ERROR_NOTPOSSIBLE was a bit too generic to assume to mean the same
thing. It doesn't look like there are any external plugins that break
because of this change.

8 years agolib-storage: Add mail.access_type
Timo Sirainen [Fri, 17 Feb 2017 17:29:03 +0000 (19:29 +0200)] 
lib-storage: Add mail.access_type

8 years agolib-storage: Add mail_sort_max_read_count setting.
Timo Sirainen [Fri, 17 Feb 2017 17:07:53 +0000 (19:07 +0200)] 
lib-storage: Add mail_sort_max_read_count setting.

This controls how many slow mail accesses sorting can perform before it
fails:

a NO [LIMIT] Requested sort would have taken too long

The SORT reply is still returned, but it's likely not correct.

8 years agolib-storage: Add MAIL_ERROR_LIMIT
Timo Sirainen [Fri, 17 Feb 2017 16:56:23 +0000 (18:56 +0200)] 
lib-storage: Add MAIL_ERROR_LIMIT

8 years agoimap: If SEARCH/SORT fails but returns some results, send them to client.
Timo Sirainen [Fri, 17 Feb 2017 16:32:05 +0000 (18:32 +0200)] 
imap: If SEARCH/SORT fails but returns some results, send them to client.

The previous error handling fixes cause SEARCH/SORT to now fail if there
are any problems reading mails. This change makes the commands still
return the best known results, so the IMAP client can still use them,
even though they may not be entirely correct.

8 years agolib-storage: Fix error handling when searching mails
Timo Sirainen [Fri, 17 Feb 2017 16:30:51 +0000 (18:30 +0200)] 
lib-storage: Fix error handling when searching mails

Only expunge errors and failures caused by lookup_abort should be ignored.
The rest of the mail errors mean that the search result might not be
correct. We'll still run the search as fully as possible, but we just
return an error at the end.

8 years agolib-storage: Search optimization - avoid parsing message_parts unnecessarily
Timo Sirainen [Fri, 17 Feb 2017 16:24:31 +0000 (18:24 +0200)] 
lib-storage: Search optimization - avoid parsing message_parts unnecessarily

If they're not already cached, the mail is parsed twice: once to get the
message_parts and again to perform the actual search. The searching can
however do the message_parts parsing internally as well.

8 years agolib-storage: Fix error handling when sorting mails.
Timo Sirainen [Fri, 17 Feb 2017 16:19:46 +0000 (18:19 +0200)] 
lib-storage: Fix error handling when sorting mails.

All errors were treated the same as if message had been expunged. This
caused potentially wrong results to be sent to the client without any
indication that they're wrong.

8 years agolib-storage: Change vsize calculation to use the new mail_stream_opened
Timo Sirainen [Fri, 17 Feb 2017 14:31:52 +0000 (16:31 +0200)] 
lib-storage: Change vsize calculation to use the new mail_stream_opened

This avoids calling mail_get_virtual_size() twice and is a bit cleaner
approach.

8 years agolib-storage: Add mail.mail_stream_opened and .mail_metadata_accessed
Timo Sirainen [Fri, 17 Feb 2017 14:20:06 +0000 (16:20 +0200)] 
lib-storage: Add mail.mail_stream_opened and .mail_metadata_accessed

These allow determining after mail_*() calls how efficiently they were
performed.

8 years agolib-storage: Clarify what MAIL_LOOKUP_ABORT_READ_MAIL means.
Timo Sirainen [Fri, 17 Feb 2017 14:14:39 +0000 (16:14 +0200)] 
lib-storage: Clarify what MAIL_LOOKUP_ABORT_READ_MAIL means.

It should maybe even be renamed to something clearer.

8 years agodsync: Don't assert-crash if duplicate attributes are seen
Timo Sirainen [Sat, 18 Feb 2017 23:44:21 +0000 (01:44 +0200)] 
dsync: Don't assert-crash if duplicate attributes are seen

Just ignore the duplicates. Normally this shouldn't happen, but due to
some bugs for example a Sieve script could be returned once by doveadm_sieve
plugin and another time from mail_attribute_dict.

8 years agoimap: Fix running time in tagged command replies.
Timo Sirainen [Sun, 19 Feb 2017 13:47:48 +0000 (15:47 +0200)] 
imap: Fix running time in tagged command replies.

The timing information was updated only after command_exec() returned.
Most of the commands were handled within a single command_exec() though,
so at the time when tagline was sent the running_usecs was still zero.

The msecs in ioloop timing was correct though, because it relied only on
the command start timing info.

8 years agodoveadm: Add explicit mail_storage_init/deinit() calls
Timo Sirainen [Sun, 19 Feb 2017 00:03:08 +0000 (02:03 +0200)] 
doveadm: Add explicit mail_storage_init/deinit() calls

This mainly prevents losing hooks that were registered by doveadm plugins.

Otherwise what happens is:
 - mail_plugins are unloaded and they unregister their hooks
 - doveadm plugins (e.g. doveadm_sieve) are NOT unloaded
 - mail_storage_deinit() frees all the registered hooks
 - next mail_storage_init() initializes all new hooks
 - All mail_plugins are loaded and they register again their hooks
 - doveadm plugins are NOT re-loaded or re-initialized, so their existing
hooks were lost.

8 years agolib-storage: mail_storage_init/deinit() is now reference counted.
Timo Sirainen [Sun, 19 Feb 2017 00:02:20 +0000 (02:02 +0200)] 
lib-storage: mail_storage_init/deinit() is now reference counted.

This allows calling them multiple times and only the final deinit frees the
data.

8 years agolib-storage: Assert-crash if duplicate internal hooks are added.
Timo Sirainen [Sun, 19 Feb 2017 00:01:24 +0000 (02:01 +0200)] 
lib-storage: Assert-crash if duplicate internal hooks are added.

8 years agofs-posix: Add "no-fsync" parameter.
Timo Sirainen [Sun, 19 Feb 2017 13:54:53 +0000 (15:54 +0200)] 
fs-posix: Add "no-fsync" parameter.

This disables calling fdatasync() when fs_write() was done with
FS_OPEN_FLAG_FSYNC. Useful for making tests faster.

8 years agoimap: Code cleanup - Remove duplicate flags from imap_fetch_state
Timo Sirainen [Sun, 19 Feb 2017 12:49:20 +0000 (14:49 +0200)] 
imap: Code cleanup - Remove duplicate flags from imap_fetch_state

All the cur_flushed, line_partial and line_finished were about the same
thing.

8 years agoimap: Fix sending UID only when necessary on broken FETCHes.
Timo Sirainen [Sun, 19 Feb 2017 12:34:45 +0000 (14:34 +0200)] 
imap: Fix sending UID only when necessary on broken FETCHes.

b748f91d0677fffaa2208b39ebb6db3aeb2e937b changed UID to be sent for most
FETCH replies. There was also some existing code that attempted to do this,
but didn't fully work.

So now:

1) If there are no non-buffered replies, the entire FETCH response isn't
sent.

2) If the buffer was already flushed and nothing else was sent, add UID to
reply. The code paths for handling this are differently for
imap_fetch_failure = disconnect-immediately vs others (depending on
imap_fetch_cur_failed() return value).

8 years agoimap: Include info about last command in disconnection log line.
Timo Sirainen [Thu, 16 Feb 2017 18:39:12 +0000 (20:39 +0200)] 
imap: Include info about last command in disconnection log line.

Only if LOGOUT isn't sent, because that's already visible.

8 years agoimap: Code cleanup - Move code to client_command_stats_append()
Timo Sirainen [Thu, 16 Feb 2017 18:29:46 +0000 (20:29 +0200)] 
imap: Code cleanup - Move code to client_command_stats_append()

8 years agoimap: Add imap_client.logged_out at LOGOUT
Timo Sirainen [Thu, 16 Feb 2017 18:17:32 +0000 (20:17 +0200)] 
imap: Add imap_client.logged_out at LOGOUT

This is useful for determining if client did a clean logout

8 years agoimap: Code cleanup - move command stats to struct client_command_stats
Timo Sirainen [Thu, 16 Feb 2017 18:14:55 +0000 (20:14 +0200)] 
imap: Code cleanup - move command stats to struct client_command_stats

8 years agomech-oauth2: Clarify logging
Aki Tuomi [Fri, 17 Feb 2017 13:46:38 +0000 (15:46 +0200)] 
mech-oauth2: Clarify logging

8 years agomech-oauth2: Set user_given=TRUE when username given in OAUTHBEARER
Aki Tuomi [Fri, 17 Feb 2017 13:45:34 +0000 (15:45 +0200)] 
mech-oauth2: Set user_given=TRUE when username given in OAUTHBEARER

8 years agomech-oauth2: Fix gs2-header parsing
Aki Tuomi [Fri, 17 Feb 2017 13:44:17 +0000 (15:44 +0200)] 
mech-oauth2: Fix gs2-header parsing

8 years agolib: Fix assert-crash in unit test.
Timo Sirainen [Sat, 18 Feb 2017 22:36:39 +0000 (00:36 +0200)] 
lib: Fix assert-crash in unit test.

Messed up merging.

8 years agoauth: Add oauth2 passdb
Aki Tuomi [Mon, 13 Feb 2017 13:33:21 +0000 (15:33 +0200)] 
auth: Add oauth2 passdb

8 years agoauth: Add xoauth2 and oauthbearer mechanisms
Aki Tuomi [Sat, 4 Feb 2017 21:56:04 +0000 (23:56 +0200)] 
auth: Add xoauth2 and oauthbearer mechanisms

8 years agoauth: Add mechanism filter for passdbs
Aki Tuomi [Mon, 6 Feb 2017 10:56:27 +0000 (12:56 +0200)] 
auth: Add mechanism filter for passdbs

8 years agoauth: Add accessor for passdb template arguments
Aki Tuomi [Wed, 8 Feb 2017 11:06:13 +0000 (13:06 +0200)] 
auth: Add accessor for passdb template arguments

8 years agolib-oauth2: Add support library for OAUTH2
Aki Tuomi [Thu, 26 Jan 2017 08:49:08 +0000 (10:49 +0200)] 
lib-oauth2: Add support library for OAUTH2

8 years agolib-storage: Update vsize header after sync only if sizes are cached.
Timo Sirainen [Tue, 14 Feb 2017 16:48:51 +0000 (18:48 +0200)] 
lib-storage: Update vsize header after sync only if sizes are cached.

The result isn't needed yet in that case, so if it's slow to get the sizes
it might as well be delayd until later. This is especially useful when
indexer-worker triggers FTS indexing. The vsizes can be added to index
after the mail is already read for FTS. Without this change the vsize
update would first open all the mails and then the FTS indexing would
open all the mails a second time.

8 years agolib-storage: Add mail_vsize_bg_after_count setting.
Timo Sirainen [Tue, 7 Feb 2017 14:18:55 +0000 (16:18 +0200)] 
lib-storage: Add mail_vsize_bg_after_count setting.

If folder vsize calculation requires opening more than this many mails from
disk (i.e. mail sizes aren't in cache already), return failure and finish
the calculation via indexer process.

This should be used like:

protocol !indexer-worker {
  mail_vsize_bg_after_count = 10
}

8 years agolib-storage: Don't stop vsize calculation on expunged mails.
Timo Sirainen [Tue, 7 Feb 2017 11:53:52 +0000 (13:53 +0200)] 
lib-storage: Don't stop vsize calculation on expunged mails.

I don't know why I added such logic there in the first place. If we just
skip the expunged mails, the end result should still be correct and
usable when cached.

8 years agolib-index: Fix updating mail_index_header.day_first_uid
Timo Sirainen [Wed, 15 Feb 2017 20:13:12 +0000 (22:13 +0200)] 
lib-index: Fix updating mail_index_header.day_first_uid

If user received a mail every day, the day_first_uid wasn't being updated.
This caused wrong caching decisions to be made in dovecot.index.cache:

 - Accessing >1 week old emails should have changed caching decision from
"tmp" to "yes". This might not have happened, although as long as
day_first_uid[7] pointed to an existing mail and email client accessed
all the mails, this wouldn't have changed anything.

 - Cache compression is supposed to drop >1 week old mails when caching
decision is "tmp". Not enough mails were being dropped because
day_first_uid[7] pointed to a much older than 1 week old mails.

Also added a unit test to make sure this works.

Broken by d9ee2f9fb3ef7b9391bfeeff1b374aead51667aa

8 years agolib-index: Add day_stamp parameter to mail_index_update_day_headers()
Timo Sirainen [Wed, 15 Feb 2017 20:12:15 +0000 (22:12 +0200)] 
lib-index: Add day_stamp parameter to mail_index_update_day_headers()

This will help creating a unit test.

8 years agolib-storage: Re-open mailbox after it's undeleted.
Timo Sirainen [Wed, 15 Feb 2017 16:20:05 +0000 (18:20 +0200)] 
lib-storage: Re-open mailbox after it's undeleted.

This is needed with mailbox formats that didn't fully open the mailbox while
it was undeleted.

8 years agolib-storage: Don't sync mailbox after undeleting it.
Timo Sirainen [Wed, 15 Feb 2017 16:18:46 +0000 (18:18 +0200)] 
lib-storage: Don't sync mailbox after undeleting it.

This is useful only when deleting it. With undeletion the syncing isn't
useful and might actually be harmful with mailbox formats that didn't
fully open the mailbox while it was undeleted.

8 years agolib-storage: Make sure mailbox undeletion won't go to infinite loop
Timo Sirainen [Wed, 15 Feb 2017 16:05:14 +0000 (18:05 +0200)] 
lib-storage: Make sure mailbox undeletion won't go to infinite loop

8 years agomail-log: Add mail_log_cached_only setting.
Timo Sirainen [Wed, 15 Feb 2017 21:32:52 +0000 (23:32 +0200)] 
mail-log: Add mail_log_cached_only setting.

If enabled, everything except "save" event will log only the fields that can
be looked up from cache. This improves performance if some of the fields
aren't cached and it's not a strict requirement to log them.

8 years agolib-imap-client: pass the reply text to the auth-failed state change callback
Josef 'Jeff' Sipek [Wed, 15 Feb 2017 18:46:06 +0000 (13:46 -0500)] 
lib-imap-client: pass the reply text to the auth-failed state change callback

8 years agolib-imap-client: invoke state change callback on "authentication success"
Josef 'Jeff' Sipek [Wed, 15 Feb 2017 14:13:05 +0000 (09:13 -0500)] 
lib-imap-client: invoke state change callback on "authentication success"

8 years agolib-imap-client: add callback to notify consumers about state changes
Josef 'Jeff' Sipek [Wed, 15 Feb 2017 14:12:35 +0000 (09:12 -0500)] 
lib-imap-client: add callback to notify consumers about state changes

Add a callback to notify imapc users about failures.  Currently, the only
failure defined is "authentication failed".

8 years agolib-imap-client: centralize authentication failed error logging
Josef 'Jeff' Sipek [Tue, 14 Feb 2017 13:58:10 +0000 (08:58 -0500)] 
lib-imap-client: centralize authentication failed error logging

8 years agolib-http: response parser: Drop previous response's pool immediately when parsing...
Stephan Bosch [Sat, 4 Feb 2017 14:40:41 +0000 (15:40 +0100)] 
lib-http: response parser: Drop previous response's pool immediately when parsing continues.

Prevously, it would only do that when the first byte of the next response was received.
This prevents wasting memory when no response is being parsed.

8 years agolib-http: response parser: Always clear response to prevent referring to stale data.
Stephan Bosch [Sat, 4 Feb 2017 15:21:51 +0000 (16:21 +0100)] 
lib-http: response parser: Always clear response to prevent referring to stale data.

8 years agolib-http: message parser: Don't allocate a pool for the next message until it is...
Stephan Bosch [Sat, 4 Feb 2017 12:59:10 +0000 (13:59 +0100)] 
lib-http: message parser: Don't allocate a pool for the next message until it is needed.

This prevents wasting memory when no message is being parsed.

8 years agolib-http: message parser: Delay allocation of message header.
Stephan Bosch [Sat, 4 Feb 2017 13:11:36 +0000 (14:11 +0100)] 
lib-http: message parser: Delay allocation of message header.

8 years agolib-http: message parser: Don't create the connection_options array, unless it is...
Stephan Bosch [Sat, 4 Feb 2017 13:03:25 +0000 (14:03 +0100)] 
lib-http: message parser: Don't create the connection_options array, unless it is actually used.

8 years agolib-mail: Fix duplicate HEADER_FILTER_ADD_MISSING_EOH callback call
Timo Sirainen [Tue, 14 Feb 2017 15:35:54 +0000 (17:35 +0200)] 
lib-mail: Fix duplicate HEADER_FILTER_ADD_MISSING_EOH callback call

If headers weren't modified, the second reading of the istream shouldn't
call any callbacks.

8 years agodoveadm: Added "mailbox path" command
Timo Sirainen [Tue, 14 Feb 2017 22:08:49 +0000 (00:08 +0200)] 
doveadm: Added "mailbox path" command

This allows easily printing a path for a mailbox, index, control dir, etc.

8 years agolib-lda: Code cleanup - remove unnecessary dest_mail check
Timo Sirainen [Tue, 14 Feb 2017 18:23:16 +0000 (20:23 +0200)] 
lib-lda: Code cleanup - remove unnecessary dest_mail check

8 years agolib-lda: Don't set mail_deliver_context.dest_mail too early.
Timo Sirainen [Tue, 14 Feb 2017 18:20:07 +0000 (20:20 +0200)] 
lib-lda: Don't set mail_deliver_context.dest_mail too early.

It must be NULL for the caller, unless save_dest_mail==TRUE

8 years agolib-lda: Implement %{storage_id} correctly
Timo Sirainen [Mon, 13 Feb 2017 18:49:12 +0000 (20:49 +0200)] 
lib-lda: Implement %{storage_id} correctly

8 years agolib-lda: Fix deliver_log_format variables with Sieve
Timo Sirainen [Mon, 13 Feb 2017 18:47:51 +0000 (20:47 +0200)] 
lib-lda: Fix deliver_log_format variables with Sieve

With Sieve it was using src_mail for getting the values, which weren't
correct especially if Sieve had modified the mail.

8 years agolib-lda: Code cleanup - mail_deliver_open_mail() now uses uid parameter
Timo Sirainen [Mon, 13 Feb 2017 18:46:16 +0000 (20:46 +0200)] 
lib-lda: Code cleanup - mail_deliver_open_mail() now uses uid parameter

8 years agolib-lda: Remove %{storage_id} setting for now.
Timo Sirainen [Mon, 13 Feb 2017 18:44:31 +0000 (20:44 +0200)] 
lib-lda: Remove %{storage_id} setting for now.

It doesn't work with Sieve. The following patches add it back properly.

8 years agolib-lda: Redesign mail_deliver_context.var_expand_table cache
Timo Sirainen [Fri, 17 Feb 2017 09:25:49 +0000 (11:25 +0200)] 
lib-lda: Redesign mail_deliver_context.var_expand_table cache

8 years agolib-lda: remove forced logging of session_id
Martti Rannanjärvi [Wed, 27 Apr 2016 10:06:52 +0000 (13:06 +0300)] 
lib-lda: remove forced logging of session_id

8 years agolib-lda: Remove unused mail_deliver_get_log_var_expand_table()
Timo Sirainen [Thu, 9 Feb 2017 16:01:14 +0000 (18:01 +0200)] 
lib-lda: Remove unused mail_deliver_get_log_var_expand_table()

8 years agolib-lda: Initialize var_expand_tab[] directly.
Timo Sirainen [Fri, 17 Feb 2017 09:17:00 +0000 (11:17 +0200)] 
lib-lda: Initialize var_expand_tab[] directly.

This is a partially pick from acfda38b75d0f0e899ef692fef01593bd56ed85e
to be able to cherry-pick the following patches more easily.

8 years agolib-lda: Avoid using mailbox_save_set_dest_mail()
Timo Sirainen [Thu, 9 Feb 2017 16:49:53 +0000 (18:49 +0200)] 
lib-lda: Avoid using mailbox_save_set_dest_mail()

8 years agolib-storage: Add mailbox_save_get_dest_mail()
Timo Sirainen [Thu, 9 Feb 2017 16:46:14 +0000 (18:46 +0200)] 
lib-storage: Add mailbox_save_get_dest_mail()

This marks mailbox_save_set_dest_mail deprecated. It's not efficient to use
since it frees the already-created dest_mail.

8 years agovirtual: Fix saving to a virtual mailbox to work again
Timo Sirainen [Mon, 13 Feb 2017 18:23:49 +0000 (20:23 +0200)] 
virtual: Fix saving to a virtual mailbox to work again

Previous changes broke it.

8 years agoplugins: Remove unnecessary mail_save_context.dest_mail==NULL checks
Timo Sirainen [Thu, 9 Feb 2017 15:18:51 +0000 (17:18 +0200)] 
plugins: Remove unnecessary mail_save_context.dest_mail==NULL checks

It can never be NULL after the previous change: "lib-storage: Always create
mail_save_context.dest_mail".

8 years agolib-storage: Remove unnecessary mail_save_context.dest_mail==NULL checks
Timo Sirainen [Thu, 9 Feb 2017 15:14:57 +0000 (17:14 +0200)] 
lib-storage: Remove unnecessary mail_save_context.dest_mail==NULL checks

It can never be NULL after the previous change: "lib-storage: Always create
mail_save_context.dest_mail".

The code removal in maildir_transaction_save_commit_pre() seemed
potentially dangerous, but I don't think such code path is possible
anymore. Also even if it is, it's probably fine since the mail_free()
is called even earlier than before (although that itself might have
been a problem).

This also removes last traces of code that made it possible to save mails to
mbox without assigning UID to the mail. The previous commit already caused
this, so this is just removing dead code.

8 years agolib-storage: Always create mail_save_context.dest_mail
Timo Sirainen [Thu, 9 Feb 2017 14:53:47 +0000 (16:53 +0200)] 
lib-storage: Always create mail_save_context.dest_mail

This allows removing similar mail_alloc() from storage backends and plugins
that need it.

As a side effect, this changes mbox code to always assign UIDs to saved
mails. This shouldn't be much of a problem, since it happened practically
always already.

8 years agolib-storage: Fix mailbox list index hook usage
Timo Sirainen [Thu, 9 Feb 2017 14:34:52 +0000 (16:34 +0200)] 
lib-storage: Fix mailbox list index hook usage

The previous method appeared to work, but not if the internal hooks were
used more than once.

8 years agolib-index: zero mmap_length after logging error
Martti Rannanjärvi [Tue, 14 Feb 2017 08:42:26 +0000 (10:42 +0200)] 
lib-index: zero mmap_length after logging error

Logging that mmap(size=0) failed looks suspicious.

8 years agomail-crypt: Do not restrict access in unit test
Aki Tuomi [Mon, 13 Feb 2017 17:40:22 +0000 (19:40 +0200)] 
mail-crypt: Do not restrict access in unit test

This works around problem with docker

8 years agolib: Clarify *_strsplit_spaces() and add unit test
Timo Sirainen [Tue, 14 Feb 2017 08:54:29 +0000 (10:54 +0200)] 
lib: Clarify *_strsplit_spaces() and add unit test

8 years agolib: Add pool_alloconly_create_clean()
Timo Sirainen [Mon, 13 Feb 2017 21:46:15 +0000 (23:46 +0200)] 
lib: Add pool_alloconly_create_clean()

This partially reverts 2a2beae3a4c1e75b3aeff996781503138e6f24bc

8 years agoLAYOUT=index: Fix duplicate mailbox name renaming to actually work
Timo Sirainen [Mon, 13 Feb 2017 18:02:24 +0000 (20:02 +0200)] 
LAYOUT=index: Fix duplicate mailbox name renaming to actually work