]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
9 years agolib: Add ostream-escaped filter
Aki Tuomi [Mon, 8 Feb 2016 14:22:34 +0000 (16:22 +0200)] 
lib: Add ostream-escaped filter

9 years agodoveadm-print: Fix doveadm_print_json_print_stream
Aki Tuomi [Tue, 9 Feb 2016 08:03:56 +0000 (10:03 +0200)] 
doveadm-print: Fix doveadm_print_json_print_stream

9 years agolib-http: message parser: Made sure that payload stream is always destroyed (hence...
Stephan Bosch [Mon, 8 Feb 2016 21:57:13 +0000 (22:57 +0100)] 
lib-http: message parser: Made sure that payload stream is always destroyed (hence closed) when the next request is to be parsed.

This makes sure that the connection input is always at the correct position
for the next request. Remaining references to the payload stream could
theoretically mess this up.

9 years agolib-http: server: Make sure that any pending request is aborted and destroyed before...
Stephan Bosch [Mon, 8 Feb 2016 21:55:09 +0000 (22:55 +0100)] 
lib-http: server: Make sure that any pending request is aborted and destroyed before connection FDs are closed.

This way, any payload io struct created from the request callback can be
freed before the associated FD becomes invalid. This would cause an assert
failure otherwise.

9 years agolib-http: server: Sometimes a success response was sent before all payload from the...
Stephan Bosch [Mon, 8 Feb 2016 21:53:50 +0000 (22:53 +0100)] 
lib-http: server: Sometimes a success response was sent before all payload from the client request was read.

This can confuse clients, so this is supposed to be prevented.

9 years agolib-http: server: Fixed memory problem reported by Valgrind, which was caused by...
Stephan Bosch [Mon, 8 Feb 2016 21:52:38 +0000 (22:52 +0100)] 
lib-http: server: Fixed memory problem reported by Valgrind, which was caused by the request being freed too early while sending a response.

Fixed by referencing the request while it is being sent.

9 years agolib-http: server: Fixed datastack framing problem in error handling of response sending.
Stephan Bosch [Mon, 8 Feb 2016 21:51:14 +0000 (22:51 +0100)] 
lib-http: server: Fixed datastack framing problem in error handling of response sending.

The returned error string crossed a data stack frame, which wasn't handled correctly.

9 years agolib-http: request parser: Made sure that partially parsed requests never have stale...
Stephan Bosch [Mon, 8 Feb 2016 21:49:28 +0000 (22:49 +0100)] 
lib-http: request parser: Made sure that partially parsed requests never have stale string values.

Due to the fact that we assign method and target fields early for proper
error messages, stale fields from previous requests could have ended up in a
partially parsed new request.

9 years agolib-http: client: Fixed pipelining bug: client sometimes sent new request while still...
Stephan Bosch [Mon, 8 Feb 2016 21:47:30 +0000 (22:47 +0100)] 
lib-http: client: Fixed pipelining bug: client sometimes sent new request while still waiting for 100-continue.

9 years agolib-http: client: Make sure that any pending request is aborted and destroyed before...
Stephan Bosch [Mon, 8 Feb 2016 21:45:54 +0000 (22:45 +0100)] 
lib-http: client: Make sure that any pending request is aborted and destroyed before connection FDs are closed.

This way, any payload io struct created from the response callback can be freed before the associated FD becomes invalid.
This would cause an assert failure otherwise.

9 years agolib-http: Forgot to assign pointer parameter to NULL in request/response parser deini...
Stephan Bosch [Mon, 8 Feb 2016 21:44:52 +0000 (22:44 +0100)] 
lib-http: Forgot to assign pointer parameter to NULL in request/response parser deinit functions.

9 years agoMakefile: Added missing auth-request-stats.h
Timo Sirainen [Tue, 9 Feb 2016 08:34:29 +0000 (10:34 +0200)] 
Makefile: Added missing auth-request-stats.h

9 years agodoveadm auth test/login: Added -M <master user> parameter.
Timo Sirainen [Mon, 8 Feb 2016 16:43:02 +0000 (18:43 +0200)] 
doveadm auth test/login: Added -M <master user> parameter.

9 years agostats: Minor error message cleanup.
Timo Sirainen [Mon, 8 Feb 2016 14:21:40 +0000 (16:21 +0200)] 
stats: Minor error message cleanup.

FIFO stats can come from auth also, not just mail server.

9 years agoauth: If auth_stats=yes, send statistics to stats process.
Timo Sirainen [Mon, 8 Feb 2016 14:20:46 +0000 (16:20 +0200)] 
auth: If auth_stats=yes, send statistics to stats process.

9 years agoman: document dsync -m and -R options
Michael M Slusarz [Fri, 5 Feb 2016 18:36:32 +0000 (11:36 -0700)] 
man: document dsync -m and -R options

9 years agolib-master: Fail if syslog_facility's value is unknown.
Timo Sirainen [Mon, 8 Feb 2016 10:20:34 +0000 (12:20 +0200)] 
lib-master: Fail if syslog_facility's value is unknown.

9 years agoacl: If acl_user is set, use it for ACL username checks. Overrides master_user.
Timo Sirainen [Mon, 8 Feb 2016 10:04:02 +0000 (12:04 +0200)] 
acl: If acl_user is set, use it for ACL username checks. Overrides master_user.

9 years agoauth: Small code cleanup to auth cache - deduplicate code.
Timo Sirainen [Fri, 5 Feb 2016 13:55:36 +0000 (15:55 +0200)] 
auth: Small code cleanup to auth cache - deduplicate code.

No functional changes.

9 years agoauth: Minor code cleanup - fix parameter type
Timo Sirainen [Fri, 5 Feb 2016 13:54:35 +0000 (15:54 +0200)] 
auth: Minor code cleanup - fix parameter type

9 years agoauth: If auth cache lookup results in expired entry, it should be tracked in stats...
Timo Sirainen [Fri, 5 Feb 2016 13:48:25 +0000 (15:48 +0200)] 
auth: If auth cache lookup results in expired entry, it should be tracked in stats as a "miss"

9 years agostats: Removed accidentally commited i_panic() in abb242da
Timo Sirainen [Fri, 5 Feb 2016 13:26:15 +0000 (15:26 +0200)] 
stats: Removed accidentally commited i_panic() in abb242da

9 years agostats: Split stats-connection.[ch] to lib-stats/ and plugin's mail-specific parts.
Timo Sirainen [Fri, 5 Feb 2016 13:07:00 +0000 (15:07 +0200)] 
stats: Split stats-connection.[ch] to lib-stats/ and plugin's mail-specific parts.

9 years agostats: Added ADD-USER command to add stats to a user without having a session.
Timo Sirainen [Fri, 5 Feb 2016 12:55:56 +0000 (14:55 +0200)] 
stats: Added ADD-USER command to add stats to a user without having a session.

This will be used by at least the auth process. Although the auth process
does have a session, it's a bit too early to start using it yet. At least the
PID should be possible to change when the session moves to imap process.
Also the unsuccessful authentication sessions shouldn't really be added at
all.

9 years agostats: Renamed mail-server-connection to fifo-input-connection.
Timo Sirainen [Fri, 5 Feb 2016 12:35:48 +0000 (14:35 +0200)] 
stats: Renamed mail-server-connection to fifo-input-connection.

9 years agolib-mail: Reading from istream-header-filter second time reverted callback's eoh...
Timo Sirainen [Thu, 4 Feb 2016 12:02:42 +0000 (14:02 +0200)] 
lib-mail: Reading from istream-header-filter second time reverted callback's eoh change.

9 years agolib: Fixed calling json_parse_skip_next() within arrays
Timo Sirainen [Thu, 4 Feb 2016 11:32:58 +0000 (13:32 +0200)] 
lib: Fixed calling json_parse_skip_next() within arrays

9 years agolib: If json-parser has JSON_PARSER_NO_ROOT_OBJECT set, return the ending root "...
Timo Sirainen [Thu, 4 Feb 2016 11:31:59 +0000 (13:31 +0200)] 
lib: If json-parser has JSON_PARSER_NO_ROOT_OBJECT set, return the ending root "]" and "}"

9 years agolib: Avoid typeof() if HAVE_TYPEOF isn't set, even if gcc version is high enough.
Timo Sirainen [Wed, 3 Feb 2016 15:56:49 +0000 (17:56 +0200)] 
lib: Avoid typeof() if HAVE_TYPEOF isn't set, even if gcc version is high enough.

This is mainly to test that we can compile without typeof().

9 years agoimap, pop3, imap-urlauth: Added -a <auth-master socket path> parameter
Timo Sirainen [Wed, 3 Feb 2016 12:05:07 +0000 (14:05 +0200)] 
imap, pop3, imap-urlauth: Added -a <auth-master socket path> parameter

9 years ago*-login: Added -l parameter to specify the socket where to connect to after authentic...
Timo Sirainen [Wed, 3 Feb 2016 12:00:16 +0000 (14:00 +0200)] 
*-login: Added -l parameter to specify the socket where to connect to after authentication

9 years agoimap: SETMETADATA shouldn't crash when value parameter is missing.
Timo Sirainen [Wed, 3 Feb 2016 11:56:09 +0000 (13:56 +0200)] 
imap: SETMETADATA shouldn't crash when value parameter is missing.

9 years agolib-sasl: Compiler warning fix for previous EXTERNAL change..
Timo Sirainen [Wed, 3 Feb 2016 11:03:36 +0000 (13:03 +0200)] 
lib-sasl: Compiler warning fix for previous EXTERNAL change..

9 years agolib-sasl: Don't require authid for EXTERNAL mechanism, since we're not really authent...
Timo Sirainen [Wed, 3 Feb 2016 10:29:29 +0000 (12:29 +0200)] 
lib-sasl: Don't require authid for EXTERNAL mechanism, since we're not really authenticating.

9 years agolib-sasl: Added support for EXTERNAL SASL mechanism
Timo Sirainen [Wed, 3 Feb 2016 10:26:10 +0000 (12:26 +0200)] 
lib-sasl: Added support for EXTERNAL SASL mechanism

9 years agodoveadm: Reset JSON formatter context before reuse
Aki Tuomi [Tue, 2 Feb 2016 20:06:38 +0000 (22:06 +0200)] 
doveadm: Reset JSON formatter context before reuse

This is needed to implement multicommand support in HTTP API.

9 years agopop3c: Compiler warning fixes to earlier change
Timo Sirainen [Tue, 2 Feb 2016 10:32:49 +0000 (12:32 +0200)] 
pop3c: Compiler warning fixes to earlier change

9 years agoimapc: Compare INBOX in STATUS case-insensitively.
Timo Sirainen [Mon, 1 Feb 2016 21:32:15 +0000 (23:32 +0200)] 
imapc: Compare INBOX in STATUS case-insensitively.

9 years agosdbox: Failing after saved mails' UIDs were already assigned caused unlink()ing garbage
Timo Sirainen [Mon, 1 Feb 2016 20:48:22 +0000 (22:48 +0200)] 
sdbox: Failing after saved mails' UIDs were already assigned caused unlink()ing garbage

Mainly with dsync when it fails, the transaction is still committed and
mails are given UIDs. If the transaction commit still fails, it attempts to
rollback the saved mails by unlink()ing them, but at that point the path
pointed to an already freed memory. This caused unlink() errors with some
garbage strings as the path (and hopefully no actually valid paths).

The easiest way to reproduce this was to fill up the filesystem with dsync.

9 years agodsync: If mailbox importing fails, stop immediately without waiting for exporter...
Timo Sirainen [Mon, 1 Feb 2016 20:40:15 +0000 (22:40 +0200)] 
dsync: If mailbox importing fails, stop immediately without waiting for exporter to finish.

9 years agoimap: Removed now-unused cmd_sync_callback(), which doesn't work very well.
Timo Sirainen [Mon, 1 Feb 2016 18:30:26 +0000 (20:30 +0200)] 
imap: Removed now-unused cmd_sync_callback(), which doesn't work very well.

See commit message in b7b25e0 for more details.

9 years agoimap: Removed special EXPUNGE callback for an Outlook workaround.
Timo Sirainen [Mon, 1 Feb 2016 18:26:19 +0000 (20:26 +0200)] 
imap: Removed special EXPUNGE callback for an Outlook workaround.

As the comment mentions, this workaround isn't needed if index files are
used.  Hopefully also the Outlook bug itself is gone nowadays.. In any case
the current callback code didn't work, because it was returning FALSE and
causing an assert in a pipelined EXPUNGE+APPEND combination after 6e9454f:

Panic: file imap-client.c: line 862 (client_check_command_hangs): assertion
failed: (!have_wait_unfinished || unfinished_count > 0)

It would probably be possible to fix this, but it would complicate the code
even further, so it's easier just to get rid of this feature. It was easily
triggered by running imaptest stress testing.

9 years agopop3-migration: Ignore mails returned as expunged by pop3c.
Timo Sirainen [Mon, 1 Feb 2016 17:08:24 +0000 (19:08 +0200)] 
pop3-migration: Ignore mails returned as expunged by pop3c.

Whether the -ERR actually meant they were expunged or not is another
issue, but the answer to that belongs to pop3c code. MAIL_ERROR_EXPUNGED
in any case can be safely handled this way here.

9 years agopop3c: If prefetch fails, treat it as if prefetching simply wasn't done.
Timo Sirainen [Mon, 1 Feb 2016 17:07:59 +0000 (19:07 +0200)] 
pop3c: If prefetch fails, treat it as if prefetching simply wasn't done.

This avoids having error handling twice. Also in case the error was caused
by -ERR, this should retry the operation, which even might fix it in some
situations.

9 years agopop3-migration: Use message_header_hash_more() instead of duplicating the code
Timo Sirainen [Mon, 1 Feb 2016 15:57:07 +0000 (17:57 +0200)] 
pop3-migration: Use message_header_hash_more() instead of duplicating the code

9 years agolib-mail: Changed message_header_hash_more() to support any hash algorithm
Timo Sirainen [Mon, 1 Feb 2016 15:56:49 +0000 (17:56 +0200)] 
lib-mail: Changed message_header_hash_more() to support any hash algorithm

9 years agolib: JSON parser can now optionally parse input that isn't an object.
Timo Sirainen [Mon, 1 Feb 2016 15:38:11 +0000 (17:38 +0200)] 
lib: JSON parser can now optionally parse input that isn't an object.

Based on patch by Aki Tuomi.

9 years agolib: Fixed json-parser to correctly parse numbers at EOF.
Timo Sirainen [Mon, 1 Feb 2016 15:30:23 +0000 (17:30 +0200)] 
lib: Fixed json-parser to correctly parse numbers at EOF.

Numbers are a bit special compared to others, because they don't have any
clear character indicating that the number ends. So we can only assume that
the number is finished when EOF is reached, although even that isn't
necessarily correct in case the stream is terminated unexpectedly.

This change is in prepartion for the next change. With current JSON parser
this issue could never happen because "}" was expected just before EOF.

9 years agolib: Code cleanup to json-parser - assume less that the root is an object
Timo Sirainen [Mon, 1 Feb 2016 15:00:11 +0000 (17:00 +0200)] 
lib: Code cleanup to json-parser - assume less that the root is an object

9 years agolib-mail, dsync: Moved dsync_mail_hash_more() to lib-mail/message-header-hash.*
Timo Sirainen [Thu, 28 Jan 2016 22:08:33 +0000 (00:08 +0200)] 
lib-mail, dsync: Moved dsync_mail_hash_more() to lib-mail/message-header-hash.*

9 years agolib-http: Add function to update HTTP response status
Aki Tuomi [Mon, 1 Feb 2016 12:44:11 +0000 (14:44 +0200)] 
lib-http: Add function to update HTTP response status

9 years agodoveadm: Add JSON formatter support
Aki Tuomi [Thu, 21 Jan 2016 17:49:12 +0000 (19:49 +0200)] 
doveadm: Add JSON formatter support

9 years agodoveadm-print: Add flag indicating number-only field
Aki Tuomi [Mon, 25 Jan 2016 08:50:23 +0000 (10:50 +0200)] 
doveadm-print: Add flag indicating number-only field

9 years agoCompiler warning fix to previous commit
Timo Sirainen [Fri, 29 Jan 2016 15:47:52 +0000 (17:47 +0200)] 
Compiler warning fix to previous commit

9 years agoReplace host:port parsers with net_str2hostport().
Timo Sirainen [Fri, 29 Jan 2016 15:42:51 +0000 (17:42 +0200)] 
Replace host:port parsers with net_str2hostport().

9 years agolib: Added net_str2hostport()
Timo Sirainen [Fri, 29 Jan 2016 15:32:30 +0000 (17:32 +0200)] 
lib: Added net_str2hostport()

9 years agolast-login: Added last_login_precision setting
Timo Sirainen [Fri, 29 Jan 2016 14:23:57 +0000 (16:23 +0200)] 
last-login: Added last_login_precision setting

9 years agolib-sasl: Allow plugins to override the default SASL client mechanisms.
Timo Sirainen [Fri, 29 Jan 2016 14:07:35 +0000 (16:07 +0200)] 
lib-sasl: Allow plugins to override the default SASL client mechanisms.

9 years agolib-imap: Write invalid Content-Transfer-Encoding value as "7bit" to BODY/BODYSTRUCTURE.
Timo Sirainen [Fri, 29 Jan 2016 13:09:35 +0000 (15:09 +0200)] 
lib-imap: Write invalid Content-Transfer-Encoding value as "7bit" to BODY/BODYSTRUCTURE.

9 years agolib: Add tests for str_is_float
Aki Tuomi [Fri, 29 Jan 2016 08:29:05 +0000 (10:29 +0200)] 
lib: Add tests for str_is_float

9 years agolib: Add str_is_float check function
Aki Tuomi [Fri, 29 Jan 2016 08:28:53 +0000 (10:28 +0200)] 
lib: Add str_is_float check function

9 years agodsync: Improved header hash v2 algorithm to remove repeated '?' chars.
Timo Sirainen [Thu, 28 Jan 2016 18:47:02 +0000 (20:47 +0200)] 
dsync: Improved header hash v2 algorithm to remove repeated '?' chars.

This is to help with Yahoo that replaces UTF-8 chars in headers with a
single '?' (instead of '?' per each 8bit byte).

9 years agolib-index: Memory leak fix for test-mail-index-map
Timo Sirainen [Thu, 28 Jan 2016 18:23:51 +0000 (20:23 +0200)] 
lib-index: Memory leak fix for test-mail-index-map

This failed when running make check with valgrind.

9 years agopop3-migration: Fix to 5407a86 - don't sync POP3 UIDLs when we don't need to
Timo Sirainen [Thu, 28 Jan 2016 18:16:31 +0000 (20:16 +0200)] 
pop3-migration: Fix to 5407a86 - don't sync POP3 UIDLs when we don't need to

9 years agodsync: Avoid finishing importer successfully on exporter failures.
Timo Sirainen [Thu, 28 Jan 2016 17:56:38 +0000 (19:56 +0200)] 
dsync: Avoid finishing importer successfully on exporter failures.

At least dsync_mailbox_import_changes_finish() could have been called when
exporter was already failed.

9 years agodoveadm backup: If local mailbox has more mails than remote, detect and delete it...
Timo Sirainen [Thu, 28 Jan 2016 17:55:06 +0000 (19:55 +0200)] 
doveadm backup: If local mailbox has more mails than remote, detect and delete it earlier.

9 years agoimapc: Don't mark the initial sync done if it wasn't successful.
Timo Sirainen [Thu, 28 Jan 2016 17:51:43 +0000 (19:51 +0200)] 
imapc: Don't mark the initial sync done if it wasn't successful.

9 years agoimapc: Handle disconnection when NOOP is sent to verify if mail is expunged.
Timo Sirainen [Thu, 28 Jan 2016 17:49:56 +0000 (19:49 +0200)] 
imapc: Handle disconnection when NOOP is sent to verify if mail is expunged.

9 years agolib-index: Added unit test to mail_index_map_lookup_seq_range()
Timo Sirainen [Thu, 28 Jan 2016 17:48:09 +0000 (19:48 +0200)] 
lib-index: Added unit test to mail_index_map_lookup_seq_range()

9 years agoimapc: Don't ignore FETCH, SEARCH and EXPUNGE returning NO failures in syncing.
Timo Sirainen [Thu, 28 Jan 2016 15:53:41 +0000 (17:53 +0200)] 
imapc: Don't ignore FETCH, SEARCH and EXPUNGE returning NO failures in syncing.

Especially if the FETCH 1:* (FLAGS) didn't succeed, we expunged all the
mails from local index.

9 years agoimapc: If FETCH didn't send our wanted data, log the tagged FETCH reply text.
Timo Sirainen [Thu, 28 Jan 2016 15:43:01 +0000 (17:43 +0200)] 
imapc: If FETCH didn't send our wanted data, log the tagged FETCH reply text.

9 years agoimapc: Don't use fetch-fix-broken-mails for NO [LIMIT] FETCH replies
Timo Sirainen [Thu, 28 Jan 2016 15:29:57 +0000 (17:29 +0200)] 
imapc: Don't use fetch-fix-broken-mails for NO [LIMIT] FETCH replies

9 years agoimapc: Remove X-Message-Flag filtering if imapc_features has rfc822.size
Timo Sirainen [Thu, 28 Jan 2016 15:15:20 +0000 (17:15 +0200)] 
imapc: Remove X-Message-Flag filtering if imapc_features has rfc822.size

9 years agodoveadm: All commands iterating mails stop now if doveadm has been killed.
Timo Sirainen [Thu, 28 Jan 2016 15:03:15 +0000 (17:03 +0200)] 
doveadm: All commands iterating mails stop now if doveadm has been killed.

9 years agodoveadm: Enable SIGINT and SIGTERM signal handler for all doveadm mail commands.
Timo Sirainen [Thu, 28 Jan 2016 14:59:48 +0000 (16:59 +0200)] 
doveadm: Enable SIGINT and SIGTERM signal handler for all doveadm mail commands.

Most importantly this allows stopping dsync.

9 years agodoveadm backup: Detect and handle conflicts earlier.
Timo Sirainen [Thu, 28 Jan 2016 14:43:37 +0000 (16:43 +0200)] 
doveadm backup: Detect and handle conflicts earlier.

This avoids doing a lot of work, only for the next doveadm backup to just
delete the entire mailbox and start from the beginning.

9 years agoimapc: Fixed assert-crash in mailbox syncing, if mailbox couldn't be opened.
Timo Sirainen [Thu, 28 Jan 2016 14:26:53 +0000 (16:26 +0200)] 
imapc: Fixed assert-crash in mailbox syncing, if mailbox couldn't be opened.

Usually meaning that syncing was attempted when IMAP server couldn't be
connected to. Fixes the assert:

Panic: file imapc-client.c: line 439 (imapc_client_get_capabilities):
assertion failed: (conn != NULL)

9 years agoimap: Send all pending tagged command replies before APPEND is started.
Timo Sirainen [Thu, 28 Jan 2016 13:36:58 +0000 (15:36 +0200)] 
imap: Send all pending tagged command replies before APPEND is started.

This probably doesn't matter a lot, but it's cleaner.

One side effect of this change is that if multiple APPENDs are pipelined
(without MULTIAPPEND) on the selected mailbox, this now performs a sync
between each APPEND and sends the EXISTS replies. This may be slightly
lower in performance, but it's also slightly more correct behavior.

9 years agolib: Added json_append_escaped_data() to escape non-NUL terminated input.
Timo Sirainen [Thu, 28 Jan 2016 13:16:29 +0000 (15:16 +0200)] 
lib: Added json_append_escaped_data() to escape non-NUL terminated input.

9 years agolib: json_append_escaped() doesn't need to escape the 8bit chars.
Timo Sirainen [Thu, 28 Jan 2016 13:05:38 +0000 (15:05 +0200)] 
lib: json_append_escaped() doesn't need to escape the 8bit chars.

We'll assume that the input is valid UTF-8.

9 years agolib-index: If transaction log was locked for at least 30 secs, log a warning (not...
Timo Sirainen [Thu, 28 Jan 2016 11:45:48 +0000 (13:45 +0200)] 
lib-index: If transaction log was locked for at least 30 secs, log a warning (not at 3min)

This is because we log a warning about it already when locking it took 30
seconds, so it's useful to see which process was actually keeping the lock.

9 years agopop3-migration: Perform UIDL syncing a bit earlier to work around Yahoo IMAP bug.
Timo Sirainen [Wed, 27 Jan 2016 13:44:54 +0000 (15:44 +0200)] 
pop3-migration: Perform UIDL syncing a bit earlier to work around Yahoo IMAP bug.

9 years agoimapc: Don't use fetch-fix-broken-mails for OK and NO [SERVERBUG] FETCH replies
Timo Sirainen [Wed, 27 Jan 2016 13:16:18 +0000 (15:16 +0200)] 
imapc: Don't use fetch-fix-broken-mails for OK and NO [SERVERBUG] FETCH replies

Hopefully no servers are actually returning OK without returning a FETCH
reply. If they are, maybe we need another workaround..

In any case Yahoo IMAP sometimes loses state and starts returning OK without
FETCH replies to all UID FETCH requests (and BADs to FETCHes). It also may
return NO [UNAVAILABLE] for both permanent and temporary FETCH failures, so
we can't do anything with that.

I added NO [SERVERBUG] because that's what Dovecot responds to temporary
failures. I'm not sure how useful that check is though.

9 years agolib: Make static analyzer happier about istream-chain changes
Timo Sirainen [Wed, 27 Jan 2016 08:17:44 +0000 (10:17 +0200)] 
lib: Make static analyzer happier about istream-chain changes

9 years agopop3c: Fixed assert-crash when prefetching a mail failed.
Timo Sirainen [Wed, 27 Jan 2016 00:04:00 +0000 (02:04 +0200)] 
pop3c: Fixed assert-crash when prefetching a mail failed.

9 years ago*-login: Add all returned passdb fields to struct client_auth_reply.all_fields
Timo Sirainen [Tue, 26 Jan 2016 23:12:21 +0000 (01:12 +0200)] 
*-login: Add all returned passdb fields to struct client_auth_reply.all_fields

These will be mainly useful to plugins.

9 years agofts-solr: Changed default operator to AND to fix multi-word queries.
Timo Sirainen [Tue, 26 Jan 2016 22:35:34 +0000 (00:35 +0200)] 
fts-solr: Changed default operator to AND to fix multi-word queries.

Previously for example searching from:foo@example.com was expanded to
foo OR example OR com. Now it's foo AND example AND com, which makes a lot
more sense.

9 years agopop3c: Compiler warning fix for using wrong enum type
Timo Sirainen [Tue, 26 Jan 2016 21:51:16 +0000 (23:51 +0200)] 
pop3c: Compiler warning fix for using wrong enum type

9 years agopop3-migration: If reading message header for hashing fails, fail immediately.
Timo Sirainen [Tue, 26 Jan 2016 20:10:29 +0000 (22:10 +0200)] 
pop3-migration: If reading message header for hashing fails, fail immediately.

This avoids flooding the log with a ton of errors in case the POP3
connection dies.

9 years agodsync: When comparing headers' hashes to match messages, try to normalize the input.
Timo Sirainen [Tue, 26 Jan 2016 17:56:43 +0000 (19:56 +0200)] 
dsync: When comparing headers' hashes to match messages, try to normalize the input.

This is especially useful because some IMAP servers return different data
depending on whether we're fetching only specific header fields, all headers
or entire body. For now we're assuming that any non-ASCII is going to be
replaced with '?', which helps at least with Zimbra and Yahoo. The header
hashing algorithm is now versionable, so it can be modified more easily in
future.

This change should make imapc_features=zimbra-workarounds setting obsolete.

9 years agopop3-migration: Don't change TAB to '?' when calculating header hash.
Timo Sirainen [Tue, 26 Jan 2016 15:55:10 +0000 (17:55 +0200)] 
pop3-migration: Don't change TAB to '?' when calculating header hash.

9 years agopop3-migration: Don't even try to match message sizes with pop3_migration_skip_size_c...
Timo Sirainen [Tue, 26 Jan 2016 15:53:28 +0000 (17:53 +0200)] 
pop3-migration: Don't even try to match message sizes with pop3_migration_skip_size_check=yes

This skipped the header check for mailboxes that had only a single mail.

9 years agopop3c: Added support for TOP/RETR prefetching when PIPIELINING capability exists.
Timo Sirainen [Tue, 26 Jan 2016 13:41:16 +0000 (15:41 +0200)] 
pop3c: Added support for TOP/RETR prefetching when PIPIELINING capability exists.

9 years agopop3c: Added full support for running commands asynchronously (with PIPELINING)
Timo Sirainen [Tue, 26 Jan 2016 13:40:09 +0000 (15:40 +0200)] 
pop3c: Added full support for running commands asynchronously (with PIPELINING)

9 years agopop3c: Increased command timeout from 30s to 5mins.
Timo Sirainen [Tue, 26 Jan 2016 13:38:13 +0000 (15:38 +0200)] 
pop3c: Increased command timeout from 30s to 5mins.

Possibly should be made configurable, but use this for now.

9 years agopop3-migration: Cached header hashes weren't actually being used for imapc.
Timo Sirainen [Tue, 26 Jan 2016 13:22:50 +0000 (15:22 +0200)] 
pop3-migration: Cached header hashes weren't actually being used for imapc.

We'll need to do the search twice: Once to find out the actual cached header
hashes and then second time do a search for the message headers excluding the
emails whose hashes we already know. This allows prefetching to work for imapc
without prefetching all the emails as it was doing.

9 years agolib: istream-concat now seeks parent streams to correct offset.
Timo Sirainen [Tue, 26 Jan 2016 13:20:48 +0000 (15:20 +0200)] 
lib: istream-concat now seeks parent streams to correct offset.

All of the streams' offsets were somewhat random.

9 years agolib: Small istream-concat code cleanup in preperation for next change
Timo Sirainen [Tue, 26 Jan 2016 13:17:34 +0000 (15:17 +0200)] 
lib: Small istream-concat code cleanup in preperation for next change

No actual changes, just moved some code into i_stream_concat_skip().

9 years agolib: Improved test-istream-seekable unit test to check for parent stream's offset...
Timo Sirainen [Tue, 26 Jan 2016 12:19:23 +0000 (14:19 +0200)] 
lib: Improved test-istream-seekable unit test to check for parent stream's offset at the end

9 years agolib: When closing istream-chain, make sure parent stream is seeked to correct offset.
Timo Sirainen [Tue, 26 Jan 2016 11:51:47 +0000 (13:51 +0200)] 
lib: When closing istream-chain, make sure parent stream is seeked to correct offset.

We were only seeking it earlier if it ended at EOF.