]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
7 years agoReleased v2.3.2.1. release-2.3.2 2.3.2.1
Timo Sirainen [Mon, 9 Jul 2018 07:47:03 +0000 (10:47 +0300)] 
Released v2.3.2.1.

7 years agolib-compression: Fix assert-crash in test suite on 32bit systems
Paul Howarth [Mon, 2 Jul 2018 10:52:14 +0000 (11:52 +0100)] 
lib-compression: Fix assert-crash in test suite on 32bit systems

Fix compilation warnings in test-compression.c due to mismatches
between size_t and uoff_t, which then manifests in assert-crashes
running the test suite on 32bit systems.

7 years agolib-ssl-iostream: Shutdown connection cleanly whenever i/ostream is destroyed
Timo Sirainen [Fri, 6 Jul 2018 08:25:07 +0000 (11:25 +0300)] 
lib-ssl-iostream: Shutdown connection cleanly whenever i/ostream is destroyed

Do this while both istream and ostream still exist. Fixes crash where
openssl_iostream_destroy() attempts to flush the shutdown, but ssl_input
is NULL and it crashes.

7 years agolib-ssl-iostream: Split code to openssl_iostream_shutdown()
Timo Sirainen [Fri, 6 Jul 2018 08:24:41 +0000 (11:24 +0300)] 
lib-ssl-iostream: Split code to openssl_iostream_shutdown()

7 years agolib-storage: Fix memory leak when mail_storage_service_next() is called multiple...
Timo Sirainen [Tue, 12 Jun 2018 13:07:25 +0000 (16:07 +0300)] 
lib-storage: Fix memory leak when mail_storage_service_next() is called multiple times

dsync uses it twice for the same mail_storage_service_user.

7 years agoReleased v2.3.2. 2.3.2
Timo Sirainen [Thu, 28 Jun 2018 14:52:55 +0000 (17:52 +0300)] 
Released v2.3.2.

7 years agoimapc: Fix handling UIDVALIDITY changes
Timo Sirainen [Tue, 19 Jun 2018 09:33:49 +0000 (12:33 +0300)] 
imapc: Fix handling UIDVALIDITY changes

Index was being correctly reset, but the transaction was rolled back.

7 years agolib-index: Make sure error is set on sync & commit failures
Timo Sirainen [Tue, 19 Jun 2018 09:31:43 +0000 (12:31 +0300)] 
lib-index: Make sure error is set on sync & commit failures

This avoids "BUG: Unknown internal index error" after view is marked
inconsistent or after index is deleted.

7 years agoReleased v2.3.2.rc1 2.3.2.rc1
Timo Sirainen [Sat, 16 Jun 2018 22:14:42 +0000 (01:14 +0300)] 
Released v2.3.2.rc1

7 years agolib: When log writing keeps returning EAGAIN, change process title only once
Timo Sirainen [Mon, 18 Jun 2018 14:03:01 +0000 (17:03 +0300)] 
lib: When log writing keeps returning EAGAIN, change process title only once

Otherwise each call will use up data stack memory.

7 years agolib: If log write returns EAGAIN, use poll() instead of ioloop for waiting
Timo Sirainen [Mon, 18 Jun 2018 13:19:55 +0000 (16:19 +0300)] 
lib: If log write returns EAGAIN, use poll() instead of ioloop for waiting

As explained in 861d40b9aebabccae7d48e49a18cbc631ab1fefe commit message,
ioloop can call various callbacks and it can also recurse back to error
logging. Using poll() directly is safer.

7 years agolib: Revert earlier "log write is blocking" handling change
Timo Sirainen [Mon, 18 Jun 2018 13:07:30 +0000 (16:07 +0300)] 
lib: Revert earlier "log write is blocking" handling change

1) It was buggy, because it set O_NONBLOCK rather than removing it.

2) fd flags are shared across all the processes using the fd. We can't
reliably implement the process title update, because some processes are
blocking on the log write() before they change the process title.

Reverts 861d40b9aebabccae7d48e49a18cbc631ab1fefe

7 years agofs-posix: mkdir missing directory if it's changed by FS_METADATA_WRITE_FNAME
Timo Sirainen [Thu, 3 May 2018 12:22:09 +0000 (15:22 +0300)] 
fs-posix: mkdir missing directory if it's changed by FS_METADATA_WRITE_FNAME

The temp file is created to the initial directory. If the directory is
changed by FS_METADATA_WRITE_FNAME, the new destination directory didn't
necessarily exist. If the link() or rename() fails with ENOENT, try to
mkdir the missing directories.

7 years agolib-imap: imap_match_deinit(NULL) should be a no-op
Aki Tuomi [Wed, 31 Jan 2018 17:48:49 +0000 (19:48 +0200)] 
lib-imap: imap_match_deinit(NULL) should be a no-op

7 years agolib: iostream-pump: Make iostream_pump_unref() implementation match other similar...
Stephan Bosch [Sun, 25 Feb 2018 18:13:18 +0000 (19:13 +0100)] 
lib: iostream-pump: Make iostream_pump_unref() implementation match other similar code.

This also means that iostream_pump_unref(NULL) is now a no-op.

7 years agolib-fs: fs_unlock(NULL) should be a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 15:07:38 +0000 (11:07 -0400)] 
lib-fs: fs_unlock(NULL) should be a no-op

7 years agoglobal: start relying on fs_iter_deinit(NULL) being a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 15:03:25 +0000 (11:03 -0400)] 
global: start relying on fs_iter_deinit(NULL) being a no-op

7 years agolib-fs: fs_iter_deinit(NULL) should be a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 15:02:56 +0000 (11:02 -0400)] 
lib-fs: fs_iter_deinit(NULL) should be a no-op

7 years agoglobal: start relying on fs_deinit(NULL) and fs_unref(NULL) being no-ops
Josef 'Jeff' Sipek [Fri, 25 May 2018 14:53:54 +0000 (10:53 -0400)] 
global: start relying on fs_deinit(NULL) and fs_unref(NULL) being no-ops

Cleanup performed with the following semantic patch:

@@
expression E;
@@

- if (E != NULL) {
-  fs_unref(&E);
- }
+ fs_unref(&E);

@@
expression E;
@@

- if (E != NULL) {
-  fs_deinit(&E);
- }
+ fs_deinit(&E);

7 years agolib-fs: fs_unref(NULL) should be a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 14:48:29 +0000 (10:48 -0400)] 
lib-fs: fs_unref(NULL) should be a no-op

7 years agoglobal: start relying on fs_file_close(NULL) being a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 14:38:36 +0000 (10:38 -0400)] 
global: start relying on fs_file_close(NULL) being a no-op

Cleanup performed with the following semantic patch:

@@
expression E;
@@

- if (E != NULL) {
-  fs_file_close(E);
- }
+ fs_file_close(E);

7 years agolib-fs: fs_file_close(NULL) should be a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 14:35:35 +0000 (10:35 -0400)] 
lib-fs: fs_file_close(NULL) should be a no-op

7 years agoglobal: start relying on fs_file_deinit(NULL) being a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 14:31:27 +0000 (10:31 -0400)] 
global: start relying on fs_file_deinit(NULL) being a no-op

Cleanup performed with the following semantic patch:

@@
expression E;
@@

- if (E != NULL) {
-  fs_file_deinit(&E);
- }
+ fs_file_deinit(&E);

7 years agolib-fs: fs_file_deinit(NULL) should be a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 14:18:34 +0000 (10:18 -0400)] 
lib-fs: fs_file_deinit(NULL) should be a no-op

7 years agoglobal: start relying on http_client_request_abort(NULL) being a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 23:13:30 +0000 (19:13 -0400)] 
global: start relying on http_client_request_abort(NULL) being a no-op

Cleanup performed with the following semantic patch:

@@
expression E;
@@

- if (E != NULL) {
-  http_client_request_abort(&E);
- }
+ http_client_request_abort(&E);

7 years agolib-http: http_client_request_abort(NULL) should be a no-op
Josef 'Jeff' Sipek [Fri, 25 May 2018 23:11:35 +0000 (19:11 -0400)] 
lib-http: http_client_request_abort(NULL) should be a no-op

7 years agoimap: Finish client ostream at disconnect
Timo Sirainen [Thu, 7 Jun 2018 11:20:33 +0000 (14:20 +0300)] 
imap: Finish client ostream at disconnect

With IMAP COMPRESS this sends the EOF marker, indicating cleanly closed
connection.

7 years agolib-lua: Remove script from linked list on destroy
Aki Tuomi [Sun, 4 Mar 2018 18:09:21 +0000 (20:09 +0200)] 
lib-lua: Remove script from linked list on destroy

Otherwise it might cause a crash

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 agoglobal: Fix str_begins() usage
Timo Sirainen [Tue, 12 Jun 2018 12:31:35 +0000 (15:31 +0300)] 
global: Fix str_begins() usage

I messed up their cherry-pick merging.

7 years agolda: Fix error message for invalid -r parameter to mention `-r' rather than `-a'.
Stephan Bosch [Wed, 7 Mar 2018 17:56:00 +0000 (18:56 +0100)] 
lda: Fix error message for invalid -r parameter to mention `-r' rather than `-a'.

7 years agolda: Add -r parameter to usage help message.
Stephan Bosch [Wed, 7 Mar 2018 17:54:38 +0000 (18:54 +0100)] 
lda: Add -r parameter to usage help message.

7 years agofts: When indexing virtual mailbox, index each real mailbox entirely
Timo Sirainen [Thu, 3 May 2018 15:33:25 +0000 (18:33 +0300)] 
fts: When indexing virtual mailbox, index each real mailbox entirely

Index all the unindexed messages in them at once, instead of jumping between
real mailboxes and indexing them in small pieces.

7 years agofts: Indexing virtual mailbox didn't always index the last mails
Timo Sirainen [Thu, 3 May 2018 15:33:00 +0000 (18:33 +0300)] 
fts: Indexing virtual mailbox didn't always index the last mails

7 years agofts: Make sure indexing virtual mailbox doesn't recurse and index mail multiple times
Timo Sirainen [Thu, 3 May 2018 15:30:51 +0000 (18:30 +0300)] 
fts: Make sure indexing virtual mailbox doesn't recurse and index mail multiple times

7 years agodoveadm: Fix compiler warning
Timo Sirainen [Fri, 8 Jun 2018 16:56:01 +0000 (19:56 +0300)] 
doveadm: Fix compiler warning

7 years agolib-master: postlogin: Don't unreference already closed login-connection
Timo Sirainen [Thu, 17 May 2018 15:35:04 +0000 (18:35 +0300)] 
lib-master: postlogin: Don't unreference already closed login-connection

If the login-connection was already closed, this caused too many
unreferences.

Fixes:
Panic: file master-login.c: line 544 (master_login_conn_unref): assertion failed: (conn->clients == NULL)

7 years agoauth: Improve auth-master connections' error logging
Timo Sirainen [Fri, 4 May 2018 12:27:14 +0000 (15:27 +0300)] 
auth: Improve auth-master connections' error logging

Include connect and handshake times in the error message.

7 years agolib-master: Add auth connect & handshake times to master_login_auth_request errors
Timo Sirainen [Fri, 4 May 2018 11:14:35 +0000 (14:14 +0300)] 
lib-master: Add auth connect & handshake times to master_login_auth_request errors

7 years agolib-master: Add request time also for internal failure error messages
Timo Sirainen [Fri, 4 May 2018 11:10:49 +0000 (14:10 +0300)] 
lib-master: Add request time also for internal failure error messages

7 years agolib-master: Use more exact timestamp in master_login_auth_request failures
Timo Sirainen [Fri, 4 May 2018 11:03:46 +0000 (14:03 +0300)] 
lib-master: Use more exact timestamp in master_login_auth_request failures

7 years agolib-master: Improve error logging for master_auth_connection failures
Timo Sirainen [Fri, 4 May 2018 10:56:45 +0000 (13:56 +0300)] 
lib-master: Improve error logging for master_auth_connection failures

7 years agolib-master: Improve error logging for post-login script failures
Timo Sirainen [Fri, 4 May 2018 10:42:23 +0000 (13:42 +0300)] 
lib-master: Improve error logging for post-login script failures

7 years agolib-master: Improve error logging when master_login_connection gets disconnected
Timo Sirainen [Fri, 4 May 2018 10:23:07 +0000 (13:23 +0300)] 
lib-master: Improve error logging when master_login_connection gets disconnected

7 years agolib-master: Keep linked list of master_login_clients per connection
Timo Sirainen [Fri, 4 May 2018 10:07:50 +0000 (13:07 +0300)] 
lib-master: Keep linked list of master_login_clients per connection

This allows improving logging on connection errors.

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 agoglobal - migrate more complicated strncmp expressions to str_begins
Phil Carmody [Thu, 11 Jan 2018 13:35:42 +0000 (15:35 +0200)] 
global - migrate more complicated strncmp expressions to str_begins

Simplify a bunch of verbose var=strlen(); strncmp(,,var) calls.
Fortunately, all of these examples use the length variable, so no
"unused value" warnings occur.

--- 8< --- strncmp2.cocci ---
@@
expression e1, e2;
identifier i2;
@@

  i2 = strlen(e2)
  ...
- strncmp(e1, e2, i2) == 0
+ str_begins(e1, e2)

@@
expression e1, e2;
identifier i2;
@@

  i2 = strlen(e2)
  ...
- strncmp(e1, e2, i2) != 0
+ !str_begins(e1, e2)

@@
expression e1, e2;
identifier i1;
@@

  i1 = strlen(e1)
  ...
- strncmp(e1, e2, i1) == 0
+ str_begins(e2, e1)

@@
expression e1, e2;
identifier i1;
@@

  i1 = strlen(e1)
  ...
- strncmp(e1, e2, i1) != 0
+ !str_begins(e2, e1)

--- 8< ---------------------

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agoglobal - migrate from strncmp to str_begins
Phil Carmody [Thu, 11 Jan 2018 13:20:09 +0000 (15:20 +0200)] 
global - migrate from strncmp to str_begins

Simplify a bunch of verbose strncmp(,,strlen()) calls.

--- 8< --- strncmp.cocci ---
@@
expression e1, e2;
@@

- strncmp(e1, e2, strlen(e2)) == 0
+ str_begins(e1, e2)

@@
expression e1, e2;
@@

- strncmp(e1, e2, strlen(e2)) != 0
+ !str_begins(e1, e2)

@@
expression e1, e2;
@@

- strncmp(e1, e2, strlen(e1)) == 0
+ str_begins(e2, e1)

@@
expression e1, e2;
@@

- strncmp(e1, e2, strlen(e1)) != 0
+ !str_begins(e2, e1)

--- 8< ---------------------

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agoglobal - migrate strncmp literals to str_begins
Phil Carmody [Thu, 11 Jan 2018 13:03:36 +0000 (15:03 +0200)] 
global - migrate strncmp literals to str_begins

Simplify a bunch of strncmp(,,number) calls.

git ls-files \*.[ch] | xargs perl -p -i -e 's/strncmp\((.*?), ?(\".*?\"), ?(\d+)\) == 0/str_begins($1, $2)/g'
git ls-files \*.[ch] | xargs perl -p -i -e 's/strncmp\((.*?), ?(\".*?\"), ?(\d+)\) != 0/!str_begins($1, $2)/g'

I ran a longer script to verify that all of the string literals and
the length matched. They didn't:

$ git grep strncmp | perl -ne 'print if(m/strncmp\([^,]*,\s*"(.*?)",\s*(\d+)/ and ($s=$1,$t=$2,$s=~s/\\[tn]/#/g,length($s)) != $t)'
src/auth/db-oauth2.c:               if (strncmp(field, "oauth2:", 8) == 0 &&

With the new functions, that kind of typo is impossible.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agolib: strfuncs - string match length and prefix checking helpers
Phil Carmody [Thu, 2 Feb 2017 12:27:58 +0000 (14:27 +0200)] 
lib: strfuncs - string match length and prefix checking helpers

strncmp(input, "literal", 7) is an idiom used everywhere, but leaves
room for human error in calculating the length.

strncmp(input, "literal", strlen("literal")) is an idiom also used
everywhere, but is both verbose and might be inefficient on some
legacy or ultralightweight compilers.

The old techniques are presumed to be optimal code-wise, but are
verbose (and, containing redundancy, they leave room for human error),
so make the macro fall back onto this operation, simply avoiding the
redundancy/verbosity.

The macro expansion does not multiply evaluate any of its parameters,
so should be safe even in the strangest of situations.

Signed-off-by: Phil Carmody <phil@dovecot.fi>
7 years agodoveadm: Simplify destroying ioloop using o_stream_switch_ioloop_to()
Timo Sirainen [Tue, 5 Jun 2018 17:28:45 +0000 (20:28 +0300)] 
doveadm: Simplify destroying ioloop using o_stream_switch_ioloop_to()

7 years agodoveadm-server: Fix hang when sending a lot of output to clients
Timo Sirainen [Tue, 5 Jun 2018 17:23:52 +0000 (20:23 +0300)] 
doveadm-server: Fix hang when sending a lot of output to clients

Nowadays ostream adds its io to the stream's specified ioloop, not to
current ioloop.

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: event_add_str() - Ignore calls when value is NULL
Timo Sirainen [Sun, 29 Apr 2018 09:17:45 +0000 (12:17 +0300)] 
lib: event_add_str() - Ignore calls when value is NULL

Alternative could be to assert-crash instead. But perhaps this makes it
easier to use and avoids unnecessary assert-crashes?

7 years agolib-http: client: Drop the ioloop switch callback before freeing the global client...
Stephan Bosch [Fri, 18 May 2018 13:56:15 +0000 (15:56 +0200)] 
lib-http: client: Drop the ioloop switch callback before freeing the global client context.

This removes the possibility of recursion when the client context object somehow
triggers an ioloop switch (e.g., when debug logging starts blocking at that
inopportune moment).

7 years agolib: Fix potential crashes when writing to log fails with EAGAIN
Timo Sirainen [Fri, 18 May 2018 09:47:02 +0000 (12:47 +0300)] 
lib: Fix potential crashes when writing to log fails with EAGAIN

The ioloop may nowadays call ioloop context switch callbacks. Since log
writing can happen just about anywhere, the callbacks may be confused
and cause crashes or other weird behavior.

Even if the callbacks aren't called, all the extra code in ioloop can cause
potential problems. Especially any error logging in it wouldn't work properly
since it would just recurse back. So replace the ioloop code with just setting
the log fd to be blocking until the write succeeds.

This commit also removes comments about writes to a blocking terminal fd
causing EAGAINs. This seems unlikely. Probably I was just somehow
confused when originally seeing it and writing the code. If it actually
does happen now, it's still not breaking anything, but it could get into
a busy-loop of write()s constantly returning EAGAIN until they succeed.

7 years agolib-ssl-iostream: Fix potential crash if istream is destroyed before ostream
Timo Sirainen [Mon, 12 Mar 2018 11:58:02 +0000 (13:58 +0200)] 
lib-ssl-iostream: Fix potential crash if istream is destroyed before ostream

This happened if o_stream_destroy() triggered flush, which attempted to read
from the ssl_io->ssl_input. If the istream-ssl was already destroyed, it was
NULL and that caused a crash.

7 years agosystemd: Indicate where changes should be made
Aki Tuomi [Tue, 24 Apr 2018 08:46:21 +0000 (11:46 +0300)] 
systemd: Indicate where changes should be made

7 years agosystemd: Increase file descriptors by default
Aki Tuomi [Tue, 24 Apr 2018 08:45:36 +0000 (11:45 +0300)] 
systemd: Increase file descriptors by default

7 years agosystemd: Allow writing to home by default
Aki Tuomi [Tue, 24 Apr 2018 08:45:07 +0000 (11:45 +0300)] 
systemd: Allow writing to home by default

7 years agosystemd: Remove NoNewPrivileges and CAP_BOUNDING_SET
Aki Tuomi [Tue, 24 Apr 2018 08:44:33 +0000 (11:44 +0300)] 
systemd: Remove NoNewPrivileges and CAP_BOUNDING_SET

These break sieve by preventing SUID binary as
sendmail_path.

7 years agolib-compression: Use i_stream_nonseekable_try_seek() instead of reimplementing it
Timo Sirainen [Tue, 5 Jun 2018 10:57:26 +0000 (13:57 +0300)] 
lib-compression: Use i_stream_nonseekable_try_seek() instead of reimplementing it

7 years agolib-compression: Use i_stream_default_stat() instead of reimplementing it
Timo Sirainen [Tue, 5 Jun 2018 10:53:51 +0000 (13:53 +0300)] 
lib-compression: Use i_stream_default_stat() instead of reimplementing it

7 years agolib-compression: deflate ostream - Use Z_FINISH on final flush
Timo Sirainen [Tue, 5 Jun 2018 11:22:08 +0000 (14:22 +0300)] 
lib-compression: deflate ostream - Use Z_FINISH on final flush

Nowadays we have o_stream_finish(), so we can differentiate between
intermediate flush and final flush. Using this allows istream-zlib to
cleanly see that the stream ends.

7 years agolib: i_stream_default_stat() - Get seekable streams' sizes by reading the stream
Timo Sirainen [Tue, 5 Jun 2018 10:34:47 +0000 (13:34 +0300)] 
lib: i_stream_default_stat() - Get seekable streams' sizes by reading the stream

After the stream size is found, seek back to original offset.

7 years agolib-dcrypt: istream-decrypt - Add support for seeking
Timo Sirainen [Tue, 5 Jun 2018 10:34:02 +0000 (13:34 +0300)] 
lib-dcrypt: istream-decrypt - Add support for seeking

7 years agolib: Add i_stream_nonseekable_try_seek()
Timo Sirainen [Tue, 5 Jun 2018 10:25:30 +0000 (13:25 +0300)] 
lib: Add i_stream_nonseekable_try_seek()

This can be used by istreams to more easily implement seeking backwards when
it has to be done by first seeking back to offset 0 and reading from there.

7 years agopop3c: Ensure pop3c index directory is autocreated
Aki Tuomi [Tue, 29 May 2018 08:53:15 +0000 (11:53 +0300)] 
pop3c: Ensure pop3c index directory is autocreated

Otherwise we might think that the box has been unexpectedly
autodeleted and pop3_migration will fail.

Broken by 91ee70ed04d33fecd7fc94621f236013d520d7b3

7 years agolib-storage: maildir - Remove unnecessary variable
Aki Tuomi [Mon, 21 May 2018 16:38:29 +0000 (19:38 +0300)] 
lib-storage: maildir - Remove unnecessary variable

7 years agolib-storage: maildir - Use index keywords only when saving mail
Aki Tuomi [Mon, 21 May 2018 11:31:58 +0000 (14:31 +0300)] 
lib-storage: maildir - Use index keywords only when saving mail

This fixes mail attachment keywords to work with maildir too.

7 years agolib-storage: maildir - Use array code for keywords when saving mail
Aki Tuomi [Mon, 21 May 2018 11:28:03 +0000 (14:28 +0300)] 
lib-storage: maildir - Use array code for keywords when saving mail

This is safer alternative and makes following change easier.

7 years agolib-smtp: client: Fix assertion panic occurring when DATA dot stream cannot be finish...
Stephan Bosch [Fri, 18 May 2018 08:24:46 +0000 (10:24 +0200)] 
lib-smtp: client: Fix assertion panic occurring when DATA dot stream cannot be finished immediately.

If o_stream_finish() returns 0, o_stream_send_istream() would be called again
later which causes the panic. Instead, it should only call o_stream_finish() or
o_stream_flush() again to finish the last bit of the output.

Panic was:

Panic: file ostream.c: line 394 (o_stream_send_istream): assertion failed: (!_outstream->finished)

7 years agoimap: Log unhibernation debug message only with mail_debug=yes
Timo Sirainen [Sun, 27 May 2018 12:48:42 +0000 (15:48 +0300)] 
imap: Log unhibernation debug message only with mail_debug=yes

7 years agodoveadm director: Remove unnecessary extra newlines from output
Timo Sirainen [Wed, 23 May 2018 14:13:23 +0000 (17:13 +0300)] 
doveadm director: Remove unnecessary extra newlines from output

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-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-ssl-iostream: Correctly build certificate chains
Aki Tuomi [Sat, 10 Mar 2018 15:06:03 +0000 (17:06 +0200)] 
lib-ssl-iostream: Correctly build certificate chains

Prevents sending extraneous certificates when using
alternative certs.

Reported by John Fawcett <john@voipsupport.it> and
Peter Linss <peter@linss.com>.

7 years agoimap-login: Simplify ID handling code
Timo Sirainen [Tue, 9 Jan 2018 21:01:42 +0000 (16:01 -0500)] 
imap-login: Simplify ID handling code

7 years agoimap-login: Rewrite ID parameter handling to be less fragile
Timo Sirainen [Wed, 14 Jun 2017 07:46:53 +0000 (10:46 +0300)] 
imap-login: Rewrite ID parameter handling to be less fragile

There's no longer two places that need to be kept in sync.

7 years agoimap-login: Move ID command handling to its own file.
Timo Sirainen [Wed, 14 Jun 2017 07:34:57 +0000 (10:34 +0300)] 
imap-login: Move ID command handling to its own file.

7 years agosubmission: Perform variable substitution for the submission_relay_rawlog_dir setting.
Stephan Bosch [Sat, 12 May 2018 11:11:59 +0000 (13:11 +0200)] 
submission: Perform variable substitution for the submission_relay_rawlog_dir setting.

7 years agosubmission: Add support for making server rawlogs using the rawlog_dir setting.
Stephan Bosch [Sat, 12 May 2018 10:20:08 +0000 (12:20 +0200)] 
submission: Add support for making server rawlogs using the rawlog_dir setting.

Similar services like pop3 and imap already support this setting, but for
submission this was omitted.

7 years agosubmission: Substitute variables in settings.
Stephan Bosch [Sat, 12 May 2018 11:33:20 +0000 (13:33 +0200)] 
submission: Substitute variables in settings.

7 years agosubmission: Move assignment of verbose_proctitle.
Stephan Bosch [Mon, 14 May 2018 20:41:29 +0000 (22:41 +0200)] 
submission: Move assignment of verbose_proctitle.

Makes it more consistent with other services like imap.

7 years agolmtp: Fix segfault occurring when a user turns out to be over quota at DATA transfer.
Stephan Bosch [Mon, 14 May 2018 21:56:21 +0000 (23:56 +0200)] 
lmtp: Fix segfault occurring when a user turns out to be over quota at DATA transfer.

The LMTP recipient context was not updated with the final recipient address when
the RCPT command was accepted. This left a dangling struct smtp_address pointer
which triggered the segfault when used.

7 years agoauth: test - make sure memory gets free'd
Aki Tuomi [Tue, 17 Apr 2018 09:11:05 +0000 (12:11 +0300)] 
auth: test - make sure memory gets free'd

7 years agoauth: Add test for lua password verify
Aki Tuomi [Tue, 17 Apr 2018 07:55:53 +0000 (10:55 +0300)] 
auth: Add test for lua password verify

7 years agoauth: db-lua - Add password_verify to auth request
Aki Tuomi [Thu, 12 Apr 2018 10:39:58 +0000 (13:39 +0300)] 
auth: db-lua - Add password_verify to auth request

Allows verifying passwords with dovecot when necessary

7 years agoauth: db-lua - Expose some auth request members
Aki Tuomi [Wed, 11 Apr 2018 09:39:51 +0000 (12:39 +0300)] 
auth: db-lua - Expose some auth request members

These are particularly useful for finding out if user
has already been authenticated.

7 years agoauth: db-lua - Remove extra space from log_error
Aki Tuomi [Wed, 11 Apr 2018 09:29:41 +0000 (12:29 +0300)] 
auth: db-lua - Remove extra space from log_error

This makes it possible to use the log_error method.

Broken in 9698cd24

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 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 agolib-http: test-http-client - Only load existing CAs
Aki Tuomi [Wed, 28 Mar 2018 06:11:55 +0000 (09:11 +0300)] 
lib-http: test-http-client - Only load existing CAs

Otherwise the SSL tests do not properly work.

Fixes Error: HTTP Request failed: Couldn't initialize SSL context: Can't load CA certs from directory /etc/ssl/certs: error:02001002:system library:fopen:No such file or directory: fopen('/etc/pki/tls/cert.pem','r'), error:2006D080:BIO routines:BIO_new_file:no such file, error:0B084002:x509 certificate routines:X509_load_cert_crl_file:system lib

7 years agolib-http: test-http-client - Test against missing SAN name
Aki Tuomi [Tue, 27 Mar 2018 07:31:53 +0000 (10:31 +0300)] 
lib-http: test-http-client - Test against missing SAN name

Add test to make sure http client validates and ignores
missing subjectAltName in cert, when not validating names.

7 years agolib-ssl-iostream: Do not skip cert name check if invalid cert is allowed
Aki Tuomi [Tue, 27 Mar 2018 07:20:54 +0000 (10:20 +0300)] 
lib-ssl-iostream: Do not skip cert name check if invalid cert is allowed

Caller should be responsible for ignoring this error, not us.
All the locations calling here are dealing this correctly.

7 years agolib-ssl-iostream: Fix missing altName handling in openssl_cert_match_name
Aki Tuomi [Tue, 27 Mar 2018 07:29:49 +0000 (10:29 +0300)] 
lib-ssl-iostream: Fix missing altName handling in openssl_cert_match_name

If name is not found in subjectAltNames, report it as error.

Fixes Panic: file iostream-openssl-common.c: line 177 (openssl_cert_match_name): assertion failed: (*reason_r != NULL)

7 years agolib-smtp: server: Fix the enforcement of the maximum DATA command message size.
Stephan Bosch [Wed, 23 May 2018 13:54:53 +0000 (15:54 +0200)] 
lib-smtp: server: Fix the enforcement of the maximum DATA command message size.

The global setting from the server object was used, rather than the
per-connection setting. The latter is usually the one that is properly set,
while the global server setting is left at zero. For LMTP this meant that the
40 Mb implicit limit was still in force.