]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
8 years agolib-master: Use master_service_import_environment() for preserving environments
Timo Sirainen [Wed, 7 Jun 2017 21:35:08 +0000 (00:35 +0300)] 
lib-master: Use master_service_import_environment() for preserving environments

8 years agolib-master: master_service_import_environment() - use a data stack frame
Timo Sirainen [Wed, 7 Jun 2017 21:33:32 +0000 (00:33 +0300)] 
lib-master: master_service_import_environment() - use a data stack frame

This way the caller doesn't have to do it.

8 years agomaster: Move master_set_import_environment() to lib-master
Timo Sirainen [Wed, 7 Jun 2017 21:24:19 +0000 (00:24 +0300)] 
master: Move master_set_import_environment() to lib-master

8 years agomaster: Append to existing DOVECOT_PRESERVE_ENVS instead of overwriting it
Timo Sirainen [Wed, 7 Jun 2017 21:20:38 +0000 (00:20 +0300)] 
master: Append to existing DOVECOT_PRESERVE_ENVS instead of overwriting it

8 years agomaster: Move import_environment setting to lib-master's master_service_settings
Timo Sirainen [Wed, 7 Jun 2017 21:14:30 +0000 (00:14 +0300)] 
master: Move import_environment setting to lib-master's master_service_settings

8 years agolib-http: Try to reuse memory for host->ips allocation.
Timo Sirainen [Sat, 4 Feb 2017 18:45:30 +0000 (20:45 +0200)] 
lib-http: Try to reuse memory for host->ips allocation.

If the host already had an IP, most of the time ips_count doesn't change
anymore.

8 years agolib: Fix test-path-util unit test with some cwd path lengths
Timo Sirainen [Sat, 10 Jun 2017 07:35:54 +0000 (10:35 +0300)] 
lib: Fix test-path-util unit test with some cwd path lengths

The component-component directory might not have been created at all,
in which case the following symlink creations would fail since they were
already created to the same directory in a previous test.

8 years agomail-crypt-acl: Fix assert-crash due to missing namespace initialization
Timo Sirainen [Fri, 9 Jun 2017 15:10:14 +0000 (18:10 +0300)] 
mail-crypt-acl: Fix assert-crash due to missing namespace initialization

This was broken by e031d9aaae59a9f79710dc1138b76b69272615a3.

8 years agoquota: count backend - Don't ignore mailbox list iteration errors
Timo Sirainen [Fri, 9 Jun 2017 13:18:56 +0000 (16:18 +0300)] 
quota: count backend - Don't ignore mailbox list iteration errors

8 years agolib: Fix test-path-util.c formatting to conform coding style
Aki Tuomi [Fri, 9 Jun 2017 11:08:22 +0000 (14:08 +0300)] 
lib: Fix test-path-util.c formatting to conform coding style

8 years agolib: Fix infinite loop in path-util.c
Aki Tuomi [Fri, 9 Jun 2017 10:15:35 +0000 (13:15 +0300)] 
lib: Fix infinite loop in path-util.c

Infinite loop was reached if the path was longer than
128 bytes, and the 128 boundary was in middle of path
name component.

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-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 agodsync: Display namespace locations on init in debug mode
Aki Tuomi [Fri, 9 Jun 2017 12:22:56 +0000 (15:22 +0300)] 
dsync: Display namespace locations on init in debug mode

This simplifies debugging as you can more easily tell
which brain is using which mail location.

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: Remove unused quota_free()
Timo Sirainen [Sun, 4 Jun 2017 10:07:48 +0000 (13:07 +0300)] 
quota: Remove unused quota_free()

8 years agoquota: Fix quota_vsizes=yes to work with all backends
Timo Sirainen [Sun, 4 Jun 2017 10:06:06 +0000 (13:06 +0300)] 
quota: Fix quota_vsizes=yes to work with all backends

8 years agolib-storage: simplify mailbox_get_path_to()
Josef 'Jeff' Sipek [Wed, 7 Jun 2017 11:37:47 +0000 (14:37 +0300)] 
lib-storage: simplify mailbox_get_path_to()

Instead of special casing MAILBOX_LIST_PATH_TYPE_{MAILBOX,INDEX}, we can use
a common helper to remove code duplication.

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 agolib-storage: test-mail-search-args-simplify - test with initialized args
Timo Sirainen [Wed, 7 Jun 2017 16:54:10 +0000 (19:54 +0300)] 
lib-storage: test-mail-search-args-simplify - test with initialized args

8 years agolib-storage: mail_search_args_simplify() - Fix merging already-initialized keywords
Timo Sirainen [Wed, 7 Jun 2017 16:53:00 +0000 (19:53 +0300)] 
lib-storage: mail_search_args_simplify() - Fix merging already-initialized keywords

It was deinitializing the arg that was kept instead of the one being removed.

8 years agolib-storage: Fix mail_search_args_simplify() to not deinit too many args
Timo Sirainen [Wed, 7 Jun 2017 16:37:46 +0000 (19:37 +0300)] 
lib-storage: Fix mail_search_args_simplify() to not deinit too many args

Removing an arg should deinit it, but not its following siblings.

8 years agolib-storage: Add mail_search_arg_one_deinit()
Timo Sirainen [Wed, 7 Jun 2017 16:36:19 +0000 (19:36 +0300)] 
lib-storage: Add mail_search_arg_one_deinit()

8 years agomaster: Don't include imap-hibernate when counting auth's max client_limit
Timo Sirainen [Wed, 7 Jun 2017 20:47:56 +0000 (23:47 +0300)] 
master: Don't include imap-hibernate when counting auth's max client_limit

imap-hibernate doesn't do any auth connections, so it doesn't need it.
It's a bit ugly to add an explicit service name comparison here, but
there didn't really seem to be many other good choices:

 * Could have removed protocol=imap from imap-hibernate. I was close to
doing this, but maybe it's better that imap-only processes would have
their protocol set to "imap".

 * Could have added a new service type, but seems pretty unnecessary to add
some kind of a "nonauth" just for this. A reverse "needs-auth" might have
been ok though.

Perhaps in future we'll implement proper dependencies across services and
those dependencies could be used to calculate this limit more precisely.

8 years agolib: Add unit tests for p_strdup*()
Timo Sirainen [Wed, 7 Jun 2017 07:17:55 +0000 (10:17 +0300)] 
lib: Add unit tests for p_strdup*()

8 years agolib-storage: Fix crash in mail_get_header_stream() when its previous stream wasn...
Timo Sirainen [Tue, 30 May 2017 15:25:50 +0000 (18:25 +0300)] 
lib-storage: Fix crash in mail_get_header_stream() when its previous stream wasn't at EOF

At least this could have happened when indexes were disabled and running:

FETCH 1 (envelope body.peek[header.fields (foo)] bodystructure)

Fixes:
Panic: file index-mail-headers.c: line 198 (index_mail_parse_header_init): assertion failed: (!mail->data.header_parser_initialized)

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 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-mail: message_address_parse() - Fix fill_missing==TRUE handling
Timo Sirainen [Wed, 7 Jun 2017 15:10:10 +0000 (18:10 +0300)] 
lib-mail: message_address_parse() - Fix fill_missing==TRUE handling

Mainly MISSING_DOMAIN wasn't set in all situations. Also added unit tests.

8 years agolib-mail: message_address_parse() - Handle invalid standalone phrases better
Timo Sirainen [Wed, 7 Jun 2017 12:33:42 +0000 (15:33 +0300)] 
lib-mail: message_address_parse() - Handle invalid standalone phrases better

We'll treat "local-part" (without quotes) as a mailbox even without
@domain, but if it continues with anything or if it's a quoted-string,
we'll treat it as a display-name instead.

This is probably better than just converting everything to display-name,
since there are likely to exist headers like "To: localuser"

8 years agolib-mail: Improve test-message-address to test invalid addresses in lists
Timo Sirainen [Wed, 7 Jun 2017 12:22:22 +0000 (15:22 +0300)] 
lib-mail: Improve test-message-address to test invalid addresses in lists

Test in both a group and list of addresses.

8 years agolib-mail: message_address_parse() - don't stop at <> when parsing address lists
Timo Sirainen [Wed, 7 Jun 2017 12:21:10 +0000 (15:21 +0300)] 
lib-mail: message_address_parse() - don't stop at <> when parsing address lists

And similarly don't stop at <@domain>

8 years agolib-mail: message_address_parse() - don't stop at invalid addresses when parsing...
Timo Sirainen [Wed, 7 Jun 2017 12:08:27 +0000 (15:08 +0300)] 
lib-mail: message_address_parse() - don't stop at invalid addresses when parsing group

Also the end-group's message_address shouldn't have invalid_syntax=TRUE,
except when we didn't actually find the ending ';'

8 years agolib-mail: message_address_parse() - Fix reading out-of-bounds read on invalid input
Timo Sirainen [Wed, 7 Jun 2017 11:57:12 +0000 (14:57 +0300)] 
lib-mail: message_address_parse() - Fix reading out-of-bounds read on invalid input

8 years agolib-mail: message_address_parse() - Remove unnecessary NULL checks
Timo Sirainen [Wed, 7 Jun 2017 10:34:39 +0000 (13:34 +0300)] 
lib-mail: message_address_parse() - Remove unnecessary NULL checks

message_address_parse() always initialized rfc822_parser_init() with
last_comment string.

8 years agolib-mail: test-message-address - add more and better organized tests
Timo Sirainen [Wed, 7 Jun 2017 10:19:40 +0000 (13:19 +0300)] 
lib-mail: test-message-address - add more and better organized tests

8 years agolib-mail: message_address_parse() - Add INVALID_ROUTE/SYNTAX_ERROR only if fill_missi...
Timo Sirainen [Wed, 7 Jun 2017 09:58:21 +0000 (12:58 +0300)] 
lib-mail: message_address_parse() - Add INVALID_ROUTE/SYNTAX_ERROR only if fill_missing==TRUE

This allows message_address_write() to write the parsed invalid address in a
way that at least somewhat resembles the original input.

8 years agolib-mail: message_address_write() - Write empy username as ""
Timo Sirainen [Wed, 7 Jun 2017 09:42:28 +0000 (12:42 +0300)] 
lib-mail: message_address_write() - Write empy username as ""

We can't output <@domain> because that conflicts with the <@route:...>
syntax. Also ""@domain seems to be a valid address.

8 years agolib-mail: message_address_write() - Always write <user@domain> as output
Timo Sirainen [Wed, 7 Jun 2017 09:37:09 +0000 (12:37 +0300)] 
lib-mail: message_address_write() - Always write <user@domain> as output

This is the standard format nowadays, so don't convert <user@domain> into
plain user@domain.

8 years agolib-mail: message_address_write() - Don't write empty <>
Timo Sirainen [Wed, 7 Jun 2017 09:35:35 +0000 (12:35 +0300)] 
lib-mail: message_address_write() - Don't write empty <>

8 years agolib-mail: message_address_write() - Don't add '@' if domain is missing
Timo Sirainen [Wed, 7 Jun 2017 09:34:17 +0000 (12:34 +0300)] 
lib-mail: message_address_write() - Don't add '@' if domain is missing

8 years agolib-mail: test-message-address - Test also writing invalid addresses
Timo Sirainen [Wed, 7 Jun 2017 09:33:10 +0000 (12:33 +0300)] 
lib-mail: test-message-address - Test also writing invalid addresses

8 years agolib-mail: test-message-address cleanup
Timo Sirainen [Wed, 7 Jun 2017 09:01:07 +0000 (12:01 +0300)] 
lib-mail: test-message-address cleanup

Merge input and output into the same struct to make it clearer.

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 agoquota: assertion for *args != NULL is added in order to avoid warning from static...
Sergey Kitov [Wed, 31 May 2017 11:32:30 +0000 (14:32 +0300)] 
quota: assertion for *args != NULL is added in order to avoid warning from static analyzer and *args[0] changed to (*args)[0]

8 years agodict-cdb: Add simple iteration support
Aki Tuomi [Tue, 6 Jun 2017 10:59:14 +0000 (13:59 +0300)] 
dict-cdb: Add simple iteration support

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: test-utc-mktime: Remove duplicate test
Timo Sirainen [Fri, 7 Apr 2017 06:19:02 +0000 (09:19 +0300)] 
lib: test-utc-mktime: Remove duplicate test

Also fixes a compiler warning when time_t is signed 32bit.

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-oauth2: Make sure fields are always initialized
Aki Tuomi [Tue, 6 Jun 2017 09:47:53 +0000 (12:47 +0300)] 
lib-oauth2: Make sure fields are always initialized

8 years agolib-oauth2: Accept empty responses
Aki Tuomi [Tue, 6 Jun 2017 09:44:55 +0000 (12:44 +0300)] 
lib-oauth2: Accept empty responses

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 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 agolib-auth: Code cleanup - remove unnecessary code
Timo Sirainen [Tue, 30 May 2017 13:23:28 +0000 (16:23 +0300)] 
lib-auth: Code cleanup - remove unnecessary code

Besides being unnecessary, it was also obsolete since not all the strings
were p_strdup()ed.

8 years agopop3: send back auth reply sooner
Josef 'Jeff' Sipek [Tue, 23 May 2017 11:12:49 +0000 (14:12 +0300)] 
pop3: send back auth reply sooner

If possible (i.e., pop3_lock_session=no), we can send back the OK
response earlier.

8 years agopop3: initialize namespaces explicitly
Josef 'Jeff' Sipek [Tue, 23 May 2017 10:01:48 +0000 (13:01 +0300)] 
pop3: initialize namespaces explicitly

(instead of relying on mail user initialization to instantiate them for
us)

8 years agopop3: client_create_from_input shouldn't process input
Josef 'Jeff' Sipek [Fri, 19 May 2017 07:58:18 +0000 (10:58 +0300)] 
pop3: client_create_from_input shouldn't process input

This makes the pop3 code resemble the imap code more.  Making the subsequent
changes easier.

8 years agopop3: client_create_from_input should return the client struct
Josef 'Jeff' Sipek [Fri, 19 May 2017 07:51:22 +0000 (10:51 +0300)] 
pop3: client_create_from_input should return the client struct

This makes the code more similar to imap's, making subsequent changes
easier.

8 years agopop3: rename login_client_connected() client arg to login_client
Josef 'Jeff' Sipek [Fri, 19 May 2017 07:46:05 +0000 (10:46 +0300)] 
pop3: rename login_client_connected() client arg to login_client

This makes the next commit cleaner.

8 years agopop3: move pop3 session locking out of client_create
Josef 'Jeff' Sipek [Fri, 19 May 2017 07:42:03 +0000 (10:42 +0300)] 
pop3: move pop3 session locking out of client_create

As a result, we can directly return the client structure (instead of
passing it back via a _r arg).

This makes the pop3 client_create look more like the imap version.

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 agolib: test-path-util unit test - small fixes and cleanups
Timo Sirainen [Tue, 30 May 2017 07:28:43 +0000 (10:28 +0300)] 
lib: test-path-util unit test - small fixes and cleanups

Don't use /tmp, especially because on OSX it's a symlink to /private/tmp/,
which causes these tests to fail.

8 years agodirector: Use longer timeout for receiving user list in handshake
Timo Sirainen [Wed, 31 May 2017 11:27:16 +0000 (14:27 +0300)] 
director: Use longer timeout for receiving user list in handshake

The sender also has a send timeout, so this allows the sender to abort
early and give a nicer error message.

8 years agodirector: Log more connection state information on handshaking errors
Timo Sirainen [Wed, 31 May 2017 10:42:31 +0000 (13:42 +0300)] 
director: Log more connection state information on handshaking errors

8 years agodirector: Use more accurate timestamps for handshake timeout logging
Timo Sirainen [Wed, 31 May 2017 10:17:37 +0000 (13:17 +0300)] 
director: Use more accurate timestamps for handshake timeout logging

There could be some time between the create, connect and when ME was
received.

8 years agodirector: Fix "sending handshake timed out" error to be actually logged
Timo Sirainen [Wed, 31 May 2017 10:15:04 +0000 (13:15 +0300)] 
director: Fix "sending handshake timed out" error to be actually logged

io was never NULL here, so it was never logged.

8 years agodirector: Fix handshake timeout lengths
Timo Sirainen [Wed, 31 May 2017 10:11:08 +0000 (13:11 +0300)] 
director: Fix handshake timeout lengths

They weren't too bad, but also they weren't what the #defines described.
Also added a separate connect() timeout.

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 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: 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 agoauth: Don't lose all forward_ fields if the first passdb lookup fails.
Timo Sirainen [Tue, 30 May 2017 13:57:45 +0000 (16:57 +0300)] 
auth: Don't lose all forward_ fields if the first passdb lookup fails.

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 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 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 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.