]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
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
Timo Sirainen [Fri, 9 Jun 2017 09:25:36 +0000 (12:25 +0300)]
lib-storage: Add details to "Broken sort-* indexes" error
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))
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.
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
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.
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.
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
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.
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.
Timo Sirainen [Fri, 9 Jun 2017 10:17:38 +0000 (13:17 +0300)]
lib-mail: Fix compiler warnings
Timo Sirainen [Wed, 7 Jun 2017 08:35:18 +0000 (11:35 +0300)]
global: Use i_realloc_type() wherever possible
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.
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
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.
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)
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.
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.
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).
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
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)
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.
Timo Sirainen [Mon, 5 Jun 2017 18:44:45 +0000 (21:44 +0300)]
lib-index: mail_cache_get_missing_reason() - Minor code cleanup
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.
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".
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()
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.
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.
Aki Tuomi [Mon, 29 May 2017 10:39:18 +0000 (13:39 +0300)]
lib-mail: Add qp encoder
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
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.
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.
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.
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.
Timo Sirainen [Tue, 30 May 2017 06:10:55 +0000 (09:10 +0300)]
lib-storage: fs_list_get_mailbox_flags() - Add comments
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.
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.
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.
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.
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.
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.
Timo Sirainen [Mon, 29 May 2017 12:30:36 +0000 (15:30 +0300)]
lib-storage: Don't list duplicate autocreated mailboxes' parents
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.
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.
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.
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.
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
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.
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
Aki Tuomi [Fri, 2 Jun 2017 18:11:19 +0000 (21:11 +0300)]
lib-dict: Update cdb_dict_init to match with new API
Stephan Bosch [Sat, 30 Apr 2016 10:50:53 +0000 (12:50 +0200)]
lib: Added ostream-unix for writing fd sockets via ostream.
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.
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
Aki Tuomi [Wed, 31 May 2017 07:09:41 +0000 (10:09 +0300)]
auth: Fix vpopmail for 2.2
Aki Tuomi [Wed, 31 May 2017 10:03:47 +0000 (13:03 +0300)]
quota: Update version number for script client
Aki Tuomi [Tue, 30 May 2017 11:03:23 +0000 (14:03 +0300)]
mail-filter: 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
Aki Tuomi [Tue, 30 May 2017 11:01:17 +0000 (14:01 +0300)]
global: Update script client version number
Broken by
b383ed51d75bce0f69f126bc4ff7192985ca30f2
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.
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)
Timo Sirainen [Tue, 30 May 2017 07:01:20 +0000 (10:01 +0300)]
lib-storage: Fix compiler warning 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
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.
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
Timo Sirainen [Wed, 24 May 2017 19:31:59 +0000 (22:31 +0300)]
lib-storage: Fix memory leak in test-mail-storage
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
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.
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
Timo Sirainen [Mon, 22 May 2017 14:56:15 +0000 (17:56 +0300)]
imap: Fix unhibernation after earlier change
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.
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.
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.
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.
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.
Josef 'Jeff' Sipek [Wed, 17 May 2017 08:40:53 +0000 (11:40 +0300)]
imap: login reply should be sent sooner
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.
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.
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
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
Timo Sirainen [Fri, 19 May 2017 07:45:09 +0000 (10:45 +0300)]
auth: Fix linking duplicate .a libraries to unit test
Stephan Bosch [Mon, 8 May 2017 10:49:39 +0000 (12:49 +0200)]
util: script: Increased the major protocol version due to earlier changes.
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.
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.
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().
Stephan Bosch [Tue, 9 May 2017 12:22:06 +0000 (14:22 +0200)]
lib-program-client: Made the test suite ignore the protocol version.
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.
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
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.
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.
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.
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()
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.
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.
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.
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.
Timo Sirainen [Fri, 19 May 2017 06:45:28 +0000 (09:45 +0300)]
lib: Fix memory leak in test-istream-concat
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
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
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)
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.