]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agolib-smtp: server: MAIL command: Make sure conn->state.pending_mail_cmds cannot decrem...
Stephan Bosch [Sun, 4 Mar 2018 22:42:45 +0000 (23:42 +0100)] 
lib-smtp: server: MAIL command: Make sure conn->state.pending_mail_cmds cannot decrement through zero.

Added assertion.

7 years agolib-smtp: server: Fix double decrement of RCPT pending counter upon error.
Stephan Bosch [Sun, 4 Mar 2018 22:35:53 +0000 (23:35 +0100)] 
lib-smtp: server: Fix double decrement of RCPT pending counter upon error.

The pending counter was sometimes decremented twice in specific error
conditions, leading to an assert panic in the DATA command. This was caused by
some dead code. If the MAIL command failed in a pipeline before the RCPT command,
the assert was triggered.

Panic was:

Panic: file smtp-server-cmd-data.c: line 354 (cmd_data_start): assertion failed: (conn->state.pending_mail_cmds == 0 && conn->state.pending_rcpt_cmds == 0)

7 years agolib-storage: Fix memory leak when search accessed headers but found no mails
Timo Sirainen [Thu, 1 Mar 2018 15:59:34 +0000 (17:59 +0200)] 
lib-storage: Fix memory leak when search accessed headers but found no mails

For example fetching headers with UID FETCH for a nonexistent UID.

7 years agolib-storage: Code cleanup - remove unnecessary temporary variable
Timo Sirainen [Thu, 1 Mar 2018 15:55:50 +0000 (17:55 +0200)] 
lib-storage: Code cleanup - remove unnecessary temporary variable

7 years agolib-storage: test-mail-storage - add check for mailbox_create() return value
Timo Sirainen [Thu, 1 Mar 2018 18:12:35 +0000 (20:12 +0200)] 
lib-storage: test-mail-storage - add check for mailbox_create() return value

7 years agolib-smtp: server: Only accept XCLIENT command when the XCLIENT capability is active.
Stephan Bosch [Thu, 1 Mar 2018 13:53:11 +0000 (14:53 +0100)] 
lib-smtp: server: Only accept XCLIENT command when the XCLIENT capability is active.

Report "502 Unsupported command" otherwise. Before, it would complain about the
client not being trusted, which is confusing.

7 years agolib-smtp: client: Make clear that XCLIENT is not sent if the server has no support.
Stephan Bosch [Thu, 1 Mar 2018 13:52:06 +0000 (14:52 +0100)] 
lib-smtp: client: Make clear that XCLIENT is not sent if the server has no support.

7 years agolib-storage: Deduplicate headers in struct mailbox_header_lookup_ctx
Timo Sirainen [Thu, 21 Jul 2016 14:32:52 +0000 (08:32 -0600)] 
lib-storage: Deduplicate headers in struct mailbox_header_lookup_ctx

This might slightly improve performance.

7 years agolib-storage: Add tests for mailbox_verify_name
Aki Tuomi [Wed, 29 Nov 2017 09:51:57 +0000 (11:51 +0200)] 
lib-storage: Add tests for mailbox_verify_name

7 years agolib-storage: test-mail-storage - Add framework for doing storage tests
Aki Tuomi [Wed, 29 Nov 2017 09:42:39 +0000 (11:42 +0200)] 
lib-storage: test-mail-storage - Add framework for doing storage tests

7 years agocydir: Fix crash when using mailbox_get_metadata()
Timo Sirainen [Sat, 17 Feb 2018 21:33:45 +0000 (23:33 +0200)] 
cydir: Fix crash when using mailbox_get_metadata()

7 years agombox: Fix creating mailbox when mailbox_update struct is given without uidvalidity
Timo Sirainen [Sat, 17 Feb 2018 21:26:55 +0000 (23:26 +0200)] 
mbox: Fix creating mailbox when mailbox_update struct is given without uidvalidity

This especially fixes a crash when creating mboxes with LAYOUT=index:

Panic: file mbox-sync.c: line 1241 (mbox_write_pseudo): assertion failed: (uid_validity != 0)

7 years agombox: Default INBOX=<root path>/inbox only with LAYOUT=fs
Timo Sirainen [Sat, 17 Feb 2018 21:19:29 +0000 (23:19 +0200)] 
mbox: Default INBOX=<root path>/inbox only with LAYOUT=fs

It's likely not a valid path with other layouts.

7 years agoLAYOUT=index: Don't mkdir index root directory at init
Timo Sirainen [Sat, 17 Feb 2018 21:16:38 +0000 (23:16 +0200)] 
LAYOUT=index: Don't mkdir index root directory at init

It's not really needed, since anything that needs it will automatically
mkdir it later as well. This also breaks using LAYOUT=index with mbox,
because the mbox code hasn't yet had a chance to override the index root
path so it was mkdired without the .imap/ suffix.

7 years agombox: Enable .imap/ index directories with all layouts
Timo Sirainen [Sat, 17 Feb 2018 20:59:23 +0000 (22:59 +0200)] 
mbox: Enable .imap/ index directories with all layouts

LAYOUT=fs isn't any special here. The mboxes are created as files just the same
for LAYOUT=Maildir++ and for LAYOUT=index and it's not possible to create index
files under them.

7 years agoLAYOUT=index: Don't prevent using internal mailbox names
Timo Sirainen [Sat, 17 Feb 2018 20:28:35 +0000 (22:28 +0200)] 
LAYOUT=index: Don't prevent using internal mailbox names

For example with Maildir it wasn't possible to create mailboxes named "new",
"cur" or "tmp".

7 years agolib-storage: Add and use MAILBOX_LIST_PROP_NO_INTERNAL_NAMES
Timo Sirainen [Sat, 17 Feb 2018 20:25:20 +0000 (22:25 +0200)] 
lib-storage: Add and use MAILBOX_LIST_PROP_NO_INTERNAL_NAMES

Use it to replace Maildir++ check to see if mailbox_list.is_internal_name()
is wanted to be used.

7 years agolib-storage: mailbox_verify_name() - Deduplicate error handling
Timo Sirainen [Sat, 17 Feb 2018 20:04:52 +0000 (22:04 +0200)] 
lib-storage: mailbox_verify_name() - Deduplicate error handling

7 years agolib-storage: mailbox_verify_name() - Move prefix check to its own function
Timo Sirainen [Sat, 17 Feb 2018 20:02:38 +0000 (22:02 +0200)] 
lib-storage: mailbox_verify_name() - Move prefix check to its own function

No functional changes.

7 years agolib-storage: mailbox_verify_name() - Add comments for separator checks
Timo Sirainen [Sat, 17 Feb 2018 19:50:10 +0000 (21:50 +0200)] 
lib-storage: mailbox_verify_name() - Add comments for separator checks

7 years agoexample-config: Add mail_attachment_detection_options
Timo Sirainen [Wed, 28 Feb 2018 13:09:02 +0000 (15:09 +0200)] 
example-config: Add mail_attachment_detection_options

7 years agoimapc: Fix assert-crash after detecting that multiple expunged mail reappear
Timo Sirainen [Wed, 21 Feb 2018 15:04:16 +0000 (17:04 +0200)] 
imapc: Fix assert-crash after detecting that multiple expunged mail reappear

The first imapc_mailbox_set_corrupted() call started a reconnect. The second
call crashed with:

Panic: file imapc-client.c: line 414 (imapc_client_mailbox_reconnect): assertion failed: (!box->reconnecting)

7 years agom4: Use -U and -D in cc_fortify
Aki Tuomi [Sun, 25 Feb 2018 07:35:43 +0000 (09:35 +0200)] 
m4: Use -U and -D in cc_fortify

Not just -D. This is to test the same thing
that gets used.

7 years agom4: Remove pthread from tests
Aki Tuomi [Sun, 25 Feb 2018 07:35:19 +0000 (09:35 +0200)] 
m4: Remove pthread from tests

7 years agolmtp: proxy: Use source_ip proxy field if it is returned from passdb.
Stephan Bosch [Tue, 27 Feb 2018 21:56:20 +0000 (22:56 +0100)] 
lmtp: proxy: Use source_ip proxy field if it is returned from passdb.

Before, it was ignored. Now, it is used as the source IP for the outgoing LMTP
client connection.

7 years agolmtp: proxy: Use per-connection SMTP client settings.
Stephan Bosch [Tue, 27 Feb 2018 22:13:33 +0000 (23:13 +0100)] 
lmtp: proxy: Use per-connection SMTP client settings.

This is needed for setting source IP in later change. The peer_trusted setting
must me moved, since this setting is overriden by per-connection settings,
rather than merged.

7 years agolib-smtp: client: Add support for connecting from an explicit source IP.
Stephan Bosch [Tue, 27 Feb 2018 20:58:17 +0000 (21:58 +0100)] 
lib-smtp: client: Add support for connecting from an explicit source IP.

7 years agolib: connection: Added support for connecting from an explicit source IP.
Stephan Bosch [Tue, 27 Feb 2018 20:56:55 +0000 (21:56 +0100)] 
lib: connection: Added support for connecting from an explicit source IP.

7 years agoimapc: Fix crash when untagged FETCH reply doesn't have key-value pairs
Timo Sirainen [Tue, 27 Feb 2018 10:26:09 +0000 (12:26 +0200)] 
imapc: Fix crash when untagged FETCH reply doesn't have key-value pairs

The last key with the missing value is just silently ignored.

7 years agolib-http: client: Fix request statistics text to properly report send attempts.
Stephan Bosch [Tue, 27 Feb 2018 09:45:26 +0000 (10:45 +0100)] 
lib-http: client: Fix request statistics text to properly report send attempts.

If the request was first sent in the same ioloop cycle in which the text is
generated, the text would claim it was not sent at all yet.

With this commit the text now explicitly makes the distinction between request
attempts and actual send attempts. The number of attempts is increased at each
retry, while the send attempts are increased each time the request is actually
being sent to a server.

7 years agonotify: Ignore flag and keywords update during saving
Aki Tuomi [Mon, 26 Feb 2018 16:20:30 +0000 (18:20 +0200)] 
notify: Ignore flag and keywords update during saving

They are part of the saving event

7 years agoconfigure: Add spectre variant 2 mitigations
codarrenvelvindron [Sat, 17 Feb 2018 19:28:48 +0000 (14:28 -0500)] 
configure: Add spectre variant 2 mitigations

--enable-hardening adds -mfunction-return=thunk and -mindirect-branch=thunk
compiler options if supported.

7 years agolib-http: client: Add event fields for the number of bytes sent and received for...
Stephan Bosch [Mon, 19 Feb 2018 12:27:39 +0000 (13:27 +0100)] 
lib-http: client: Add event fields for the number of bytes sent and received for each request in the last attempt.

7 years agolib-http: response parser: Record input stream offset for the start of the last parse...
Stephan Bosch [Mon, 19 Feb 2018 12:24:57 +0000 (13:24 +0100)] 
lib-http: response parser: Record input stream offset for the start of the last parsed response.

7 years agolib-http: message parsers: Record beginning of parsed data.
Stephan Bosch [Mon, 19 Feb 2018 12:20:11 +0000 (13:20 +0100)] 
lib-http: message parsers: Record beginning of parsed data.

7 years agolib-http: client: Trigger special events when a request is finished, retried or redir...
Stephan Bosch [Sun, 21 Jan 2018 14:46:49 +0000 (15:46 +0100)] 
lib-http: client: Trigger special events when a request is finished, retried or redirected.

7 years agolib-http: client: Record last status code in the request object.
Stephan Bosch [Sun, 21 Jan 2018 15:19:41 +0000 (16:19 +0100)] 
lib-http: client: Record last status code in the request object.

7 years agolib-http: client: Reset redirect counter when the request is retried.
Stephan Bosch [Sun, 21 Jan 2018 15:08:55 +0000 (16:08 +0100)] 
lib-http: client: Reset redirect counter when the request is retried.

The absence of this reset caused problems when there was a redirect limit and
the request was retried, in which case the limit is reached too soon.

7 years agolib-http: client: Add "host" and "port" fields to request event.
Stephan Bosch [Sun, 21 Jan 2018 15:06:19 +0000 (16:06 +0100)] 
lib-http: client: Add "host" and "port" fields to request event.

7 years agolib-http: client: Use the new http_url_get_port*() functions.
Stephan Bosch [Sun, 21 Jan 2018 15:00:31 +0000 (16:00 +0100)] 
lib-http: client: Use the new  http_url_get_port*() functions.

7 years agolib-http: url: Add functions that obtain the effective port for the URL.
Stephan Bosch [Sun, 21 Jan 2018 14:54:18 +0000 (15:54 +0100)] 
lib-http: url: Add functions that obtain the effective port for the URL.

When no port is set for the URL, it is set to 0. These functions substitute the
applicable default.

7 years agolib-http: Create http-common.h, which contains global definitions shared by client...
Stephan Bosch [Sun, 21 Jan 2018 14:50:37 +0000 (15:50 +0100)] 
lib-http: Create http-common.h, which contains global definitions shared by client and server.

Currently contains only the default HTTP port definitions that used to be
private to the client.

7 years agolmtp: proxy: Do not forward 421 reply (server shutdown) from backend.
Stephan Bosch [Fri, 23 Feb 2018 20:09:42 +0000 (21:09 +0100)] 
lmtp: proxy: Do not forward 421 reply (server shutdown) from backend.

This closes the LMTP connection implicitly. Instead, translate it into a 451
4.4.0 response, just like all the other connection-related failures.

7 years agolib-smtp: client: transaction: Better document the failure handling for incomplete...
Stephan Bosch [Fri, 23 Feb 2018 19:49:48 +0000 (20:49 +0100)] 
lib-smtp: client: transaction: Better document the failure handling for incomplete transactions.

7 years agolib-smtp: client: transaction: Don't call the DATA callbacks upon failure until the...
Stephan Bosch [Fri, 23 Feb 2018 19:43:50 +0000 (20:43 +0100)] 
lib-smtp: client: transaction: Don't call the DATA callbacks upon failure until the transaction is complete.

The transaction is not complete until smtp_client_transaction_send() is called.

7 years agolib-smtp: client: transaction: Properly advance the transaction to the DATA state...
Stephan Bosch [Fri, 23 Feb 2018 17:21:49 +0000 (18:21 +0100)] 
lib-smtp: client: transaction: Properly advance the transaction to the DATA state once the DATA command is to be sent.

7 years agolib-smtp: client: transaction: Use the correct callback for finish timeout.
Stephan Bosch [Fri, 23 Feb 2018 17:16:57 +0000 (18:16 +0100)] 
lib-smtp: client: transaction: Use the correct callback for finish timeout.

7 years agolib-storage: Add NO-FS-VALIDATION flag
Aki Tuomi [Sat, 16 Dec 2017 16:16:10 +0000 (18:16 +0200)] 
lib-storage: Add NO-FS-VALIDATION flag

7 years agolib-storage: Never prevent using '/' in mailbox names with mail_full_filesystem_acces...
Timo Sirainen [Sat, 17 Feb 2018 20:10:17 +0000 (22:10 +0200)] 
lib-storage: Never prevent using '/' in mailbox names with mail_full_filesystem_access=yes

It was already allowed with LAYOUT=fs, but not with e.g. LAYOUT=Maildir++.
Now it's possible to use e.g. SELECT /home/shareduser/Maildir/test.box

7 years agoimapc: Avoid duplicate FETCH BODY.PEEK[] when mail is already expunged
Timo Sirainen [Thu, 22 Feb 2018 13:55:20 +0000 (15:55 +0200)] 
imapc: Avoid duplicate FETCH BODY.PEEK[] when mail is already expunged

When the first FETCH (e.g. as part of mail_prefetch()) indicated that the
mail is already expunged, there's no need to do it again.

7 years agolib: Fix buffer code to satisfy static analyzers
Aki Tuomi [Tue, 20 Feb 2018 10:04:13 +0000 (12:04 +0200)] 
lib: Fix buffer code to satisfy static analyzers

7 years agolib: randgen - Init seed to 0
Aki Tuomi [Thu, 8 Feb 2018 09:56:08 +0000 (11:56 +0200)] 
lib: randgen - Init seed to 0

Satisfies static analyzer, the seed is guaranteed to get
filled with random data.

7 years agotrash: Use TRASH_USER_CONTEXT_REQUIRE
Aki Tuomi [Thu, 8 Feb 2018 09:45:20 +0000 (11:45 +0200)] 
trash: Use TRASH_USER_CONTEXT_REQUIRE

Satisfies static analyzer

7 years agolib-storage: Assert unique_root_dir is set with MAIL_STORAGE_CLASS_FLAG_UNIQUE_ROOT
Timo Sirainen [Mon, 19 Feb 2018 11:21:25 +0000 (13:21 +0200)] 
lib-storage: Assert unique_root_dir is set with MAIL_STORAGE_CLASS_FLAG_UNIQUE_ROOT

7 years agolib-storage: shared driver - Remove copying the child storage's class_flags
Timo Sirainen [Mon, 19 Feb 2018 11:22:02 +0000 (13:22 +0200)] 
lib-storage: shared driver - Remove copying the child storage's class_flags

The shared storage root itself doesn't have any storage, so it shouldn't
need to copy the child storage's class_flags either.

This fixes a crash when shared namespace was created with mdbox storage, and
another mdbox namespace was created afterwards. This had
MAIL_STORAGE_CLASS_FLAG_UNIQUE_ROOT set, but its unique_root_dir is NULL,
which caused a crash in mail_storage_match_class().

7 years agoglobal: Use unix_socket capability in connection.c
Aki Tuomi [Mon, 19 Feb 2018 17:22:42 +0000 (19:22 +0200)] 
global: Use unix_socket capability in connection.c

This is more reliably way to correctly create input stream
with unix socket capability for passing fd's around

7 years agolib: connection - only switch created iostreams
Aki Tuomi [Mon, 19 Feb 2018 17:09:46 +0000 (19:09 +0200)] 
lib: connection - only switch created iostreams

Fixes imap-hibernate: Fatal: master: service(imap-hibernate):
child killed with signal 11 (core dumps disabled)

Broken in 086b73efd1a5812a64acc951366a499d325509a6

7 years agolib-storage: Unless LAYOUT=index, don't rebuild list index on missing INBOX
Timo Sirainen [Mon, 19 Feb 2018 12:44:04 +0000 (14:44 +0200)] 
lib-storage: Unless LAYOUT=index, don't rebuild list index on missing INBOX

7 years agolib-storage: mailbox_list_index_handle_corruption() - Lock mailbox list while rebuilding
Timo Sirainen [Mon, 19 Feb 2018 10:54:53 +0000 (12:54 +0200)] 
lib-storage: mailbox_list_index_handle_corruption() - Lock mailbox list while rebuilding

This guards against simultaneous mailbox create/delete/rename.

7 years agolib-storage: mailbox_list_index_handle_corruption() - Move actual handling to its...
Timo Sirainen [Mon, 19 Feb 2018 10:53:46 +0000 (12:53 +0200)] 
lib-storage: mailbox_list_index_handle_corruption() - Move actual handling to its own function

7 years agolib-storage: Generate snippet while saving new mails
Josef 'Jeff' Sipek [Sun, 18 Feb 2018 23:07:16 +0000 (18:07 -0500)] 
lib-storage: Generate snippet while saving new mails

7 years agolib-storage: Make index_mail_want_cache() global
Timo Sirainen [Mon, 19 Feb 2018 13:43:31 +0000 (15:43 +0200)] 
lib-storage: Make index_mail_want_cache() global

7 years agolib-storage: move snippet generation to mail-save-finish
Josef 'Jeff' Sipek [Sun, 18 Feb 2018 23:06:48 +0000 (18:06 -0500)] 
lib-storage: move snippet generation to mail-save-finish

This is necessary because some storage backends (most notably sdbox) do
not allow getting the mail stream before the mail is fully written out.
(See written_to_disk in sdbox-file.h.)

If we could avoid getting the stream to generate a snippet we could
leave this where it is.

7 years agodoveadm dump: Show body.snippet in human-readable form
Timo Sirainen [Mon, 19 Feb 2018 13:38:13 +0000 (15:38 +0200)] 
doveadm dump: Show body.snippet in human-readable form

7 years agolib-ssl-iostream: Use SSL_CTX_set_ecdh_auto macro
Aki Tuomi [Mon, 19 Feb 2018 07:57:17 +0000 (09:57 +0200)] 
lib-ssl-iostream: Use SSL_CTX_set_ecdh_auto macro

This macro is same for 1.0.2 and 1.1.0 and libressl.

7 years agoimap: If snippet is not available return NIL
Aki Tuomi [Sun, 18 Feb 2018 16:11:18 +0000 (18:11 +0200)] 
imap: If snippet is not available return NIL

7 years agoimap: Fix FETCH SNIPPET
Timo Sirainen [Sat, 17 Feb 2018 22:53:12 +0000 (00:53 +0200)] 
imap: Fix FETCH SNIPPET

1) _BUFFERED flag wasn't set, which caused a missing space before the "SNIPPET".
2) It caused \Seen flag to be added to the mail

7 years agodoveadm sync/backup: Don't override BROKENCHAR if it's already set
Timo Sirainen [Fri, 16 Feb 2018 14:03:46 +0000 (16:03 +0200)] 
doveadm sync/backup: Don't override BROKENCHAR if it's already set

This allows migrating invalid mailbox names by specifying BROKENCHAR.
Previously it would always try to use \003 control character, which isn't
valid character in mailbox names so the mailbox creation would fail.

7 years agocharset-alias: Fix keyvalues iteration
Martti Rannanjärvi [Fri, 16 Feb 2018 14:59:35 +0000 (16:59 +0200)] 
charset-alias: Fix keyvalues iteration

charset-alias-plugin.c:113:27: error: comparison between pointer and zero
character constant [-Werror=pointer-compare]
  for (i = 0; keyvalues[i] != '\0'; i++) {
                           ^~
charset-alias-plugin.c:113:14: note: did you mean to dereference the pointer?
  for (i = 0; keyvalues[i] != '\0'; i++) {

7 years agocharset-alias: Cleanup whitespace
Martti Rannanjärvi [Fri, 16 Feb 2018 14:53:04 +0000 (16:53 +0200)] 
charset-alias: Cleanup whitespace

Remove \r from end of lines and remove trailing whitespace.

7 years agolib-http: client: Simplified return code handling in http_client_request_send_real().
Stephan Bosch [Sat, 17 Feb 2018 14:02:53 +0000 (15:02 +0100)] 
lib-http: client: Simplified return code handling in http_client_request_send_real().

7 years agolib-http: client: Make sure output is used only when valid in http_client_request_sen...
Stephan Bosch [Sat, 17 Feb 2018 13:54:47 +0000 (14:54 +0100)] 
lib-http: client: Make sure output is used only when valid in http_client_request_send_real().

7 years agolib-http: client: Uncork and flush the output stream explicitly after continuing...
Stephan Bosch [Sat, 17 Feb 2018 11:03:41 +0000 (12:03 +0100)] 
lib-http: client: Uncork and flush the output stream explicitly after continuing request payload.

This allows detecting any output stream errors.

7 years agolib-http: client: Hold reference to the connection while continuing request payload.
Stephan Bosch [Sat, 17 Feb 2018 14:17:06 +0000 (15:17 +0100)] 
lib-http: client: Hold reference to the connection while continuing request payload.

Subsequent changes may cause the connection to be destroyed while sending.

7 years agolib-http: client: Continue sending request payload in a separate function.
Stephan Bosch [Sat, 17 Feb 2018 11:01:47 +0000 (12:01 +0100)] 
lib-http: client: Continue sending request payload in a separate function.

7 years agolib-http: client: Hold reference to the connection while sending the next request.
Stephan Bosch [Sat, 17 Feb 2018 14:08:44 +0000 (15:08 +0100)] 
lib-http: client: Hold reference to the connection while sending the next request.

Subsequent changes may cause the connection to be destroyed while sending.

7 years agolib-http: client: Perform output stream error handling in one place.
Stephan Bosch [Sat, 17 Feb 2018 10:32:37 +0000 (11:32 +0100)] 
lib-http: client: Perform output stream error handling in one place.

7 years agolib-http: client: Make http_client_connection_lost() available outside http-client...
Stephan Bosch [Sat, 17 Feb 2018 10:10:05 +0000 (11:10 +0100)] 
lib-http: client: Make http_client_connection_lost() available outside http-client-connection.c.

7 years agolib-http: client: Handle output stream errors in a separate function.
Stephan Bosch [Sat, 17 Feb 2018 10:08:20 +0000 (11:08 +0100)] 
lib-http: client: Handle output stream errors in a separate function.

7 years agolib-http: client: Flush and check output for errors after uncorking.
Stephan Bosch [Sat, 17 Feb 2018 00:25:50 +0000 (01:25 +0100)] 
lib-http: client: Flush and check output for errors after uncorking.

Otherwise, a disconnection event may be missed.

7 years agolib-http: server: Simplified return code handling in http_server_response_send_real().
Stephan Bosch [Sat, 17 Feb 2018 14:37:20 +0000 (15:37 +0100)] 
lib-http: server: Simplified return code handling in http_server_response_send_real().

7 years agolib-http: server: Make sure output is used only when valid in http_server_response_se...
Stephan Bosch [Sat, 17 Feb 2018 14:29:20 +0000 (15:29 +0100)] 
lib-http: server: Make sure output is used only when valid in http_server_response_send_real().

This avoids the need to hold a reference to it.

7 years agolib-http: server: Perform output stream error handling in one place.
Stephan Bosch [Sat, 17 Feb 2018 00:26:02 +0000 (01:26 +0100)] 
lib-http: server: Perform output stream error handling in one place.

7 years agolib-http: server: Flush and check output for errors after uncorking.
Stephan Bosch [Sat, 17 Feb 2018 13:44:49 +0000 (14:44 +0100)] 
lib-http: server: Flush and check output for errors after uncorking.

Otherwise, a disconnection event may be missed.

7 years agolib-http: server: Handle output stream errors in a separate function.
Stephan Bosch [Sat, 17 Feb 2018 13:28:36 +0000 (14:28 +0100)] 
lib-http: server: Handle output stream errors in a separate function.

7 years agolib-smtp: client: Uncork and flush the output stream explicitly after sending commands.
Stephan Bosch [Sat, 17 Feb 2018 09:26:30 +0000 (10:26 +0100)] 
lib-smtp: client: Uncork and flush the output stream explicitly after sending commands.

This allows detecting any output stream errors.

7 years agolib-smtp: client: Perform output stream error handling in one place.
Stephan Bosch [Sat, 17 Feb 2018 00:46:15 +0000 (01:46 +0100)] 
lib-smtp: client: Perform output stream error handling in one place.

7 years agolib-smtp: client: Flush and check output for errors after uncorking.
Stephan Bosch [Fri, 16 Feb 2018 22:49:31 +0000 (23:49 +0100)] 
lib-smtp: client: Flush and check output for errors after uncorking.

Otherwise, a disconnection event may be missed.

7 years agolib-smtp: client: Handle output stream errors in a separate function.
Stephan Bosch [Fri, 16 Feb 2018 22:40:29 +0000 (23:40 +0100)] 
lib-smtp: client: Handle output stream errors in a separate function.

7 years agolib-smtp: server: Perform output stream error handling in one place.
Stephan Bosch [Sat, 17 Feb 2018 00:46:25 +0000 (01:46 +0100)] 
lib-smtp: server: Perform output stream error handling in one place.

7 years agolib-smtp: server: Remove undefined smtp_server_reply_send_more() from smtp-server...
Stephan Bosch [Sat, 17 Feb 2018 09:37:55 +0000 (10:37 +0100)] 
lib-smtp: server: Remove undefined smtp_server_reply_send_more() from smtp-server-private.h.

7 years agolib-smtp: server: Flush and check output for errors after uncorking.
Stephan Bosch [Fri, 16 Feb 2018 09:05:26 +0000 (10:05 +0100)] 
lib-smtp: server: Flush and check output for errors after uncorking.

Otherwise, a disconnection event may be missed.

7 years agolib-smtp: server: STARTTLS command: Properly handle output stream flush error.
Stephan Bosch [Fri, 16 Feb 2018 09:13:35 +0000 (10:13 +0100)] 
lib-smtp: server: STARTTLS command: Properly handle output stream flush error.

7 years agolib-smtp: server: Handle output stream errors in a separate function.
Stephan Bosch [Fri, 16 Feb 2018 09:11:01 +0000 (10:11 +0100)] 
lib-smtp: server: Handle output stream errors in a separate function.

7 years agolib-smtp: server: Use the stream_errno to evaluate output stream errors.
Stephan Bosch [Fri, 16 Feb 2018 08:34:48 +0000 (09:34 +0100)] 
lib-smtp: server: Use the stream_errno to evaluate output stream errors.

Code was using global errno.

7 years agolib-smtp: server: Remove inappropriate assert from MAIL command.
Stephan Bosch [Thu, 15 Feb 2018 23:44:07 +0000 (00:44 +0100)] 
lib-smtp: server: Remove inappropriate assert from MAIL command.

When the MAIL command is next to reply, it is possible to have RCPT commands
that are still pending.

7 years agoimap: Don't enforce sending SNIPPET reply as literal
Timo Sirainen [Fri, 16 Feb 2018 12:49:59 +0000 (14:49 +0200)] 
imap: Don't enforce sending SNIPPET reply as literal

Also change it to use "cur_str" since the reply is never very long.

7 years agoimap: Add parenthesis to FETCH SNIPPET (FUZZY text) response
Timo Sirainen [Fri, 16 Feb 2018 12:46:36 +0000 (14:46 +0200)] 
imap: Add parenthesis to FETCH SNIPPET (FUZZY text) response

Otherwise it violates the RFC 3501 text about FETCH responses.

7 years agoimap: Don't set storage callbacks before namespaces are created
Timo Sirainen [Thu, 15 Feb 2018 16:16:15 +0000 (18:16 +0200)] 
imap: Don't set storage callbacks before namespaces are created

This fixes sending untagged OK/NO notifications from storage (e.g. lock
waits/override notifications). It was broken by
e031d9aaae59a9f79710dc1138b76b69272615a3

7 years agoimap: Add client_create_finish() to finish namespace creation.
Timo Sirainen [Thu, 15 Feb 2018 16:15:16 +0000 (18:15 +0200)] 
imap: Add client_create_finish() to finish namespace creation.