]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
8 years agolib-storage: Fix sort index writing to not leave sort_id=0 gaps
Timo Sirainen [Fri, 9 Jun 2017 09:42:51 +0000 (12:42 +0300)] 
lib-storage: Fix sort index writing to not leave sort_id=0 gaps

This fixes errors like:
Error: INBOX: Broken sort-f indexes, resetting

8 years agolib-storage: Add details to "Broken sort-* indexes" error
Timo Sirainen [Fri, 9 Jun 2017 09:25:36 +0000 (12:25 +0300)] 
lib-storage: Add details to "Broken sort-* indexes" error

8 years agolib-storage: Fix setting the correct cache record corrupted
Timo Sirainen [Fri, 9 Jun 2017 11:31:15 +0000 (14:31 +0300)] 
lib-storage: Fix setting the correct cache record corrupted

It was mixing UIDs and sequences, so a wrong mail could have been set
corrupted or it could have crashed with:

Panic: file mail-index-transaction-update.c: line 1018 (mail_index_update_ext): assertion failed: (seq > 0 && (seq <= mail_index_view_get_messages_count(t->view) || seq <= t->last_new_seq))

8 years agoquota: Fix negative quota_warnings with count backend
Timo Sirainen [Fri, 9 Jun 2017 09:07:00 +0000 (12:07 +0300)] 
quota: Fix negative quota_warnings with count backend

For example this never triggered:

  quota_warning = -messages=100%% quota-warning %u -100

The change to quota_alloc() to update the count_used doesn't seem to
actually fix anything right now, but it makes the code more correct.

8 years agolib: Use unix streams with connection when using unix socket
Aki Tuomi [Wed, 31 May 2017 11:39:55 +0000 (14:39 +0300)] 
lib: Use unix streams with connection when using unix socket

This makes it easier to send file descriptors over connection

8 years agoquota: Fix imapc backend not to try to find out mail's size.
Timo Sirainen [Tue, 30 May 2017 18:57:06 +0000 (21:57 +0300)] 
quota: Fix imapc backend not to try to find out mail's size.

This removes unnecessary FETCH RFC822.SIZE command sent to server when
expunging mails.

8 years agolib-imap-client: Fix test-imapc-client unit test to work on OSX
Timo Sirainen [Tue, 30 May 2017 07:37:24 +0000 (10:37 +0300)] 
lib-imap-client: Fix test-imapc-client unit test to work on OSX

connect() to port 0 fails in it, so for the "connect failure" test first
open a random free listener port and then close it. Hopefully nothing else
reopens it in the mean time.

8 years agoimapc: Don't send UID FETCH 1:* after SELECT if mailbox is empty
Timo Sirainen [Tue, 30 May 2017 21:07:46 +0000 (00:07 +0300)] 
imapc: Don't send UID FETCH 1:* after SELECT if mailbox is empty

8 years agoimapc: SEARCH - Don't add parenthesis around OR
Timo Sirainen [Tue, 30 May 2017 21:00:32 +0000 (00:00 +0300)] 
imapc: SEARCH - Don't add parenthesis around OR

There's no need to write "(OR a b)" when "OR a b" works just the same.

8 years agolib-storage: mail_search_args_to_imap() - don't add parenthesis around OR
Timo Sirainen [Tue, 30 May 2017 20:53:44 +0000 (23:53 +0300)] 
lib-storage: mail_search_args_to_imap() - don't add parenthesis around OR

There's no need to write "(OR a b)" when "OR a b" works just the same.

8 years agolib-mail: Fix compiler warnings
Timo Sirainen [Fri, 9 Jun 2017 10:17:38 +0000 (13:17 +0300)] 
lib-mail: Fix compiler warnings

8 years agoglobal: Use i_realloc_type() wherever possible
Timo Sirainen [Wed, 7 Jun 2017 08:35:18 +0000 (11:35 +0300)] 
global: Use i_realloc_type() wherever possible

8 years agolib: Add test-mempool unit test.
Timo Sirainen [Wed, 7 Jun 2017 08:24:38 +0000 (11:24 +0300)] 
lib: Add test-mempool unit test.

It verifies that the p_new() and p_realloc_type() handle overflows
correctly. test-malloc-overflow already does this for the low-level
MALLOC_*() macros, but here we're cheking that the actually used
memory allocation macros also work.

8 years agolib: Add i_realloc_type() for i_realloc() that checks for overflows
Timo Sirainen [Wed, 7 Jun 2017 08:24:03 +0000 (11:24 +0300)] 
lib: Add i_realloc_type() for i_realloc() that checks for overflows

8 years agolmtp: Removed (Dovecot) from Received header.
Timo Sirainen [Thu, 12 May 2016 09:40:29 +0000 (05:40 -0400)] 
lmtp: Removed (Dovecot) from Received header.

Some people want to hide it, and I don't really see much benefit in
including it anyway. So lets just hide it from everyone.

8 years agoimapc: Fix potential crash if initial sync fails.
Timo Sirainen [Thu, 8 Jun 2017 08:35:58 +0000 (11:35 +0300)] 
imapc: Fix potential crash if initial sync fails.

Happened at least if mailbox had 0 mails and a failing mailbox_sync() was
called twice.

Fixes:
Panic: file imapc-sync.c: line 477 (imapc_sync_index): assertion failed: (mbox->sync_fetch_first_uid == 1)

8 years agolib: test for guid_128_generate() time handling
Josef 'Jeff' Sipek [Mon, 5 Jun 2017 11:21:23 +0000 (14:21 +0300)] 
lib: test for guid_128_generate() time handling

Make sure that guids always increase regardless of what is happening to
the time.

8 years agolib: guid_128_generate() shouldn't generate invalid timestamps
Josef 'Jeff' Sipek [Mon, 5 Jun 2017 09:55:56 +0000 (12:55 +0300)] 
lib: guid_128_generate() shouldn't generate invalid timestamps

The nsec validity check must take into account the soon-to-be-done increment.

8 years agolib: guid_128_generate() needs to correctly convert usecs to nsecs
Josef 'Jeff' Sipek [Mon, 5 Jun 2017 09:53:23 +0000 (12:53 +0300)] 
lib: guid_128_generate() needs to correctly convert usecs to nsecs

The timestamp in the guid starts off with real time, but "runs ahead" if a lot
of guids are generated.  If not many guids are being generated, the timestamp
is fast-forwarded to the current ioloop_timeval.  The buggy comparison prevented
fast forwarding when tv_sec matched, but tv_nsec value was > 0 (which
was true most of the time).

8 years agolib-index: Fix reset_id handling in mail_cache_get_missing_reason() cache
Timo Sirainen [Tue, 6 Jun 2017 14:18:27 +0000 (17:18 +0300)] 
lib-index: Fix reset_id handling in mail_cache_get_missing_reason() cache

Broken by bd897f82a5d9b00ba256b462d2056c2dc7df257c

8 years agolib-storage: Fix assert-crash in SORT caused by earlier changes
Timo Sirainen [Tue, 6 Jun 2017 06:39:34 +0000 (09:39 +0300)] 
lib-storage: Fix assert-crash in SORT caused by earlier changes

Broken by 0a6a527f0c42b5478d80ac53ab357885676fd516

Fixes:
Panic: file index-sort-string.c: line 668 (index_sort_add_ids_range): assertion failed: (str != NULL)

8 years agolib-index: Add cache to mail_cache_get_missing_reason()
Timo Sirainen [Mon, 5 Jun 2017 18:53:18 +0000 (21:53 +0300)] 
lib-index: Add cache to mail_cache_get_missing_reason()

This avoids excessive CPU usage when it's called in a loop for many mails.

8 years agolib-index: mail_cache_get_missing_reason() - Minor code cleanup
Timo Sirainen [Mon, 5 Jun 2017 18:44:45 +0000 (21:44 +0300)] 
lib-index: mail_cache_get_missing_reason() - Minor code cleanup

8 years agolib-storage: Optimize error handling for SORT
Timo Sirainen [Mon, 5 Jun 2017 18:09:51 +0000 (21:09 +0300)] 
lib-storage: Optimize error handling for SORT

If a lot of mails have failed in a large mailbox, this check reduces the
CPU usage significantly.

8 years agolib-storage: Sort code cleanup - Change index_sort_get_string() to return bool
Timo Sirainen [Mon, 5 Jun 2017 18:07:32 +0000 (21:07 +0300)] 
lib-storage: Sort code cleanup - Change index_sort_get_string() to return bool

None of the callers cared about the difference between "expunged" vs
"error".

8 years agolib-storage: Sort code cleanup - pass node to index_sort_get_string()
Timo Sirainen [Mon, 5 Jun 2017 18:05:07 +0000 (21:05 +0300)] 
lib-storage: Sort code cleanup - pass node to index_sort_get_string()

8 years agolib-storage: Make sure istream-mail doesn't replace an existing storage error
Timo Sirainen [Mon, 5 Jun 2017 17:14:54 +0000 (20:14 +0300)] 
lib-storage: Make sure istream-mail doesn't replace an existing storage error

I'm not aware of it actually having broken anything, so this is just for
extra safety.

8 years agolib-storage: Fix SORT error message when reaching mail_sort_max_read_count
Timo Sirainen [Mon, 5 Jun 2017 17:12:43 +0000 (20:12 +0300)] 
lib-storage: Fix SORT error message when reaching mail_sort_max_read_count

It should have been:
NO [LIMIT] Requested sort would have taken too long

Instead it was just:
NO [SERVERBUG] Mail field not cached

It was broken for CC, FROM, TO, SUBJECT, DISPLAYFROM and DISPLAYTO.
The numeric sorting was working correctly.

8 years agolib-mail: Add qp encoder
Aki Tuomi [Mon, 29 May 2017 10:39:18 +0000 (13:39 +0300)] 
lib-mail: Add qp encoder

8 years agolib-mail: Link test binaries to libmail.la instead of .lo files
Aki Tuomi [Thu, 25 May 2017 16:03:32 +0000 (19:03 +0300)] 
lib-mail: Link test binaries to libmail.la instead of .lo files

8 years agolib-storage: Fix LAYOUT=fs potentially not ignoring ACLs when requested
Timo Sirainen [Tue, 30 May 2017 06:36:49 +0000 (09:36 +0300)] 
lib-storage: Fix LAYOUT=fs potentially not ignoring ACLs when requested

fs_get_existence_info_flag() was only being called with LAYOUT=fs and
Maildir combination. This mainly affected that combination when using
mailbox_list_index=yes and trying to list mailboxes with ACL checking
disabled.

8 years agolib-storage: Fix ACL in parent mailbox potentially hiding its children.
Timo Sirainen [Tue, 30 May 2017 06:18:14 +0000 (09:18 +0300)] 
lib-storage: Fix ACL in parent mailbox potentially hiding its children.

fs_get_existence_info_flag() was only being called with LAYOUT=fs and
Maildir combination, so only it was broken if the parent mailbox wasn't
visible but its children were.

8 years agolib-storage: fs_list_get_mailbox_flags() - Return mailbox files as selectable
Timo Sirainen [Tue, 30 May 2017 06:15:09 +0000 (09:15 +0300)] 
lib-storage: fs_list_get_mailbox_flags() - Return mailbox files as selectable

Avoids a second stat() later on, which would do the same anyway.

8 years agolib-storage: fs_list_get_mailbox_flags() - Don't assume directories always have children.
Timo Sirainen [Tue, 30 May 2017 06:12:05 +0000 (09:12 +0300)] 
lib-storage: fs_list_get_mailbox_flags() - Don't assume directories always have children.

This makes the directory handling code equivalent for type==UNKNOWN and
type==DIR.

8 years agolib-storage: fs_list_get_mailbox_flags() - Add comments
Timo Sirainen [Tue, 30 May 2017 06:10:55 +0000 (09:10 +0300)] 
lib-storage: fs_list_get_mailbox_flags() - Add comments

8 years agolib-storage: fs_list_get_mailbox_flags() - Reorganize code
Timo Sirainen [Tue, 30 May 2017 06:09:39 +0000 (09:09 +0300)] 
lib-storage: fs_list_get_mailbox_flags() - Reorganize code

No functional changes.

8 years agoacl: Global ACL file was parsed as if it was local ACL file
Timo Sirainen [Mon, 29 May 2017 14:58:35 +0000 (17:58 +0300)] 
acl: Global ACL file was parsed as if it was local ACL file

This caused some of the ACL handling not work exactly as expected.

8 years agolib-storage: Make mailbox_list_iter_init_autocreate() static again
Timo Sirainen [Mon, 29 May 2017 14:26:52 +0000 (17:26 +0300)] 
lib-storage: Make mailbox_list_iter_init_autocreate() static again

It's no longer needed elsewhere.

8 years agolib-storage: Fix mailbox_list_index=yes + ACLs + auto=subscribe mailboxes
Timo Sirainen [Mon, 29 May 2017 14:20:48 +0000 (17:20 +0300)] 
lib-storage: Fix mailbox_list_index=yes + ACLs + auto=subscribe mailboxes

If the auto=subscribe mailbox didn't have a lookup ACL, it shouldn't have
been listed. This didn't work properly, because ACL plugin initialized the
autocreate_ctx only for the index iterator, while the autoboxes were
listed using the backend iterator. Fixed by not creating index iterator at
all when doing a passthrough iteration.

8 years agolib-storage: Cleanup - Don't use ctx in iter_use_index()
Timo Sirainen [Mon, 29 May 2017 13:44:44 +0000 (16:44 +0300)] 
lib-storage: Cleanup - Don't use ctx in iter_use_index()

Shrinks the following change.

8 years agolib-storage: Add \NoInferiors flag to autocreated mailboxes with mbox
Timo Sirainen [Mon, 29 May 2017 12:52:15 +0000 (15:52 +0300)] 
lib-storage: Add \NoInferiors flag to autocreated mailboxes with mbox

Once the mailboxes get autocreated, the \NoInferiors flag is added anyway.

8 years agolib-storage: Don't list duplicate autocreated mailboxes' parents
Timo Sirainen [Mon, 29 May 2017 12:30:36 +0000 (15:30 +0300)] 
lib-storage: Don't list duplicate autocreated mailboxes' parents

8 years agoacl: Skip auto=create|subscribe mailboxes that don't have lookup-right
Timo Sirainen [Mon, 29 May 2017 10:53:17 +0000 (13:53 +0300)] 
acl: Skip auto=create|subscribe mailboxes that don't have lookup-right

Removing them entirely from the boxes and box_sets arrays in the list
context treats them as if they weren't configured at all. This way they
don't need any other special code.

8 years agolib-storage: Add mailbox-list-iter-private.h with autocreate context structs
Timo Sirainen [Mon, 29 May 2017 10:52:42 +0000 (13:52 +0300)] 
lib-storage: Add mailbox-list-iter-private.h with autocreate context structs

Needed for the following ACL change.

8 years agoconfig: When showing an "Unknown setting" error, show the full section path
Timo Sirainen [Sat, 20 May 2017 15:13:45 +0000 (18:13 +0300)] 
config: When showing an "Unknown setting" error, show the full section path

For example with:

service foo {
  inet_listener bar {
    key = value
  }
}

Instead of showing just:

Unknown setting: key

Show the entire path:

Unknown setting: service { inet_listener { key

Any filters won't be shown, because they don't affect the result.

8 years agolib-storage: Apply mailbox_list_iter_autocreate_filter on mailbox_list_index_iter_next
Aki Tuomi [Wed, 17 May 2017 12:20:35 +0000 (15:20 +0300)] 
lib-storage: Apply mailbox_list_iter_autocreate_filter on mailbox_list_index_iter_next

It skips mailbox_list_iter_next, so it needs to be applied here as well.

8 years agolib-storage: Rename autocreate_iter_existing to mailbox_list_iter_autocreate_filter
Aki Tuomi [Wed, 17 May 2017 12:19:44 +0000 (15:19 +0300)] 
lib-storage: Rename autocreate_iter_existing to mailbox_list_iter_autocreate_filter

It makes next commit possible

8 years agolib-storage: Do not drop autocreate boxes when listing them
Aki Tuomi [Wed, 17 May 2017 09:16:31 +0000 (12:16 +0300)] 
lib-storage: Do not drop autocreate boxes when listing them

Otherwise we skip folders, because array_delete() is removing boxes while they're being iterated.

8 years agolib-master,login-common: Add dual cert support
Aki Tuomi [Thu, 6 Apr 2017 13:09:00 +0000 (16:09 +0300)] 
lib-master,login-common: Add dual cert support

Adds new settings ssl_alt_cert and ssl_alt_key

8 years agolib-dict: Update cdb_dict_init to match with new API
Aki Tuomi [Fri, 2 Jun 2017 18:11:19 +0000 (21:11 +0300)] 
lib-dict: Update cdb_dict_init to match with new API

8 years agolib: Added ostream-unix for writing fd sockets via ostream.
Stephan Bosch [Sat, 30 Apr 2016 10:50:53 +0000 (12:50 +0200)] 
lib: Added ostream-unix for writing fd sockets via ostream.

8 years agopush-notification: Fix crash in OX driver's deinit
Timo Sirainen [Mon, 5 Jun 2017 16:05:58 +0000 (19:05 +0300)] 
push-notification: Fix crash in OX driver's deinit

The http_client doesn't always exist.

8 years agoauth: Access always first entry when flushing failures
Aki Tuomi [Mon, 5 Jun 2017 09:14:57 +0000 (12:14 +0300)] 
auth: Access always first entry when flushing failures

The code is deleting the first item after accessing
it, and then moving forward. It will eventually go
beyond the array and get NULL ptr and fail.

Instead we need to always get the first item,
since the array deletion is moving the queued items
forward.

Broken by e18b4e41

8 years agoauth: Fix vpopmail for 2.2
Aki Tuomi [Wed, 31 May 2017 07:09:41 +0000 (10:09 +0300)] 
auth: Fix vpopmail for 2.2

8 years agoquota: Update version number for script client
Aki Tuomi [Wed, 31 May 2017 10:03:47 +0000 (13:03 +0300)] 
quota: Update version number for script client

8 years agomail-filter: tabescape args, this is required by script client 4
Aki Tuomi [Tue, 30 May 2017 11:03:23 +0000 (14:03 +0300)] 
mail-filter: tabescape args, this is required by script client 4

8 years agowelcome: tabescape args, this is required by script client 4
Aki Tuomi [Tue, 30 May 2017 11:01:39 +0000 (14:01 +0300)] 
welcome: tabescape args, this is required by script client 4

8 years agoglobal: Update script client version number
Aki Tuomi [Tue, 30 May 2017 11:01:17 +0000 (14:01 +0300)] 
global: Update script client version number

Broken by b383ed51d75bce0f69f126bc4ff7192985ca30f2

8 years agoauth: Fix unescaping tabs in auth client input.
Timo Sirainen [Tue, 30 May 2017 13:24:52 +0000 (16:24 +0300)] 
auth: Fix unescaping tabs in auth client input.

This mainly broke forward_fields when there was more than one of them.

8 years agoauth: Fix crash on passdb lookup when all passdbs were skipped
Timo Sirainen [Tue, 30 May 2017 08:30:10 +0000 (11:30 +0300)] 
auth: Fix crash on passdb lookup when all passdbs were skipped

Finishes the fix in 614f5b6febaf3c825f9200ab3b62d9d047197b0e

Fixes:
auth: Panic: file auth-request.c: line 2493 (get_log_prefix): assertion failed: (auth_request->mech != NULL)

8 years agolib-storage: Fix compiler warning in test-mail-storage
Timo Sirainen [Tue, 30 May 2017 07:01:20 +0000 (10:01 +0300)] 
lib-storage: Fix compiler warning in test-mail-storage

8 years agolib-storage: Fix crash in test-mail-storage
Timo Sirainen [Wed, 24 May 2017 20:49:43 +0000 (23:49 +0300)] 
lib-storage: Fix crash in test-mail-storage

8 years agomail-crypt-plugin: Set copy-hook only if save_version > 0
Aki Tuomi [Mon, 15 May 2017 12:35:37 +0000 (15:35 +0300)] 
mail-crypt-plugin: Set copy-hook only if save_version > 0

Otherwise we might use it in read-only mode, too.

8 years agomail-crypt: Re-encrypt mails when copying/moving
Aki Tuomi [Thu, 4 May 2017 06:14:17 +0000 (09:14 +0300)] 
mail-crypt: Re-encrypt mails when copying/moving

Otherwise the mail cannot be opened after moving

8 years agolib-storage: Fix memory leak in test-mail-storage
Timo Sirainen [Wed, 24 May 2017 19:31:59 +0000 (22:31 +0300)] 
lib-storage: Fix memory leak in test-mail-storage

8 years agolib-storage: Add unit test for set/get/push/pop storage error operations
Timo Sirainen [Wed, 24 May 2017 18:56:03 +0000 (21:56 +0300)] 
lib-storage: Add unit test for set/get/push/pop storage error operations

8 years agolib-storage: Fix mail_storage_set_critical() when input parameter is an old internal...
Timo Sirainen [Wed, 24 May 2017 18:29:49 +0000 (21:29 +0300)] 
lib-storage: Fix mail_storage_set_critical() when input parameter is an old internal error

This could have caused garbage in the error string.

8 years agolib-storage: Fix mail_storage_last_error_push/pop() to work with internal errors
Timo Sirainen [Wed, 24 May 2017 16:16:03 +0000 (19:16 +0300)] 
lib-storage: Fix mail_storage_last_error_push/pop() to work with internal errors

8 years agoimap: Fix unhibernation after earlier change
Timo Sirainen [Mon, 22 May 2017 14:56:15 +0000 (17:56 +0300)] 
imap: Fix unhibernation after earlier change

8 years agoimap NOTIFY: Flush any pending notifications on NOOP
Timo Sirainen [Wed, 17 May 2017 16:02:06 +0000 (19:02 +0300)] 
imap NOTIFY: Flush any pending notifications on NOOP

This is mainly to allow testing NOTIFY easily with imaptest scripts.
This is cheap anyway, because mailbox_list_notify_flush() doesn't do any
syscalls when there's no work.

8 years agolib-storage: Implement mailbox_list_notify_flush()
Timo Sirainen [Wed, 17 May 2017 16:01:57 +0000 (19:01 +0300)] 
lib-storage: Implement mailbox_list_notify_flush()

This flushes any pending notifications. For now it only checks if there's
a pending notification waiting for a timeout. It could also stat() the
files to make sure, but that's probably unnecessary.

8 years agolib-storage: Explicitly name function pointers in mailbox lists
Timo Sirainen [Wed, 17 May 2017 15:13:09 +0000 (18:13 +0300)] 
lib-storage: Explicitly name function pointers in mailbox lists

This allows adding more fields to struct mailbox_list_vfuncs without
compiler warnings.

8 years agolib-storage: Always update highestmodseq in mailbox list index
Timo Sirainen [Wed, 17 May 2017 14:49:25 +0000 (17:49 +0300)] 
lib-storage: Always update highestmodseq in mailbox list index

This is required for mailbox-list-notify API to work correctly. For
example IMAP NOTIFY session with CONDSTORE enabled could be listening for
FlagChanges, but another session without CONDSTORE enabled could be updating
flags in a mailbox that has never been opened with CONDSTORE enabled.
NOTIFY wouldn't see this change, unless it was always written to
dovecot.list.index.

8 years agolib-storage: Fix mailbox list index notifications when modseqs aren't enabled.
Timo Sirainen [Wed, 17 May 2017 14:14:05 +0000 (17:14 +0300)] 
lib-storage: Fix mailbox list index notifications when modseqs aren't enabled.

No notifications were sent if highest_modseqs weren't updated in mailbox
list index.

8 years agoimap: login reply should be sent sooner
Josef 'Jeff' Sipek [Wed, 17 May 2017 08:40:53 +0000 (11:40 +0300)] 
imap: login reply should be sent sooner

8 years agolib-http: client: Fixed race condition between DNS refresh lookup and a soft connecti...
Stephan Bosch [Mon, 3 Apr 2017 22:32:07 +0000 (00:32 +0200)] 
lib-http: client: Fixed race condition between DNS refresh lookup and a soft connection timeout.

The refreshing DNS lookup cleared all the IPs, but the soft connection timeout (and maybe other code) still relied on them.
Adding tests everywhere for host->ips_count == 0 is annoying, so I changed the DNS lookup code such that the stale IPs remain present while the DNS lookup is being performed.
The pending lookup prevents new connections through http_client_host_refresh(), so this will not create potentially useless connections.

8 years agolib-master: Replace listeners with /dev/null in SIGQUIT instead of closing
Timo Sirainen [Wed, 24 May 2017 14:19:36 +0000 (17:19 +0300)] 
lib-master: Replace listeners with /dev/null in SIGQUIT instead of closing

This should be somewhat safer.

8 years agolib-index: Fix crash in mail_transaction_log_view_set_all() error handling
Timo Sirainen [Mon, 22 May 2017 07:13:21 +0000 (10:13 +0300)] 
lib-index: Fix crash in mail_transaction_log_view_set_all() error handling

8 years agolib-index: Fix start_offset > sync_offset error handling for in-memory indexes
Timo Sirainen [Mon, 22 May 2017 07:11:30 +0000 (10:11 +0300)] 
lib-index: Fix start_offset > sync_offset error handling for in-memory indexes

8 years agoauth: Fix linking duplicate .a libraries to unit test
Timo Sirainen [Fri, 19 May 2017 07:45:09 +0000 (10:45 +0300)] 
auth: Fix linking duplicate .a libraries to unit test

8 years agoutil: script: Increased the major protocol version due to earlier changes.
Stephan Bosch [Mon, 8 May 2017 10:49:39 +0000 (12:49 +0200)] 
util: script: Increased the major protocol version due to earlier changes.

8 years agoutil: script: Amended protocol with the ability to convey a set of environment variab...
Stephan Bosch [Tue, 9 May 2017 11:33:23 +0000 (13:33 +0200)] 
util: script: Amended protocol with the ability to convey a set of environment variables that are passed to the script.

The acceptable environment variables are selected using the -e parameter; others are ignored silently.

8 years agoutil: script: Amended the protocol to pass arguments escaped to prevent problems...
Stephan Bosch [Mon, 8 May 2017 10:48:08 +0000 (12:48 +0200)] 
util: script: Amended the protocol to pass arguments escaped to prevent problems with newlines.

Newlines are used as argument delimiters in the protocol, which will cause problems.

8 years agolib-program-client: local: Fixed use of unterminated string array of environment...
Stephan Bosch [Tue, 9 May 2017 11:43:39 +0000 (13:43 +0200)] 
lib-program-client: local: Fixed use of unterminated string array of environment variables in exec_child().

8 years agolib-program-client: Made the test suite ignore the protocol version.
Stephan Bosch [Tue, 9 May 2017 12:22:06 +0000 (14:22 +0200)] 
lib-program-client: Made the test suite ignore the protocol version.

8 years agolib-program-client: Gave variables pointing to a program-client more logical names.
Stephan Bosch [Thu, 20 Oct 2016 13:41:54 +0000 (15:41 +0200)] 
lib-program-client: Gave variables pointing to a program-client more logical names.

Was still based on when it was called the script-client.

8 years agoimap: Move struct client_sync_context to imap-sync-private.h and add imap_ prefix
Timo Sirainen [Fri, 19 May 2017 14:44:30 +0000 (17:44 +0300)] 
imap: Move struct client_sync_context to imap-sync-private.h and add imap_ prefix

8 years agoimap: Allow plugins to replace existing FETCH handlers
Timo Sirainen [Fri, 19 May 2017 13:34:29 +0000 (16:34 +0300)] 
imap: Allow plugins to replace existing FETCH handlers

They can use imap_fetch_handler_lookup() to get the old init() function.
Then they can imap_fetch_handler_unregister() the existing handler and
register a new handler, which can do its own work and call the old init()
if needed.

8 years agolib-index: Improve "start_offset > current sync_offset" error message.
Timo Sirainen [Wed, 17 May 2017 13:47:43 +0000 (16:47 +0300)] 
lib-index: Improve "start_offset > current sync_offset" error message.

Try to make it clear what is the root cause of it.

8 years agolib-index: mail_transaction_log_file_get_highest_modseq_at() - return error string
Timo Sirainen [Wed, 17 May 2017 13:28:58 +0000 (16:28 +0300)] 
lib-index: mail_transaction_log_file_get_highest_modseq_at() - return error string

This can help figuring out why some error happened when more context is
provided in the caller's error messages.

8 years agolib-index: Add missing error logging for mail_index_view_sync_begin()
Timo Sirainen [Wed, 17 May 2017 13:21:54 +0000 (16:21 +0300)] 
lib-index: Add missing error logging for mail_index_view_sync_begin()

8 years agolib-index: mail_transaction_log_file_map() - return reason/error string
Timo Sirainen [Wed, 17 May 2017 10:33:44 +0000 (13:33 +0300)] 
lib-index: mail_transaction_log_file_map() - return reason/error string

This can help figuring out why some error happened when more context is
provided in the caller's error messages.

8 years agolib-index: mail_transaction_log_view_set_all() - don't entirely ignore corrupted...
Timo Sirainen [Wed, 17 May 2017 10:31:09 +0000 (13:31 +0300)] 
lib-index: mail_transaction_log_view_set_all() - don't entirely ignore corrupted logs

Ignore them only if it's followed by an index reset.

8 years agolib-storage: Fix mailbox list index records without guid having invalid flags
Timo Sirainen [Thu, 18 May 2017 20:13:38 +0000 (23:13 +0300)] 
lib-storage: Fix mailbox list index records without guid having invalid flags

With LAYOUT=index the mailbox is found with its GUID. If it doesn't exist,
the mailbox has to be either \NonExistent or \NoSelect. It probably doesn't
make much difference which one, so we'll fix them by adding \NoSelect.

With other layouts the GUID is allowed to be empty, because it can be looked
up from the actual mailbox.

8 years agolib-storage: Fix mailbox list index records with name_id=0
Timo Sirainen [Thu, 18 May 2017 20:06:20 +0000 (23:06 +0300)] 
lib-storage: Fix mailbox list index records with name_id=0

name_id=0 isn't valid, so it needs to be changed and writen to the disk.
The write-to-disk part wasn't working.

8 years agolib: Fix memory leak in test-istream-concat
Timo Sirainen [Fri, 19 May 2017 06:45:28 +0000 (09:45 +0300)] 
lib: Fix memory leak in test-istream-concat

8 years agolib: Fix crash when seeking istream-concat to EOF and trying to read it
Timo Sirainen [Thu, 18 May 2017 19:18:15 +0000 (22:18 +0300)] 
lib: Fix crash when seeking istream-concat to EOF and trying to read it

8 years agoimapc: Make sure a valid UIDVALIDITY is returned by SELECT
Timo Sirainen [Thu, 18 May 2017 18:10:33 +0000 (21:10 +0300)] 
imapc: Make sure a valid UIDVALIDITY is returned by SELECT

Fixes errors such as:
Error: Synchronization corrupted index header (in-memory index): uidvalidity=0, but next_uid=9

8 years agoimapc: Fix assert-crash if server doesn't send EXISTS reply to SELECT
Timo Sirainen [Thu, 18 May 2017 18:08:23 +0000 (21:08 +0300)] 
imapc: Fix assert-crash if server doesn't send EXISTS reply to SELECT

Fixes:
Panic: file imapc-sync.c: line 477 (imapc_sync_index): assertion failed: (mbox->sync_fetch_first_uid == 1)

8 years agolib-imap-client: Change server IP only on connect() failures
Timo Sirainen [Thu, 18 May 2017 17:18:24 +0000 (20:18 +0300)] 
lib-imap-client: Change server IP only on connect() failures

Also log an warning-level message about it. This is mainly useful to see
that a slow connection could be caused by a connect() timeout. Since more
IPs are still available, it's not yet an error.