]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agolib-ssl-iostream: Fix boolean misuse in SSL_CTX_set_ecdh_auto usage
Aki Tuomi [Tue, 17 Apr 2018 09:20:26 +0000 (12:20 +0300)] 
lib-ssl-iostream: Fix boolean misuse in SSL_CTX_set_ecdh_auto usage

f8aaa6e63a56085f61f128838ad7a3aa080d9d5b introduced warnings on gcc

7 years agolib-ssl-iostream: Do not handshake further if we are destroying
Aki Tuomi [Tue, 17 Apr 2018 12:58:58 +0000 (15:58 +0300)] 
lib-ssl-iostream: Do not handshake further if we are destroying

7 years agolib: Implement str_sanitize_utf8(). 79/head
Stephan Bosch [Sat, 14 Apr 2018 00:05:51 +0000 (02:05 +0200)] 
lib: Implement str_sanitize_utf8().

Unlike str_sanitize(), this function truncates strings based on a UTF8 code point
limit rather than a maximum size in bytes. Also, the Unicode replacement
character is used to mark invalid/control characters and an ellipsis character
is used to indicate the string truncation. For the normal str_sanitize() this is
done using a question mark and triple dots respectively.

7 years agolib: unichar: Add Horizontal Ellipsis character.
Stephan Bosch [Tue, 17 Apr 2018 19:31:38 +0000 (21:31 +0200)] 
lib: unichar: Add Horizontal Ellipsis character.

7 years agoimapc: Fix expunges+appends in same session with imapc_features=no-msn-updates
Timo Sirainen [Tue, 17 Apr 2018 12:46:41 +0000 (15:46 +0300)] 
imapc: Fix expunges+appends in same session with imapc_features=no-msn-updates

Since the EXPUNGEs were ignored, the sequence numbers weren't updated.
When a new mail arrived, the sequence number sent by the remote IMAP server
pointed to existing mails in imapc's mapping. Fix this by changing the
sequence number if the returned UID is >= next_uid.

Fixes "FETCH UID mismatch" errors.

7 years agolib-ssl-iostream: Make ssl_iostream_unref() private
Timo Sirainen [Mon, 16 Apr 2018 13:29:38 +0000 (16:29 +0300)] 
lib-ssl-iostream: Make ssl_iostream_unref() private

7 years agoglobal: Replace ssl_iostream_unref() with ssl_iostream_destroy()
Timo Sirainen [Mon, 16 Apr 2018 13:28:24 +0000 (16:28 +0300)] 
global: Replace ssl_iostream_unref() with ssl_iostream_destroy()

Destroying performs cleanups correctly.

7 years agolib-master: Add log_core_filter setting to core dump on matching filter
Timo Sirainen [Mon, 16 Apr 2018 11:01:37 +0000 (14:01 +0300)] 
lib-master: Add log_core_filter setting to core dump on matching filter

7 years agolib: Add global core filter, which allows core dumping on matching events
Timo Sirainen [Mon, 16 Apr 2018 11:00:51 +0000 (14:00 +0300)] 
lib: Add global core filter, which allows core dumping on matching events

7 years agolib: Add log types as event categories
Timo Sirainen [Mon, 16 Apr 2018 10:48:38 +0000 (13:48 +0300)] 
lib: Add log types as event categories

This allows using debug, info, warning, error, fatal and panic as
categories.

7 years agolib-master, stats: Send event's log_type to stats process
Timo Sirainen [Mon, 16 Apr 2018 10:39:17 +0000 (13:39 +0300)] 
lib-master, stats: Send event's log_type to stats process

This makes the internal stats protocol incompatible with the previous
version, so major protocol version is increased.

7 years agolib-master: If log_debug is empty, don't set global debug log filter at all
Timo Sirainen [Mon, 16 Apr 2018 10:32:47 +0000 (13:32 +0300)] 
lib-master: If log_debug is empty, don't set global debug log filter at all

global_debug_log_filter==NULL check is a bit faster.

7 years agolib-master: Cleanup - Add new helper function for parsing log filter settings
Timo Sirainen [Mon, 16 Apr 2018 10:32:15 +0000 (13:32 +0300)] 
lib-master: Cleanup - Add new helper function for parsing log filter settings

7 years agolib-master: Rename master_service_log_debug_parse() to master_service_log_filter_parse()
Timo Sirainen [Mon, 16 Apr 2018 10:31:03 +0000 (13:31 +0300)] 
lib-master: Rename master_service_log_debug_parse() to master_service_log_filter_parse()

This function will be used for parsing other settings besides just
log_debug.

7 years agolib-master: If connect() to backend UNIX socket is retried, log a warning
Timo Sirainen [Fri, 13 Apr 2018 13:14:18 +0000 (16:14 +0300)] 
lib-master: If connect() to backend UNIX socket is retried, log a warning

For example if imap-login process needs to retry before it successfully
connects to imap process's socket, a warning is logged. This warning is
important because it means that the imap-login process may have been
sleeping up to 0.5 seconds and causing all the other connections to hang
during it.

It would be better to make this retrying asynchronous, but before spending
time on doing that, lets see if this warning is ever even being logged.

7 years agolib-master: Add how long request took for "Internal auth failure" errors
Timo Sirainen [Fri, 13 Apr 2018 13:12:27 +0000 (16:12 +0300)] 
lib-master: Add how long request took for "Internal auth failure" errors

7 years agolib-storage: Add cydir/mdbox/sdbox/imapc/maildir/mbox/pop3c event categories
Timo Sirainen [Mon, 16 Apr 2018 12:27:49 +0000 (15:27 +0300)] 
lib-storage: Add cydir/mdbox/sdbox/imapc/maildir/mbox/pop3c event categories

7 years agolib-storage: Add mail_storage.event_category
Timo Sirainen [Mon, 16 Apr 2018 12:27:18 +0000 (15:27 +0300)] 
lib-storage: Add mail_storage.event_category

If set, this category is added to mail_storage.event.

7 years agolib-storage: Add mail_storage.event and use it wherever possible
Timo Sirainen [Mon, 16 Apr 2018 12:22:41 +0000 (15:22 +0300)] 
lib-storage: Add mail_storage.event and use it wherever possible

7 years agolib-ssl-iostream: Fix boolean misuse in SSL_CTX_set_ecdh_auto usage
Aki Tuomi [Thu, 12 Apr 2018 10:19:02 +0000 (13:19 +0300)] 
lib-ssl-iostream: Fix boolean misuse in SSL_CTX_set_ecdh_auto usage

Fixes compiler nit on clang

7 years agolib-ssl-iostream: Fix openssl compatibility issue introduced in OpenSSL 1.0.2f
Kadlecsik József [Tue, 20 Mar 2018 10:21:33 +0000 (12:21 +0200)] 
lib-ssl-iostream: Fix openssl compatibility issue introduced in OpenSSL 1.0.2f

Fixes dovecot: imap-login: Debug: SSL error: SSL_read() failed: error:140E0197:SSL routines:SSL_shutdown:shutdown while in init

7 years agopo3pc: Handle unexpected server disconnections without assert-crash
Timo Sirainen [Fri, 13 Apr 2018 10:33:56 +0000 (13:33 +0300)] 
po3pc: Handle unexpected server disconnections without assert-crash

Fixes: Panic: file pop3c-client.c: line 308 (pop3c_client_wait_one): assertion failed: (client->fd != -1 || client->state == POP3C_CLIENT_STATE_CONNECTING)
7 years agodoveconf: Fix infinite loop when hiding sensitive information
Timo Sirainen [Thu, 12 Apr 2018 13:07:31 +0000 (16:07 +0300)] 
doveconf: Fix infinite loop when hiding sensitive information

For example with "nopassword=y". Broken in
fc02343fd81a6fab272ac0366b15fc60ec44a8b6

7 years agolib-smtp: Fix empty address parsing
Timo Sirainen [Thu, 12 Apr 2018 11:27:50 +0000 (14:27 +0300)] 
lib-smtp: Fix empty address parsing

sret wasn't initialized, which could have randomly caused "Path only
consists of source route" error with empty addresses. Broken by
81c8955e3d1475c6ab1892b1d3edf91126683fda

7 years agosubmission: Add workarounds for well-known MAIL and RCPT command syntax deviations.
Stephan Bosch [Sun, 8 Apr 2018 13:53:37 +0000 (15:53 +0200)] 
submission: Add workarounds for well-known MAIL and RCPT command syntax deviations.

This adds a new `submission_client_workarounds' setting that works analogous to
the `imap_client_workarounds' setting.

Workarounds:

- whitespace-before-path: Allow one or more spaces or tabs between `MAIL FROM:'
                          and path and between `RCPT TO:' and path.
- mailbox-for-path:       Allow using bare Mailbox syntax (i.e., without <...>)
                          instead of full path syntax.

7 years agolib-smtp: test-smtp-server-errors: Add tests for RCPT command workarounds.
Stephan Bosch [Sun, 8 Apr 2018 13:03:00 +0000 (15:03 +0200)] 
lib-smtp: test-smtp-server-errors: Add tests for RCPT command workarounds.

7 years agolib-smtp: test-smtp-server-errors: Add tests for MAIL command workarounds.
Stephan Bosch [Sun, 8 Apr 2018 12:59:17 +0000 (14:59 +0200)] 
lib-smtp: test-smtp-server-errors: Add tests for MAIL command workarounds.

7 years agolib-smtp: test-smtp-server-errors: Add tests for bad RCPT command syntax.
Stephan Bosch [Sun, 8 Apr 2018 12:40:12 +0000 (14:40 +0200)] 
lib-smtp: test-smtp-server-errors: Add tests for bad RCPT command syntax.

7 years agolib-smtp: test-smtp-server-errors: Add tests for bad MAIL command syntax.
Stephan Bosch [Sun, 8 Apr 2018 12:07:50 +0000 (14:07 +0200)] 
lib-smtp: test-smtp-server-errors: Add tests for bad MAIL command syntax.

7 years agolib-smtp: test-smtp-server-errors: Implicitly stop server when all expected client...
Stephan Bosch [Sun, 8 Apr 2018 13:31:37 +0000 (15:31 +0200)] 
lib-smtp: test-smtp-server-errors: Implicitly stop server when all expected client connections are closed.

7 years agolib-smtp: test-smtp-server-errors: Add more debug messages for the server.
Stephan Bosch [Sun, 8 Apr 2018 13:28:59 +0000 (15:28 +0200)] 
lib-smtp: test-smtp-server-errors: Add more debug messages for the server.

7 years agolib-smtp: test-smtp-server-errors: Make detection of early termination of child proce...
Stephan Bosch [Sun, 8 Apr 2018 13:20:22 +0000 (15:20 +0200)] 
lib-smtp: test-smtp-server-errors: Make detection of early termination of child processes part of each test.

7 years agolib-smtp: test-smtp-server-errors: Add log prefixes for client and server.
Stephan Bosch [Sun, 8 Apr 2018 13:24:02 +0000 (15:24 +0200)] 
lib-smtp: test-smtp-server-errors: Add log prefixes for client and server.

Makes it easier to distinguish which process is sending a log message while
debugging.

7 years agolib-smtp: test-smtp-server-errors: Add support for client-side connection context...
Stephan Bosch [Sun, 8 Apr 2018 13:16:05 +0000 (15:16 +0200)] 
lib-smtp: test-smtp-server-errors: Add support for client-side connection context data.

7 years agolib-smtp: test-smtp-server-errors: Use o_stream_nsend*() rather than o_stream_send*().
Stephan Bosch [Tue, 10 Apr 2018 01:12:41 +0000 (03:12 +0200)] 
lib-smtp: test-smtp-server-errors: Use o_stream_nsend*() rather than o_stream_send*().

The result is not checked anyway.

7 years agolib-smtp: server: Add workarounds for well-known MAIL and RCPT command syntax deviations.
Stephan Bosch [Sun, 8 Apr 2018 10:25:49 +0000 (12:25 +0200)] 
lib-smtp: server: Add workarounds for well-known MAIL and RCPT command syntax deviations.

7 years agolib-smtp: address parser: Do not allow source route for path with omitted brackets.
Stephan Bosch [Sun, 8 Apr 2018 10:13:16 +0000 (12:13 +0200)] 
lib-smtp: address parser: Do not allow source route for path with omitted brackets.

Parse it strictly as a Mailbox, which makes more sense.

7 years agolib-storage: mail-storage-settings: Pre-parse postmaster_address as an SMTP address.
Stephan Bosch [Tue, 6 Mar 2018 22:11:32 +0000 (23:11 +0100)] 
lib-storage: mail-storage-settings: Pre-parse postmaster_address as an SMTP address.

The pre-parsed address is not currently used anywhere, but this does check that
the postmaster address can successfully be converted to an SMTP address, which
is important for Pigeonhole.

7 years agolib-smtp: address: Add source syntax check for conversion from RFC5322 addresses.
Stephan Bosch [Tue, 6 Mar 2018 20:43:22 +0000 (21:43 +0100)] 
lib-smtp: address: Add source syntax check for conversion from RFC5322 addresses.

The message-address parser (for RFC 5322) allows UTF-8 characters in the
localpart, which is not acceptable for SMTP addresses. This change adds a check
that determines whether the source RFC5222 address can be converted into a
SMTP address.

7 years agolib-master: Add own boolean for SSL module loading
Aki Tuomi [Wed, 11 Apr 2018 12:27:42 +0000 (15:27 +0300)] 
lib-master: Add own boolean for SSL module loading

want_ssl_settings isn't reliable enough.

7 years agolib-master: Do not attempt to load SSL module if no SSL support is compiled in
Aki Tuomi [Tue, 10 Apr 2018 13:00:38 +0000 (16:00 +0300)] 
lib-master: Do not attempt to load SSL module if no SSL support is compiled in

Fixes imap-login: Error: imap-login(init): Fatal: Cannot load SSL module: SSL support not compiled in

Broken in 754896551f0422cda5d78500b26700eec5343c5b

Found by bjornar

7 years agolib-program-client: Wait longer in test-program-client-local
Aki Tuomi [Wed, 11 Apr 2018 12:11:23 +0000 (15:11 +0300)] 
lib-program-client: Wait longer in test-program-client-local

Sometiems it can take longer than 1 second to execute, if the test
environment is loaded.

7 years agoimapc: If SELECT INBOX fails with NO, treat it as temporary failure
Timo Sirainen [Wed, 11 Apr 2018 11:19:06 +0000 (14:19 +0300)] 
imapc: If SELECT INBOX fails with NO, treat it as temporary failure

If it's treated as "mailbox doesn't exist", the INBOX autocreation code
will attempt to CREATE INBOX. This is very unlikely to work.

7 years agoimapc: Fix crash when handling empty mailboxes.
Timo Sirainen [Mon, 9 Apr 2018 13:41:19 +0000 (16:41 +0300)] 
imapc: Fix crash when handling empty mailboxes.

Broken by c05b4ac76c4c6012958f1cc37e2fccf7a7d31c33

7 years agolib-mail: message-address: Fix address parser to properly reject angle-addr without...
Stephan Bosch [Tue, 10 Apr 2018 00:41:44 +0000 (02:41 +0200)] 
lib-mail: message-address: Fix address parser to properly reject angle-addr without `>'.

7 years agolib-mail: message-address: Fix assert panic occurring in message_address_parse_path...
Stephan Bosch [Tue, 10 Apr 2018 00:36:44 +0000 (02:36 +0200)] 
lib-mail: message-address: Fix assert panic occurring in message_address_parse_path() when no opening `<' is found.

Panic was:

Panic: file message-address.c: line 147 (parse_angle_addr): assertion failed: (*ctx->parser.data == '<')

7 years agofs-posix: Fix iterating nonexistent symlinks when readdir() returns DT_UNKNOWN
Timo Sirainen [Thu, 29 Mar 2018 18:24:11 +0000 (14:24 -0400)] 
fs-posix: Fix iterating nonexistent symlinks when readdir() returns DT_UNKNOWN

This especially broke "doveadm fs delete -R" when the symlink destination
was deleted before the symlink.

7 years agoimapc: Ignore fetch-msn-workarounds/no-msn-updates during initial FETCH
Timo Sirainen [Sun, 25 Mar 2018 21:01:26 +0000 (00:01 +0300)] 
imapc: Ignore fetch-msn-workarounds/no-msn-updates during initial FETCH

Otherwise duplicate UIDs aren't detected and it causes an assert-crash:

Panic: file imapc-mailbox.c: line 533 (imapc_untagged_fetch): assertion failed: (lseq == mbox->sync_next_lseq)

7 years agolda: Allow empty envelope sender.
Stephan Bosch [Sun, 8 Apr 2018 09:28:19 +0000 (11:28 +0200)] 
lda: Allow empty envelope sender.

Fix by Martin Waschbüsch.

7 years agolda: Reformatted main.c.
Stephan Bosch [Sun, 8 Apr 2018 09:19:18 +0000 (11:19 +0200)] 
lda: Reformatted main.c.

7 years agolib-storage: reintroduce mail_index_set_fsync_mode
Fabian Freyer [Fri, 6 Apr 2018 15:57:30 +0000 (17:57 +0200)] 
lib-storage: reintroduce mail_index_set_fsync_mode

This patch fixes a regression introduced in
638600575ee95f2513c683ef09cb188f76eacd22 where mail_fsync=always would
not be honoured, leading to fatal "nfs flush requires mail_fsync=always"
errors.

7 years agolib-mail: Fix include guards for istream-nonuls.h
Sergey Kitov [Fri, 6 Apr 2018 12:48:02 +0000 (15:48 +0300)] 
lib-mail: Fix include guards for istream-nonuls.h

7 years agodict-fs: iterate: make sure the key is returned as full path
manuel [Mon, 26 Mar 2018 08:58:15 +0000 (10:58 +0200)] 
dict-fs: iterate: make sure the key is returned as full path

Fixes the following assert on iterating:
> Panic: file userdb-dict.c: line 123 (userdb_dict_get_user):
> assertion failed: (strncmp(key, ctx->key_prefix, ctx->key_prefix_len) == 0)

Configuration:
> uri = fs:posix:prefix=/tmp/dict
> iterate_prefix = userdb/
> key userdb {
>   key = userdb/%u
>   format = json
> }

7 years agoFix arc4random build checks
Bill Cole [Mon, 26 Mar 2018 04:52:06 +0000 (00:52 -0400)] 
Fix arc4random build checks

The configure script checks for arc4random() but the actual code uses
arc4random_buf(). This breaks for FreeBSD <8.0 and MacOS X <10.7, which
have the former but not the latter. This change (and an autoreconf run)
solves the problem at the cost of not using the available ARC4
implementation.

7 years agoimapc: Fix local state if mailbox is empty after reconnection
Timo Sirainen [Sun, 25 Mar 2018 20:15:58 +0000 (23:15 +0300)] 
imapc: Fix local state if mailbox is empty after reconnection

If local indexes had more than 0 mails, but after reconnection the remote
IMAP server replied with "* 0 EXISTS", the mails in local index weren't
expunged. This could have resulted in:

Panic: file imapc-sync.c: line 328 (imapc_initial_sync_check): assertion failed: (mail_index_is_expunged(view, lseq) || seq_range_exists(&ctx->mbox->delayed_expunged_uids, luid))

7 years agolib: Simplify murmurhash3 LP64 vs. IPL32 test vectors
Josef 'Jeff' Sipek [Mon, 26 Mar 2018 15:27:45 +0000 (11:27 -0400)] 
lib: Simplify murmurhash3 LP64 vs. IPL32 test vectors

7 years agolib: murmurhash3 produces bytes (not uint32_t's)
Josef 'Jeff' Sipek [Mon, 26 Mar 2018 14:34:25 +0000 (10:34 -0400)] 
lib: murmurhash3 produces bytes (not uint32_t's)

7 years agologin-common: Indicate TLS secured transport on proxied TLS too
Aki Tuomi [Tue, 27 Mar 2018 13:12:46 +0000 (16:12 +0300)] 
login-common: Indicate TLS secured transport on proxied TLS too

7 years agoconfig: Hide more sensitive information
Aki Tuomi [Mon, 12 Mar 2018 07:11:53 +0000 (09:11 +0200)] 
config: Hide more sensitive information

Hide parts of values where we can see a key that has word
key, secret or pass as prefix and is a key-value pair
separated by =.

7 years agoconfig: Move sensitive value hiding to own function
Aki Tuomi [Mon, 12 Mar 2018 07:11:14 +0000 (09:11 +0200)] 
config: Move sensitive value hiding to own function

Simplifies next change

7 years agolib: Add str_nescape
Aki Tuomi [Sat, 10 Mar 2018 16:20:32 +0000 (18:20 +0200)] 
lib: Add str_nescape

For partial escaping

7 years agolib: Add i_strstr_arr for searching string for multiple needles
Aki Tuomi [Sat, 10 Mar 2018 15:56:33 +0000 (17:56 +0200)] 
lib: Add i_strstr_arr for searching string for multiple needles

7 years agoman: doveconf - Document -P flag
Aki Tuomi [Fri, 9 Mar 2018 15:09:28 +0000 (17:09 +0200)] 
man: doveconf - Document -P flag

7 years agolib-master: Fix dns_wildcard_match usage
Arkadiusz Miśkiewicz [Wed, 21 Mar 2018 09:29:26 +0000 (11:29 +0200)] 
lib-master: Fix dns_wildcard_match usage

Broken by 446c0b02a7802b676e893ccc4934fc7318d950ea

7 years agoNEWS: Add v2.3.1
Aki Tuomi [Tue, 20 Mar 2018 08:59:34 +0000 (10:59 +0200)] 
NEWS: Add v2.3.1

7 years agoNEWS: Update to 2.3.0.1
Aki Tuomi [Mon, 19 Mar 2018 09:34:49 +0000 (11:34 +0200)] 
NEWS: Update to 2.3.0.1

7 years agolib-dcrypt: Reformatted test-stream.c.
Stephan Bosch [Sat, 17 Feb 2018 20:51:00 +0000 (21:51 +0100)] 
lib-dcrypt: Reformatted test-stream.c.

7 years agolib-dcrypt: Reformatted test-crypto.c.
Stephan Bosch [Sat, 17 Feb 2018 20:43:06 +0000 (21:43 +0100)] 
lib-dcrypt: Reformatted test-crypto.c.

7 years agolib-dcrypt: Reformatted ostream-encrypt.h.
Stephan Bosch [Sat, 17 Feb 2018 20:10:17 +0000 (21:10 +0100)] 
lib-dcrypt: Reformatted ostream-encrypt.h.

7 years agolib-dcryp: Reformatted ostream-encrypt.c.
Stephan Bosch [Sat, 17 Feb 2018 20:09:16 +0000 (21:09 +0100)] 
lib-dcryp: Reformatted ostream-encrypt.c.

7 years agolib-dcrypt: Reformatted istream-decrypt.h.
Stephan Bosch [Sat, 17 Feb 2018 19:49:14 +0000 (20:49 +0100)] 
lib-dcrypt: Reformatted istream-decrypt.h.

7 years agolib-dcrypt: Reformatted istream-decrypt.c.
Stephan Bosch [Sat, 17 Feb 2018 19:47:19 +0000 (20:47 +0100)] 
lib-dcrypt: Reformatted istream-decrypt.c.

7 years agolib-dcrypt: Reformatted dcrypt-private.h.
Stephan Bosch [Sat, 17 Feb 2018 19:24:42 +0000 (20:24 +0100)] 
lib-dcrypt: Reformatted dcrypt-private.h.

7 years agolib-dcrypt: Reformatted dcrypt-openssl.c.
Stephan Bosch [Sat, 17 Feb 2018 19:15:24 +0000 (20:15 +0100)] 
lib-dcrypt: Reformatted dcrypt-openssl.c.

7 years agolib-dcrypt: Reformatted dcrypt-iostream.h.
Stephan Bosch [Sat, 17 Feb 2018 18:19:22 +0000 (19:19 +0100)] 
lib-dcrypt: Reformatted dcrypt-iostream.h.

7 years agolib-dcrypt: Reformatted dcrypt-gnutls.c.
Stephan Bosch [Sat, 17 Feb 2018 18:18:28 +0000 (19:18 +0100)] 
lib-dcrypt: Reformatted dcrypt-gnutls.c.

7 years agolib-dcrypt: Reformatted dcrypt.h.
Stephan Bosch [Sat, 17 Feb 2018 18:01:48 +0000 (19:01 +0100)] 
lib-dcrypt: Reformatted dcrypt.h.

7 years agolib-drypt: Reformatted dcrypt.c.
Stephan Bosch [Sat, 17 Feb 2018 17:53:19 +0000 (18:53 +0100)] 
lib-drypt: Reformatted dcrypt.c.

7 years agolib-program-client: Add more detailed debug logging.
Stephan Bosch [Mon, 26 Feb 2018 22:12:03 +0000 (23:12 +0100)] 
lib-program-client: Add more detailed debug logging.

7 years agolib-program-client: Use event logging.
Stephan Bosch [Mon, 26 Feb 2018 21:27:40 +0000 (22:27 +0100)] 
lib-program-client: Use event logging.

This also makes the overall log messages better match similar messages produced
by other parts of Dovecot.

7 years agolib-program-client: Use i_close_fd() rather than close() when error is not supposed...
Stephan Bosch [Thu, 15 Mar 2018 23:08:17 +0000 (00:08 +0100)] 
lib-program-client: Use i_close_fd() rather than close() when error is not supposed to happen.

7 years agolib-program-client: Make debug mode for test suite optional.
Stephan Bosch [Mon, 26 Feb 2018 22:26:50 +0000 (23:26 +0100)] 
lib-program-client: Make debug mode for test suite optional.

It is now disabled by default.

7 years agolib-program-client: local: Cleanup any kill timeout while program client is destroyed.
Stephan Bosch [Mon, 26 Feb 2018 17:58:37 +0000 (18:58 +0100)] 
lib-program-client: local: Cleanup any kill timeout while program client is destroyed.

7 years agolib-program-client: local: Make sure the child is dead once the program client is...
Stephan Bosch [Mon, 26 Feb 2018 17:32:32 +0000 (18:32 +0100)] 
lib-program-client: local: Make sure the child is dead once the program client is destroyed.

7 years agolib-program-client: Simplify disconnect handling.
Stephan Bosch [Mon, 26 Feb 2018 17:01:23 +0000 (18:01 +0100)] 
lib-program-client: Simplify disconnect handling.

Perform all of the cleanups in a separate shared function.
Always close all fds, since there is nothing left to be read or written at
disconnect.

7 years agolib-program-client: remote: Don't try to read remaining input at disconnect.
Stephan Bosch [Mon, 26 Feb 2018 17:21:04 +0000 (18:21 +0100)] 
lib-program-client: remote: Don't try to read remaining input at disconnect.

This code is no longer relevant. At disconnect, there is nothing left to be read
by definition.

7 years agolib-program-client: Use iostream-pump for streaming data from program.
Stephan Bosch [Sun, 25 Feb 2018 23:07:10 +0000 (00:07 +0100)] 
lib-program-client: Use iostream-pump for streaming data from program.

7 years agolib-program-client: Destroy timeout once client is passively disconnected.
Stephan Bosch [Mon, 26 Feb 2018 16:16:41 +0000 (17:16 +0100)] 
lib-program-client: Destroy timeout once client is passively disconnected.

7 years agolib-program-client: remote: Initialize program_client_istream with parent FD.
Stephan Bosch [Mon, 26 Feb 2018 16:15:13 +0000 (17:15 +0100)] 
lib-program-client: remote: Initialize program_client_istream with parent FD.

This way, io_add_istream() works as expected.

7 years agolib-program-client: local: Stop immediately when child program without I/O ends.
Stephan Bosch [Mon, 26 Feb 2018 16:12:29 +0000 (17:12 +0100)] 
lib-program-client: local: Stop immediately when child program without I/O ends.

Particularly, don't perform this by calling the input handler.

7 years agolib-program-client: Change return type of program_client_connected() to void.
Stephan Bosch [Mon, 26 Feb 2018 15:52:18 +0000 (16:52 +0100)] 
lib-program-client: Change return type of program_client_connected() to void.

Returning an int status code is no longer useful.

7 years agolib-program-client: Use iostream-pump for streaming data towards program.
Stephan Bosch [Sun, 25 Feb 2018 16:21:47 +0000 (17:21 +0100)] 
lib-program-client: Use iostream-pump for streaming data towards program.

7 years agolib-program-client: Initialize dot streams right after the connection is established.
Stephan Bosch [Sun, 25 Feb 2018 10:43:04 +0000 (11:43 +0100)] 
lib-program-client: Initialize dot streams right after the connection is established.

This avoids creating the dot streams in the input/output handlers, which makes
the code cleaner and easier to port to using iostream-pump.

7 years agolib-program-client: Use iostream-temp rather than istream-seekable for seekable output.
Stephan Bosch [Sun, 25 Feb 2018 08:55:00 +0000 (09:55 +0100)] 
lib-program-client: Use iostream-temp rather than istream-seekable for seekable output.

This considerably simplifies the code.

7 years agolib-program-client: test-program-client-net: Read the client input stream to EOF...
Stephan Bosch [Sun, 25 Feb 2018 16:31:51 +0000 (17:31 +0100)] 
lib-program-client: test-program-client-net: Read the client input stream to EOF after the dot stream is closed.

The low-level file stream is not necessarily read to EOF when the body dot
stream sees EOF.

7 years agolib-program-client: test-program-client-unix: Properly recognize the noreply script...
Stephan Bosch [Sun, 25 Feb 2018 17:38:23 +0000 (18:38 +0100)] 
lib-program-client: test-program-client-unix: Properly recognize the noreply script protocol option.

Somehow the equivalent test-program-client-net code does not have this problem.
And somehow this test did not fail before.

7 years agolib-program-client: test-program-client-net: Destroy test client upon error.
Stephan Bosch [Sun, 25 Feb 2018 17:31:14 +0000 (18:31 +0100)] 
lib-program-client: test-program-client-net: Destroy test client upon error.

This prevents infinite input event loop when something goes wrong.

7 years agolib-program-client: test-program-client-unix: Destroy test client upon error.
Stephan Bosch [Sun, 25 Feb 2018 17:30:12 +0000 (18:30 +0100)] 
lib-program-client: test-program-client-unix: Destroy test client upon error.

This prevents infinite input event loop when something goes wrong.

7 years agolib-program-client: test-program-client-net: Handle test client connections non-blocking.
Stephan Bosch [Sun, 25 Feb 2018 17:03:04 +0000 (18:03 +0100)] 
lib-program-client: test-program-client-net: Handle test client connections non-blocking.

7 years agolib-program-client: test-program-client-unix: Handle test client connections non...
Stephan Bosch [Sun, 25 Feb 2018 17:03:51 +0000 (18:03 +0100)] 
lib-program-client: test-program-client-unix: Handle test client connections non-blocking.