]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
6 years agoimap: GETMETADATA: Replace failed boolean with last_error code
Timo Sirainen [Wed, 24 Jul 2019 12:26:08 +0000 (15:26 +0300)] 
imap: GETMETADATA: Replace failed boolean with last_error code

6 years agoimap: Allow SET/GETMETADATA to access validated attributes with imap_metadata=no
Timo Sirainen [Wed, 24 Jul 2019 12:05:27 +0000 (15:05 +0300)] 
imap: Allow SET/GETMETADATA to access validated attributes with imap_metadata=no

Some IMAP extensions use these commands to set/get their internal state.
This should be allowed even if full METADATA isn't enabled.

The initial plan was to restrict this in the lib-imap-storage layer, so it
would apply to everything using the imap-metadata API. This would have
affected for example accessing metadata in Sieve scripts, which could be
either good or bad. It might not be wanted to give users read access to
some metadata either, but admins really should be given the ability to
write Sieve scripts that access the metadata. However there's just no good
way to differentiate between admin-written (or tool-written) Sieve script
and user-written Sieve script.

Another issue is using metadata to configure virtual mailboxes. Currently
they're all admin-written and should be allowed to access metadata, but in
the future we might want to allow user-written virtual mailbox rules as
well.

So the end result at least for now is to just prevent IMAP GETMETADATA and
SETMETADATA specifically from accessing the non-validated attributes. Most
of the time there aren't any secrets in the metadata. In case there is,
users need to be prevented from accessing metadata via Sieve, and in such
systems users rarely have direct Sieve access anyway.

6 years agolib-imap-metadata: Add imap_metadata_transaction_validated_only()
Timo Sirainen [Tue, 30 Jul 2019 08:04:44 +0000 (11:04 +0300)] 
lib-imap-metadata: Add imap_metadata_transaction_validated_only()

6 years agolib-storage: Add support for "validated attributes"
Timo Sirainen [Wed, 24 Jul 2019 11:42:21 +0000 (14:42 +0300)] 
lib-storage: Add support for "validated attributes"

If an attribute is marked with MAIL_ATTRIBUTE_INTERNAL_FLAG_VALIDATED, it's
assumed to be "validated". This means that it has a set() callback that
validates the value, which at minimum means that its size isn't excessively
large.

MAIL_ATTRIBUTE_TYPE_FLAG_VALIDATED can be used with set/get/iterate to allow
access only to these validated attributes. Trying to access non-validated
attributes will result in error.

6 years agolib-storage: Prepare attribute API for having flags in the type
Timo Sirainen [Tue, 23 Jul 2019 11:42:45 +0000 (12:42 +0100)] 
lib-storage: Prepare attribute API for having flags in the type

6 years agolib-ssl-iostream: Support TLSv1.3 ciphersuites
Aki Tuomi [Mon, 29 Jul 2019 13:08:07 +0000 (16:08 +0300)] 
lib-ssl-iostream: Support TLSv1.3 ciphersuites

6 years agolib-ssl-iostream: test-iostream-ssl - Wait until both sides have handshaked
Aki Tuomi [Mon, 29 Jul 2019 13:17:27 +0000 (16:17 +0300)] 
lib-ssl-iostream: test-iostream-ssl - Wait until both sides have handshaked

Produces consistent result with different TLS flavors

6 years agolib-ssl-iostream: test-iostream-ssl - Plug memory leak
Aki Tuomi [Mon, 29 Jul 2019 13:24:49 +0000 (16:24 +0300)] 
lib-ssl-iostream: test-iostream-ssl - Plug memory leak

If either endpoint fails to initialize it needs to be deinitialized too.

6 years agolib-ssl-iostream: test-iostream-ssl - Always fail on error
Aki Tuomi [Mon, 29 Jul 2019 12:39:20 +0000 (15:39 +0300)] 
lib-ssl-iostream: test-iostream-ssl - Always fail on error

Consistently fail the real function if something goes wrong.
Needed for TLSv1.3 support.

6 years agolib-ssl-iostream: test-iostream-ssl - Explicitly increment idx
Aki Tuomi [Mon, 29 Jul 2019 12:36:21 +0000 (15:36 +0300)] 
lib-ssl-iostream: test-iostream-ssl - Explicitly increment idx

The test_assert macro does not evaluate the idx increment
if the test succeeds.

6 years agostats: event exporters - Support https
Aki Tuomi [Mon, 29 Jul 2019 08:11:11 +0000 (11:11 +0300)] 
stats: event exporters - Support https

6 years agostats: event-exporter - Use DNS for http
Aki Tuomi [Mon, 29 Jul 2019 07:56:52 +0000 (10:56 +0300)] 
stats: event-exporter - Use DNS for http

6 years agostats: Disable chroot to make event exporters work
Aki Tuomi [Mon, 29 Jul 2019 08:20:48 +0000 (11:20 +0300)] 
stats: Disable chroot to make event exporters work

This is mostly needed for dns-client unix socket and
accessing ssl CA certificates.

6 years agodns-client: Make dns client available in login chroot
Aki Tuomi [Mon, 29 Jul 2019 07:56:20 +0000 (10:56 +0300)] 
dns-client: Make dns client available in login chroot

Otherwise it's not possible to use it for login processes.

6 years agomail-crypt: test-mail-key - Skip test before allocating test_pool
Siavash Tavakoli [Fri, 26 Jul 2019 08:55:11 +0000 (11:55 +0300)] 
mail-crypt: test-mail-key - Skip test before allocating test_pool

Fixes a memory leak if test is skipped.

6 years agolib-smtp: test-smtp-payload - exclude ssl cases if ssl not supported
Siavash Tavakoli [Fri, 26 Jul 2019 08:55:05 +0000 (11:55 +0300)] 
lib-smtp: test-smtp-payload - exclude ssl cases if ssl not supported

6 years agolib-http: test-http-payload - Include test_echo_ssl only if ssl is supported
Siavash Tavakoli [Fri, 26 Jul 2019 08:54:47 +0000 (11:54 +0300)] 
lib-http: test-http-payload - Include test_echo_ssl only if ssl is supported

6 years agolib: Allow event filtering with wildcarded integers
Josef 'Jeff' Sipek [Thu, 18 Jul 2019 15:45:28 +0000 (11:45 -0400)] 
lib: Allow event filtering with wildcarded integers

6 years agolib-ssl-iostream: Don't build test-iostream-ssl if building without ssl
Timo Sirainen [Mon, 22 Jul 2019 15:35:05 +0000 (18:35 +0300)] 
lib-ssl-iostream: Don't build test-iostream-ssl if building without ssl

Fixes compiling when building without ssl.

6 years agolib: Correct comment typo (UIID -> UUID)
Josef 'Jeff' Sipek [Wed, 6 Feb 2019 16:33:11 +0000 (11:33 -0500)] 
lib: Correct comment typo (UIID -> UUID)

6 years agolib: test-ostream-multiplex - Check flush return value
Aki Tuomi [Fri, 12 Jul 2019 07:29:00 +0000 (10:29 +0300)] 
lib: test-ostream-multiplex - Check flush return value

Fixes coverity nit

6 years agolib: test-ostream-multiplex - Test corking
Aki Tuomi [Tue, 21 May 2019 09:14:35 +0000 (12:14 +0300)] 
lib: test-ostream-multiplex - Test corking

6 years agolib: ostream-multiplex - Fix last_sent
Aki Tuomi [Wed, 10 Jul 2019 08:25:14 +0000 (11:25 +0300)] 
lib: ostream-multiplex - Fix last_sent

The intention was to choose oldest channel. The old code however
always chose last channel to send, which was not really the point.

Using unix timestamp is also problematic due to sub-second granularity.

6 years agolib: ostream-multiplex - Optimize writing
Aki Tuomi [Tue, 21 May 2019 09:43:46 +0000 (12:43 +0300)] 
lib: ostream-multiplex - Optimize writing

6 years agolib: ostream-multiplex - Implement cork support
Aki Tuomi [Tue, 21 May 2019 08:45:57 +0000 (11:45 +0300)] 
lib: ostream-multiplex - Implement cork support

Support corking for multiplex channels

6 years agolib: ostream-multiplex - Fix code format issue
Aki Tuomi [Wed, 10 Jul 2019 08:16:03 +0000 (11:16 +0300)] 
lib: ostream-multiplex - Fix code format issue

6 years agolib-ssl-iostream: Add unit test
Aki Tuomi [Tue, 21 May 2019 10:34:57 +0000 (13:34 +0300)] 
lib-ssl-iostream: Add unit test

6 years agolib-ssl-iostream: ostream-openssl - Prevent segfault o_stream_get_buffer_*_size(...
Aki Tuomi [Tue, 21 May 2019 10:32:14 +0000 (13:32 +0300)] 
lib-ssl-iostream: ostream-openssl - Prevent segfault o_stream_get_buffer_*_size() when buffer is not allocated yet.

6 years agom4: Substitute variables in modules.m4
Aki Tuomi [Tue, 21 May 2019 10:31:08 +0000 (13:31 +0300)] 
m4: Substitute variables in modules.m4

Otherwise they do not work in Makefiles

6 years agouserdb-passwd: Fix getpwent errno handling
Aki Tuomi [Fri, 5 Oct 2018 07:18:35 +0000 (10:18 +0300)] 
userdb-passwd: Fix getpwent errno handling

In https://bugs.gentoo.org/667118 Reuben Farrelly
noticed that running
    # doveadm user '*'
causes auth daemon to generate errors like:
    auth-worker(3585): Error: getpwent() failed: Invalid argument

This happens because on successful call getpwent()
now sets errno=EINVAL starting from glibc-2.28.
See https://sourceware.org/PR16004 for details.

The fix is to reset 'errno' before 'getpwent()' is called.

Reported-by: Reuben Farrelly
Bug: https://bugs.gentoo.org/667118
Bug: https://sourceware.org/PR16004
Original-Author: Sergei Trofimovich <slyfox@gentoo.org>

6 years agodsync: Fix importing keywords with MAIL_TRANSACTION_SYNC flag set
Timo Sirainen [Fri, 8 Mar 2019 16:39:49 +0000 (18:39 +0200)] 
dsync: Fix importing keywords with MAIL_TRANSACTION_SYNC flag set

Reading transaction logs was handled differently depending on the
MAIL_TRANSACTION_SYNC flag. The flag was set for all transactions written
by dsync.

So for example:
 * doveadm backup mdbox:/tmp/mdbox1 # keywords imported ok
 * doveadm -o mail=mdbox:/tmp/mdbox1 backup mdbox:/tmp/mdbox2 # keywords lost

6 years agolib-smtp: test-smtp-submit - Fix typo in error message
Aki Tuomi [Fri, 5 Jul 2019 11:29:36 +0000 (14:29 +0300)] 
lib-smtp: test-smtp-submit - Fix typo in error message

6 years agoauth: oauth2: set scope to passdb_oauth2_settings
Markus Valentin [Mon, 24 Jun 2019 14:06:19 +0000 (16:06 +0200)] 
auth: oauth2: set scope to passdb_oauth2_settings

6 years agolib-oauth2: append scope to the access request payload
Markus Valentin [Mon, 24 Jun 2019 14:03:37 +0000 (16:03 +0200)] 
lib-oauth2: append scope to the access request payload

6 years agolib: Changed chown to chmod for Linux NFS Flush
Shaun A. Johnson [Mon, 13 Aug 2018 23:43:04 +0000 (16:43 -0700)] 
lib: Changed chown to chmod for Linux NFS Flush

This change switches the chown call to a chmod call in the function
nfs_flush_chown_uid because the chown call was resulting in certain
permission bits being dropped when the nfs attributes were flushed.

Functionality for FreeBSD/Solaris was left unchanged.

6 years agolib: Split up logic in nfs_flush_chown_uid
Shaun A. Johnson [Mon, 13 Aug 2018 23:35:54 +0000 (16:35 -0700)] 
lib: Split up logic in nfs_flush_chown_uid

This splits up the logic of nfs_flush_chown_uid() so that there is an
individual chown call for each platform instead of a single call that is
compiled for both platforms.

This is the first step to adjusting how nfs attributes are flushed on
Linux because of an issue with chown resetting permissions on the files.

6 years agodoveadm: Fix "service stop" to not print "Interrupted system call" error
Timo Sirainen [Fri, 28 Jun 2019 07:10:50 +0000 (10:10 +0300)] 
doveadm: Fix "service stop" to not print "Interrupted system call" error

The "service stop" handler no longer needs to read the VERSION line.
Broken by 2148805a75abd86d1769d9fd20652551cc5c5ac2

6 years agomaster: Handle and report system clock glitches in millisecond resolution internally.
Stephan Bosch [Sun, 16 Dec 2018 13:25:58 +0000 (14:25 +0100)] 
master: Handle and report system clock glitches in millisecond resolution internally.

6 years agomaster: Handle throttling of services in millisecond resolution internally.
Stephan Bosch [Sun, 16 Dec 2018 13:23:15 +0000 (14:23 +0100)] 
master: Handle throttling of services in millisecond resolution internally.

6 years agolib-storage: mail-storage-service: Handle and report system clock glitches in millise...
Stephan Bosch [Sun, 16 Dec 2018 12:56:47 +0000 (13:56 +0100)] 
lib-storage: mail-storage-service: Handle and report system clock glitches in millisecond resolution.

6 years agolib: ioloop: Make the callback for io_loop_set_time_moved_callback() use struct timeval.
Stephan Bosch [Sun, 16 Dec 2018 12:55:34 +0000 (13:55 +0100)] 
lib: ioloop: Make the callback for io_loop_set_time_moved_callback() use struct timeval.

This allows reporting sub-second glitches.

6 years agolib: ioloop: Perform calculcations for the detection of system clock glitches in...
Stephan Bosch [Sun, 16 Dec 2018 13:09:17 +0000 (14:09 +0100)] 
lib: ioloop: Perform calculcations for the detection of system clock glitches in microseconds.

6 years agoglobal: Replace usleep() with i_sleep*_usecs and i_sleep*_msecs().
Stephan Bosch [Thu, 13 Dec 2018 09:23:44 +0000 (10:23 +0100)] 
global: Replace usleep() with i_sleep*_usecs and i_sleep*_msecs().

This prevents overflows and makes sure signal interruptions are handled
appropriately.

6 years agolib: Implement reliable sleep functions i_sleep*_usecs(), i_sleep*_msecs(), and i_sle...
Stephan Bosch [Thu, 13 Dec 2018 09:06:17 +0000 (10:06 +0100)] 
lib: Implement reliable sleep functions i_sleep*_usecs(), i_sleep*_msecs(), and i_sleep*_secs().

Versions with and without support for being interrupted by signals are available.

6 years agolib: time-util: Add timeval_add_usecs() and timeval_sub_usecs().
Stephan Bosch [Thu, 13 Dec 2018 08:53:18 +0000 (09:53 +0100)] 
lib: time-util: Add timeval_add_usecs() and timeval_sub_usecs().

6 years agolib: ioloop: Never decrease wait time counters in ioloop_add_wait_time().
Stephan Bosch [Tue, 11 Dec 2018 19:52:44 +0000 (20:52 +0100)] 
lib: ioloop: Never decrease wait time counters in ioloop_add_wait_time().

Prevents problems when time moves backwards.

6 years agolib: file-lock: Never decrease the wait time counter in file_lock_wait_end().
Stephan Bosch [Tue, 11 Dec 2018 19:54:09 +0000 (20:54 +0100)] 
lib: file-lock: Never decrease the wait time counter in file_lock_wait_end().

Prevents problems when time moves backwards.

6 years agoscript: health-check: add health-check.sh default script
Markus Valentin [Wed, 19 Jun 2019 14:29:49 +0000 (16:29 +0200)] 
script: health-check: add health-check.sh default script

As a example for an simple tcp health check the health-check.sh script
is added. It closes the connection after 10 seconds and only answer to
"PING\n" with a "PONG\n". It is installed by default next to the script
executable.

6 years agoscript: add a parameter -p for passthrough scripts
Markus Valentin [Wed, 19 Jun 2019 12:36:12 +0000 (14:36 +0200)] 
script: add a parameter -p for passthrough scripts

Adding the passthrough option to script, this allows to configure a
script to be straightly called from a socket connection, without
implementing any specific protocol.

6 years agoscript: extract message parsing to separate function
Markus Valentin [Wed, 19 Jun 2019 07:37:39 +0000 (09:37 +0200)] 
script: extract message parsing to separate function

6 years agolib-auth: checking return values of net_addr2ip in unit-test
Markus Valentin [Thu, 20 Jun 2019 08:52:44 +0000 (10:52 +0200)] 
lib-auth: checking return values of net_addr2ip in unit-test

6 years agolib-auth: add unit test for auth_user_info_export
Markus Valentin [Mon, 17 Jun 2019 09:22:45 +0000 (11:22 +0200)] 
lib-auth: add unit test for auth_user_info_export

The test verifies that fields are ending up in the auth request as
expected given a corresponding auth_user_info struct.

6 years agolib-auth: make auth_user_info_export global
Markus Valentin [Mon, 17 Jun 2019 12:07:10 +0000 (14:07 +0200)] 
lib-auth: make auth_user_info_export global

To allow unit-testing this function it becomes global.

6 years agolmtp-proxy: set real_ variables in auth_user_info struct
Markus Valentin [Thu, 13 Jun 2019 18:54:39 +0000 (20:54 +0200)] 
lmtp-proxy: set real_ variables in auth_user_info struct

Set the real_ variables from connection to the client struct and from
there to the auth_user_info. This allows to pass the real_ variables to
lib-auth and thereby to the auth process.

6 years agolib-auth: add real_[remote|local]_[ip|port] to auth_user_info
Markus Valentin [Thu, 13 Jun 2019 18:45:55 +0000 (20:45 +0200)] 
lib-auth: add real_[remote|local]_[ip|port] to auth_user_info

This allows the auth_user_info_export function to export all the real_
variables, if  available, to the auth request thereby enableing real_
variables for lib-auth.

6 years agodoveadm-stats: Print numbers as numbers
Aki Tuomi [Tue, 6 Nov 2018 11:06:49 +0000 (13:06 +0200)] 
doveadm-stats: Print numbers as numbers

Prevents treating numbers as string in JSON printer

6 years agoacl: Use the last line from global ACL file even if it has no LF
Timo Sirainen [Thu, 13 Jun 2019 12:53:40 +0000 (15:53 +0300)] 
acl: Use the last line from global ACL file even if it has no LF

Not all text editors add LF to the last line.

6 years agolib-settings: Note that settings.h is not what it appears to be
Josef 'Jeff' Sipek [Wed, 12 Jun 2019 13:17:56 +0000 (16:17 +0300)] 
lib-settings: Note that settings.h is not what it appears to be

To avoid future confusion.

This also adds a note that the interface should be removed in dovecot 3.0.

6 years agostats: event export - Use transport_timeout in http-post transport
Josef 'Jeff' Sipek [Wed, 12 Jun 2019 08:37:02 +0000 (11:37 +0300)] 
stats: event export - Use transport_timeout in http-post transport

6 years agostats: event export - Introduce a per exporter block transport timeout setting
Josef 'Jeff' Sipek [Wed, 12 Jun 2019 08:36:12 +0000 (11:36 +0300)] 
stats: event export - Introduce a per exporter block transport timeout setting

This commit adds a new per event_exporter { } block setting to specify the
transport timeout.  For example:

event_exporter {
transport = foo
transport_args = ...
transport_timeout = 123msecs

format = bar
format_args = ...
}

Note that this commit only introduces the setting.  The transports will be
changed to make use of it in future commits.

6 years agostats: event export - Increase default http-post timeout to 250ms
Josef 'Jeff' Sipek [Wed, 12 Jun 2019 07:57:02 +0000 (10:57 +0300)] 
stats: event export - Increase default http-post timeout to 250ms

50ms just isn't enough.  A slightly higher latency link combined with a
handful of storage I/Os can easily use up 50ms.

If each event has approximately 4kB memory footprint, then a 250ms timeout
keeps the memory requirement relatively low (50MB on average / 200MB max at
50k events/sec) but still allows a decent amount of time for the HTTP POST
to get sent to and processed by a server in the same datacenter.

6 years agodoveadm-dsync: Clarify why ctx->replicator_notify is checked with noreplicate
Aki Tuomi [Tue, 28 May 2019 07:43:39 +0000 (10:43 +0300)] 
doveadm-dsync: Clarify why ctx->replicator_notify is checked with noreplicate

6 years agodoveadm-dsync: Handle NOREPLICATE error in client
Aki Tuomi [Tue, 28 May 2019 07:41:33 +0000 (10:41 +0300)] 
doveadm-dsync: Handle NOREPLICATE error in client

6 years agodoveadm-dsync: Do not attempt to sync noreplicate user
Aki Tuomi [Tue, 28 May 2019 07:40:15 +0000 (10:40 +0300)] 
doveadm-dsync: Do not attempt to sync noreplicate user

6 years agodoveadm-cmd: Add NOREPLICATE error code
Aki Tuomi [Tue, 28 May 2019 07:39:36 +0000 (10:39 +0300)] 
doveadm-cmd: Add NOREPLICATE error code

6 years agodoveadm-dsync: Set NOREPLICATE error code instead of returning it
Aki Tuomi [Tue, 28 May 2019 07:35:55 +0000 (10:35 +0300)] 
doveadm-dsync: Set NOREPLICATE error code instead of returning it

This is how the error handling is supposed to be done.

Broken in 7f0dcac9942910c2934ceab1230e539043167601

6 years agolib: istream-file - Ensure fd is in valid range
Aki Tuomi [Mon, 27 May 2019 09:56:29 +0000 (12:56 +0300)] 
lib: istream-file - Ensure fd is in valid range

6 years agolib: fd-util - Ensure fd is in valid range
Aki Tuomi [Mon, 27 May 2019 09:55:54 +0000 (12:55 +0300)] 
lib: fd-util - Ensure fd is in valid range

6 years agolib-http: Add http_client_request_add_missing_header()
Timo Sirainen [Mon, 27 May 2019 15:25:38 +0000 (18:25 +0300)] 
lib-http: Add http_client_request_add_missing_header()

6 years agolib-http: Add http_client_request_lookup_header()
Timo Sirainen [Mon, 27 May 2019 14:55:56 +0000 (17:55 +0300)] 
lib-http: Add http_client_request_lookup_header()

6 years agolib-http: http_client_request_remove_header() - Don't crash if no headers are added
Timo Sirainen [Mon, 27 May 2019 14:53:16 +0000 (17:53 +0300)] 
lib-http: http_client_request_remove_header() - Don't crash if no headers are added

Fixes a crash if http_client_request_add_header() hasn't been called
before http_client_request_remove_header()

6 years agolib-http: http_client_request_add_header() - Replace existing header
Timo Sirainen [Mon, 27 May 2019 14:47:16 +0000 (17:47 +0300)] 
lib-http: http_client_request_add_header() - Replace existing header

If header with the same key already exists, just replace the value.
HTTP supports having multiple headers with the same key only when they
can be rewritten into a single comma-separated header. So practically
there's no reason for lib-http to need to support adding multiple
headers. Replacing an existing value is more useful generally.

6 years agolib-http: http_client_request_remove_header() - split off header finding
Timo Sirainen [Mon, 27 May 2019 14:46:37 +0000 (17:46 +0300)] 
lib-http: http_client_request_remove_header() - split off header finding

6 years agolib-http: Add Unit test for http_client_request_add/remove_header()
Timo Sirainen [Mon, 27 May 2019 13:13:28 +0000 (16:13 +0300)] 
lib-http: Add Unit test for http_client_request_add/remove_header()

6 years agodoveadm service status: Handle VERSION handshake line properly
Timo Sirainen [Fri, 24 May 2019 11:49:59 +0000 (14:49 +0300)] 
doveadm service status: Handle VERSION handshake line properly

It was thought to be part of the command response, which caused somewhat
broken replies. Broken by 5c1267b97367b666bd24e6aadfd85ad3902a5b05

6 years agoquota: Enable program-client debug when mail_debug is enabled
Aki Tuomi [Wed, 8 May 2019 09:46:48 +0000 (12:46 +0300)] 
quota: Enable program-client debug when mail_debug is enabled

Makes it easier to see that program-client actually
executed a warning script.

6 years agoquota: Do not skip noenforcing and auto_update quota roots when intializing
Aki Tuomi [Fri, 7 Dec 2018 07:19:08 +0000 (09:19 +0200)] 
quota: Do not skip noenforcing and auto_update quota roots when intializing

Doing so will break quota warnings.

6 years agoquota: Do not set limits to infinity when not enforcing
Aki Tuomi [Fri, 7 Dec 2018 07:14:25 +0000 (09:14 +0200)] 
quota: Do not set limits to infinity when not enforcing

Fixes quota enforcement to work even if secondary quota
is noenforcing.

6 years agoimap-login: Remove extra '+' from state strings in log output
Timo Sirainen [Tue, 18 Sep 2018 22:28:13 +0000 (01:28 +0300)] 
imap-login: Remove extra '+' from state strings in log output

If multiple outgoing commands were in progress, the state should have
said e.g. "state=capability+login", not "state=capability+++login".

6 years agodoveadm service status: Show total number of processes created
Timo Sirainen [Wed, 30 May 2018 11:55:19 +0000 (14:55 +0300)] 
doveadm service status: Show total number of processes created

6 years agodoveadm service status: Support different number of fields returned by master
Timo Sirainen [Wed, 4 Jul 2018 13:17:57 +0000 (16:17 +0300)] 
doveadm service status: Support different number of fields returned by master

6 years agodoveadm: Add doveadm_print_get_headers_count()
Timo Sirainen [Wed, 4 Jul 2018 13:16:36 +0000 (16:16 +0300)] 
doveadm: Add doveadm_print_get_headers_count()

Returns the number of headers added to printer.

6 years agomaster: Track total number of processes created per service
Timo Sirainen [Wed, 30 May 2018 11:54:34 +0000 (14:54 +0300)] 
master: Track total number of processes created per service

6 years agolib-master: Set instance_name to the syslog name
SATOH Fumiyasu [Tue, 1 Jul 2014 10:22:56 +0000 (19:22 +0900)] 
lib-master: Set instance_name to the syslog name

6 years agolib: Linux, OSX, etc: Avoid race conditions showing \xAB chars in ps title
Timo Sirainen [Fri, 18 May 2018 14:29:09 +0000 (17:29 +0300)] 
lib: Linux, OSX, etc: Avoid race conditions showing \xAB chars in ps title

With bad luck "ps" reads the process title when it hasn't been fully
written. Since the trailing NULs are written last and the previous code kept
the ps title otherwise filled with \xAB chars, this could have caused ps
to sometimes show the process title filled with \xAB chars (visible as '?')

6 years agodoveadm: fix who/kick out of order response
Bjørnar Ness [Tue, 17 Apr 2018 14:04:02 +0000 (16:04 +0200)] 
doveadm: fix who/kick out of order response

doveadm-who and kick did not properly flush protocol output
after doveadm_print(), this caused out-of-order response to
clients, example:

C: <tab><tab>who<crlf>
S: +<crlf>
S: username<tab>[...]<missing_crlf>

correct response should have been
S: <username><tab>[...]<crlf>
S: +<crlf>

fixed by adding doveadm_print_flush() calls.

6 years agodoveadm: Add NOREPLICATE error when "noreplicate" user flag is used
Aki Tuomi [Wed, 27 Dec 2017 12:08:13 +0000 (14:08 +0200)] 
doveadm: Add NOREPLICATE error when "noreplicate" user flag is used

It will be only understood if -U flag has been used

6 years agoreplicator: Remove user from replication if NOREPLICATE error is returned
Aki Tuomi [Wed, 27 Dec 2017 12:07:30 +0000 (14:07 +0200)] 
replicator: Remove user from replication if NOREPLICATE error is returned

6 years agolib-imap: Make sure str_unescape() won't be writing past allocated memory
Timo Sirainen [Fri, 17 May 2019 07:33:53 +0000 (10:33 +0300)] 
lib-imap: Make sure str_unescape() won't be writing past allocated memory

The previous commit should already prevent this, but this makes sure it
can't become broken in the future either. It makes the performance a tiny
bit worse, but that's not practically noticeable.

6 years agolib-imap: Don't accept strings with NULs
Timo Sirainen [Fri, 10 May 2019 16:24:51 +0000 (19:24 +0300)] 
lib-imap: Don't accept strings with NULs

IMAP doesn't allow NULs except in binary literals. We'll still allow them
in regular literals as well, but just not in strings.

This fixes a bug with unescaping a string with NULs: str_unescape() could
have been called for memory that points outside the allocated string,
causing heap corruption. This could cause crashes or theoretically even
result in remote code execution exploit.

Found by Nick Roessler and Rafi Rubin

6 years agoNEWS: Add release notes for 2.3.7.1
Timo Sirainen [Mon, 22 Jul 2019 10:45:13 +0000 (13:45 +0300)] 
NEWS: Add release notes for 2.3.7.1

6 years agolib-storage: Namespace prefix shouldn't be included in all mailbox name validity...
Timo Sirainen [Mon, 22 Jul 2019 11:57:34 +0000 (14:57 +0300)] 
lib-storage: Namespace prefix shouldn't be included in all mailbox name validity checks

Broken by 90c2995737cc1f3fe042993beb7b0b32e5375795

6 years agolib: ostream-file: Don't log any errors when setting TCP_NODELAY
Timo Sirainen [Mon, 15 Jul 2019 07:14:23 +0000 (10:14 +0300)] 
lib: ostream-file: Don't log any errors when setting TCP_NODELAY

It's likely never useful to log the error, and it seems more and more
unexpected errors just keep popping up.

6 years agolib-smtp: smtp-params - Assume all capabilities are supported when adding parameter...
Stephan Bosch [Mon, 15 Jul 2019 19:50:11 +0000 (21:50 +0200)] 
lib-smtp: smtp-params - Assume all capabilities are supported when adding parameter event fields.

The actual capabilities are not really needed, since any assigned field is
relevent for event processing, whether the remote end will accept it or not.

This also fixes an assert failure occuring for proxied connections. Since the
server and client (proxy) connections can have different capabilities and since
the client connection does not have a proper capability list available in the
beginning of the handshake, the event created for a client transaction would
cause an assert failure when parameters were assigned that did not match the
capabilities (none).

6 years agoNEWS: Add release notes for 2.3.7
Aki Tuomi [Wed, 10 Jul 2019 08:01:57 +0000 (11:01 +0300)] 
NEWS: Add release notes for 2.3.7

6 years agoNEWS: Add missing 2.3.6 news
Aki Tuomi [Wed, 10 Jul 2019 07:44:45 +0000 (10:44 +0300)] 
NEWS: Add missing 2.3.6 news

6 years agoconfig: Cache converted ssl-parameters.dat result
Timo Sirainen [Fri, 12 Jul 2019 07:22:01 +0000 (10:22 +0300)] 
config: Cache converted ssl-parameters.dat result

This way the ssl-parameters.dat is read only once by the config process
instead of for every config request.

6 years agoconfig: Fix memory leaks when failing to convert ssl-parameters.dat
Timo Sirainen [Fri, 12 Jul 2019 07:16:26 +0000 (10:16 +0300)] 
config: Fix memory leaks when failing to convert ssl-parameters.dat

If ssl_dh setting isn't set and ssl-parameters.dat isn't found or there's
some error reading it, memory is leaked for every config request. This
eventually results in config process dying due to reaching vsz_limit.

6 years agolib-storage: Fix setting \Noinferiors flag for detached INBOX
Timo Sirainen [Thu, 11 Jul 2019 12:08:10 +0000 (15:08 +0300)] 
lib-storage: Fix setting \Noinferiors flag for detached INBOX

The "" namespace is nowadays automatically created, so we can't just check
if mail_namespace_find_prefix() returns NULL.

I left the NULL check there for now at least, just in case there's some
reason I couldn't think of when it could be NULL.

6 years agodict: Exit early to work around various errors and crashes at shutdown
Timo Sirainen [Thu, 11 Jul 2019 11:43:13 +0000 (14:43 +0300)] 
dict: Exit early to work around various errors and crashes at shutdown

This is just a kludge until the dict process cleanup can be done cleanly.