]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Timo Sirainen [Mon, 26 Feb 2018 13:17:36 +0000 (15:17 +0200)]
lib: Remove ostream-escaped
It can't implement o_stream_get_buffer_avail_size() correctly with its
current API. Nothing uses it currently, so easier to just remove it
entirely.
Timo Sirainen [Sat, 24 Feb 2018 20:03:10 +0000 (22:03 +0200)]
lib: Change/clarify o_stream_get_buffer_used/avail_size() APIs
ostream.get_used_size() is deprecated and replaced by get_buffer_used_size()
and get_buffer_avail_size().
Timo Sirainen [Tue, 6 Mar 2018 10:14:25 +0000 (12:14 +0200)]
lib-mail: message_address_write() - don't crash with NULL address
message_address_parse() can return NULL on empty address, so writing it
should produce empty address as well. Broken by
15581297511b658a29c707c6031a258bab7bf1a5
Stephan Bosch [Wed, 7 Mar 2018 14:14:52 +0000 (15:14 +0100)]
submission-login: Only send HELO domain to post-login service when it is valid.
Stephan Bosch [Wed, 7 Mar 2018 14:03:42 +0000 (15:03 +0100)]
lib-smtp: server: Fix application of pre-login HELO domain when no post-login HELO is issued.
The substituted domain was not marked as valid, which caused the HELO field of
the produced received line to be set to 'unknown'.
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'.
Stephan Bosch [Wed, 7 Mar 2018 17:54:38 +0000 (18:54 +0100)]
lda: Add -r parameter to usage help message.
Martti Rannanjärvi [Tue, 6 Mar 2018 11:27:17 +0000 (13:27 +0200)]
master: Strip '\n' from suid_dumpable read buffer before str_to_uint()
Timo Sirainen [Fri, 22 Dec 2017 16:58:11 +0000 (18:58 +0200)]
global: Call rfc822_parser_deinit() wherever possible
Timo Sirainen [Tue, 9 Jan 2018 16:33:59 +0000 (11:33 -0500)]
lib-mail: Refactor code to make the next commit smaller
Timo Sirainen [Fri, 22 Dec 2017 16:56:53 +0000 (18:56 +0200)]
lib-mail: Add rfc822_parser_deinit()
It's not a strict requirement to call this, but it assert-crashes if the
state isn't valid.
Timo Sirainen [Fri, 22 Dec 2017 16:42:53 +0000 (18:42 +0200)]
lib-mail: Make sure parsers don't accidentally go much beyond end pointer
Timo Sirainen [Fri, 22 Dec 2017 16:36:55 +0000 (18:36 +0200)]
lib-mail: Fix out-of-bounds read when parsing an invalid email address
The included unit test doesn't fail, but running it with valgrind shows
"Invalid read of size 1" error.
Broken in
d6737a17a27402e7a262f7ba8a2ed588d576f23c
Discovered by Aleksandar Nikolic of Cisco Talos
Timo Sirainen [Fri, 22 Dec 2017 16:36:09 +0000 (18:36 +0200)]
lib-mail: test-message-address - Add TEST_MESSAGE_ADDRESS_FLAG_SKIP_LIST flag
This commit just adds the flag and sets it to 0 for all existing tests.
Timo Sirainen [Fri, 22 Dec 2017 16:31:52 +0000 (18:31 +0200)]
lib-mail: rfc822-parser - Add asserts to make sure parser state is correct
Aki Tuomi [Mon, 19 Feb 2018 12:19:08 +0000 (14:19 +0200)]
lib-dns: Move before lib-master
Aki Tuomi [Mon, 26 Feb 2018 10:53:19 +0000 (12:53 +0200)]
lib-master: Fix dns_match_wildcard result value check
It returns 0, not TRUE.
Aki Tuomi [Fri, 23 Feb 2018 13:31:11 +0000 (15:31 +0200)]
lib-master: Check local_name only if both filter and input have it
Broken in
cedc777a1acf830af4cf0b6e9b0f343c81e20adc
Aki Tuomi [Thu, 30 Nov 2017 18:52:11 +0000 (20:52 +0200)]
login-common: Enable config filtering by local name
Prevents servername misuse.
Aki Tuomi [Thu, 30 Nov 2017 13:47:25 +0000 (15:47 +0200)]
lib-master: Support validating config filters against requests
Validation will sanitize the input request and drop any fields
that have no filter in config. E.g. if you have a local block
with name, and nothing else, then lip/rip will be dropped
from the request.
Aki Tuomi [Thu, 30 Nov 2017 13:46:52 +0000 (15:46 +0200)]
config: Add command to request all filters
Aki Tuomi [Thu, 30 Nov 2017 13:46:40 +0000 (15:46 +0200)]
config: Add config_filter_get_all
Returns all filters
Timo Sirainen [Thu, 1 Mar 2018 10:17:16 +0000 (12:17 +0200)]
sdbox: Delete .temp* files on when save/copy transaction is rolled back
For example when copying was aborted due to user being over quota, temp
files were left behind.
Timo Sirainen [Thu, 1 Mar 2018 16:38:43 +0000 (18:38 +0200)]
master: Improve "core not dumped" error messages with Linux
Recommend setting /proc/fs/suid_dumpable to 2 and
/proc/sys/kernel/core_pattern to absolute path, if they already aren't.
Timo Sirainen [Thu, 1 Mar 2018 16:37:43 +0000 (18:37 +0200)]
master: Add explanation URL to "core dumps disabled" and "core not dumped" errors
Stephan Bosch [Mon, 5 Mar 2018 20:02:49 +0000 (21:02 +0100)]
submission: Limit the set of capabilities to those that are actually supported.
Particularly, the XCLIENT capability was inappropriately enabled when the
backend MTA announced support. XCLIENT is not supported by Dovecot post-login.
Martti Rannanjärvi [Mon, 5 Mar 2018 12:55:04 +0000 (14:55 +0200)]
charset-alias: Don't return value from void functions
Stephan Bosch [Sun, 4 Mar 2018 22:43:55 +0000 (23:43 +0100)]
lib-smtp: server: RCPT command: Make sure conn->state.pending_rcpt_cmds cannot decrement through zero.
Added assertion.
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.
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)
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.
Timo Sirainen [Thu, 1 Mar 2018 15:55:50 +0000 (17:55 +0200)]
lib-storage: Code cleanup - remove unnecessary temporary variable
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
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.
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.
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.
Aki Tuomi [Wed, 29 Nov 2017 09:51:57 +0000 (11:51 +0200)]
lib-storage: Add tests for mailbox_verify_name
Aki Tuomi [Wed, 29 Nov 2017 09:42:39 +0000 (11:42 +0200)]
lib-storage: test-mail-storage - Add framework for doing storage tests
Timo Sirainen [Sat, 17 Feb 2018 21:33:45 +0000 (23:33 +0200)]
cydir: Fix crash when using mailbox_get_metadata()
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)
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.
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.
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.
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".
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.
Timo Sirainen [Sat, 17 Feb 2018 20:04:52 +0000 (22:04 +0200)]
lib-storage: mailbox_verify_name() - Deduplicate error handling
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.
Timo Sirainen [Sat, 17 Feb 2018 19:50:10 +0000 (21:50 +0200)]
lib-storage: mailbox_verify_name() - Add comments for separator checks
Timo Sirainen [Wed, 28 Feb 2018 13:09:02 +0000 (15:09 +0200)]
example-config: Add mail_attachment_detection_options
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)
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.
Aki Tuomi [Sun, 25 Feb 2018 07:35:19 +0000 (09:35 +0200)]
m4: Remove pthread from tests
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.
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.
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.
Stephan Bosch [Tue, 27 Feb 2018 20:56:55 +0000 (21:56 +0100)]
lib: connection: Added support for connecting from an explicit source IP.
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.
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.
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
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.
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.
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.
Stephan Bosch [Mon, 19 Feb 2018 12:20:11 +0000 (13:20 +0100)]
lib-http: message parsers: Record beginning of parsed data.
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.
Stephan Bosch [Sun, 21 Jan 2018 15:19:41 +0000 (16:19 +0100)]
lib-http: client: Record last status code in the request object.
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.
Stephan Bosch [Sun, 21 Jan 2018 15:06:19 +0000 (16:06 +0100)]
lib-http: client: Add "host" and "port" fields to request event.
Stephan Bosch [Sun, 21 Jan 2018 15:00:31 +0000 (16:00 +0100)]
lib-http: client: Use the new http_url_get_port*() functions.
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.
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.
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.
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.
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.
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.
Stephan Bosch [Fri, 23 Feb 2018 17:16:57 +0000 (18:16 +0100)]
lib-smtp: client: transaction: Use the correct callback for finish timeout.
Aki Tuomi [Sat, 16 Dec 2017 16:16:10 +0000 (18:16 +0200)]
lib-storage: Add NO-FS-VALIDATION flag
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
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.
Aki Tuomi [Tue, 20 Feb 2018 10:04:13 +0000 (12:04 +0200)]
lib: Fix buffer code to satisfy static analyzers
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.
Aki Tuomi [Thu, 8 Feb 2018 09:45:20 +0000 (11:45 +0200)]
trash: Use TRASH_USER_CONTEXT_REQUIRE
Satisfies static analyzer
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
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().
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
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
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
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.
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
Josef 'Jeff' Sipek [Sun, 18 Feb 2018 23:07:16 +0000 (18:07 -0500)]
lib-storage: Generate snippet while saving new mails
Timo Sirainen [Mon, 19 Feb 2018 13:43:31 +0000 (15:43 +0200)]
lib-storage: Make index_mail_want_cache() global
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.
Timo Sirainen [Mon, 19 Feb 2018 13:38:13 +0000 (15:38 +0200)]
doveadm dump: Show body.snippet in human-readable form
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.
Aki Tuomi [Sun, 18 Feb 2018 16:11:18 +0000 (18:11 +0200)]
imap: If snippet is not available return NIL
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
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.
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++) {
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.
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().
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().