]>
git.ipfire.org Git - thirdparty/dovecot/core.git/log
Sergey Kitov [Wed, 18 Apr 2018 10:30:50 +0000 (13:30 +0300)]
lib: Call module's preinit function, when loading
Sergey Kitov [Fri, 9 Mar 2018 13:17:29 +0000 (15:17 +0200)]
plugins/old-stats: Add old-stats preinit() which opens mail stats io.
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.
Timo Sirainen [Thu, 26 Apr 2018 16:38:55 +0000 (19:38 +0300)]
lib-fs: fs-posix - Add accurate-mtime parameter
This is mainly useful for testing to find out whether one file was created
after another.
Timo Sirainen [Thu, 26 Apr 2018 15:23:54 +0000 (18:23 +0300)]
lib-fs: Update FS_METADATA_WRITE_FNAME comment
Timo Sirainen [Thu, 26 Apr 2018 15:14:27 +0000 (18:14 +0300)]
lib-fs: fs-posix - FS_METADATA_WRITE_FNAME replaces the full path
This is how all the other fs drivers work, although the macro name is a bit
confusing.
Timo Sirainen [Thu, 26 Apr 2018 15:14:46 +0000 (18:14 +0300)]
lib-fs: fs-metawrap - Pass FS_METADATA_WRITE_FNAME through to parent fs
fs-metawrap in the middle pervented the renaming from working.
Timo Sirainen [Thu, 26 Apr 2018 13:42:40 +0000 (16:42 +0300)]
lib-storage: Remove mail_attachment_detection_options=add-flags-on-fetch parsing
It wasn't actually used yet.
Timo Sirainen [Thu, 26 Apr 2018 13:41:55 +0000 (16:41 +0300)]
lib-storage: Fail if mail_attachment_detection_options has invalid options
Timo Sirainen [Thu, 19 Apr 2018 13:38:22 +0000 (16:38 +0300)]
lib-storage: Set $Has[No]Attachment earlier among other cached data
Aki Tuomi [Wed, 25 Apr 2018 08:04:08 +0000 (11:04 +0300)]
doveadm: mailbox cache decisions - Fatally fail if fields are missing
Aki Tuomi [Wed, 25 Apr 2018 07:56:04 +0000 (10:56 +0300)]
man: Document doveadm mailbox cache commands
Aki Tuomi [Fri, 13 Apr 2018 10:28:47 +0000 (13:28 +0300)]
doveadm: Add mailbox cache manipulation commands
This allows changing cache decisions and dropping cache pointer
for wanted mails.
Aki Tuomi [Sat, 14 Apr 2018 11:31:44 +0000 (14:31 +0300)]
doveadm-mail: Handle field conversion to short opt better
Convert non-string types as well
Josef 'Jeff' Sipek [Tue, 13 Sep 2016 19:01:56 +0000 (15:01 -0400)]
lib: introduce container_of
This is a simple but type safe implementation.
Timo Sirainen [Sun, 29 Apr 2018 09:31:23 +0000 (12:31 +0300)]
lib-index: mail_index_sync_map() - Don't try to-resync extension updates
This was done to call extension record sync handlers, but the previous
commit removes them. Fixes a problem where obsolete cache offsets were
used in some situations:
- Some cache updates are from external transactions and some are from
non-external transactions. This is because cache offset updates are being
added by whatever the parent index transaction is.
- When mail_index_sync_map() is mapping MAIL_INDEX_SYNC_HANDLER_FILE, it
has already synced the map. But it's calling mail_index_sync_record()
for non-external transactions to call expunge handlers and extension
update handlers. It's calling the regular mail_index_sync_record() to do
this work.
- But mail_index_sync_record() is actually still updating the map. So now
mail_index_sync_record() is called for all non-external cache updates,
but not for external cache updates! And since these are somewhat
randomly either external or non-external, the end result is that the
cache offset may be obsolete.
Timo Sirainen [Sun, 29 Apr 2018 09:23:49 +0000 (12:23 +0300)]
lib-index: Remove extension record sync handlers
This is no longer used by anything, and it makes the fix in the following
commit much easier.
This was originally added in
6a19e109ee8c5a6f688da83a86a7f6abeb71abdd to
allow dovecot.index.cache updating to hook into updating cache offsets to
link cache records together. This was reimplemented in a different way in
131b073bdc3650083b00616dc778dd3017c2bbb5
Martti Rannanjärvi [Thu, 26 Apr 2018 10:18:01 +0000 (13:18 +0300)]
.gitignore: Ignore doc/man/doveadm-rebuild.1
Aki Tuomi [Thu, 12 Apr 2018 11:09:10 +0000 (14:09 +0300)]
doveadm: Add rebuild attachments command
Goes thru given mails and resets the attachment indicator.
Aki Tuomi [Thu, 12 Apr 2018 11:07:54 +0000 (14:07 +0300)]
lib-storage: Parse mail parts in mail_set_attachment_keywords if not present
Aki Tuomi [Thu, 19 Apr 2018 07:19:15 +0000 (10:19 +0300)]
lib-storage: Add error reporting to mail_set_attachment_keywords
Timo Sirainen [Wed, 25 Apr 2018 12:20:58 +0000 (15:20 +0300)]
lib-fts: Minor fix to randomness test in test-fts-tokenizer
If the random input was entirely valid UTF-8, the input was truncated to
empty.
Timo Sirainen [Wed, 25 Apr 2018 12:17:53 +0000 (15:17 +0300)]
fts: Fix indexing input that contains NULs
Any message_block that contained NULs, but otherwise was valid UTF-8, was
simply dropped.
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.
Stephan Bosch [Tue, 17 Apr 2018 19:31:38 +0000 (21:31 +0200)]
lib: unichar: Add Horizontal Ellipsis character.
Timo Sirainen [Tue, 24 Apr 2018 15:50:38 +0000 (18:50 +0300)]
dsync: If lock file can't be created because home is missing, mkdir the home
Timo Sirainen [Tue, 24 Apr 2018 15:47:28 +0000 (18:47 +0300)]
lib-storage: Add mail_user_home_mkdir()
Timo Sirainen [Wed, 25 Apr 2018 14:45:39 +0000 (17:45 +0300)]
lib-lda: mail_send_rejection() - Don't assert-crash with empty input mail
Fixes: Panic: file mail-send.c: line 176 (mail_send_rejection): assertion failed: (ret != 0)
Aki Tuomi [Wed, 28 Feb 2018 12:22:44 +0000 (14:22 +0200)]
login-common: If no CRL check is required, allow revoked certs
Aki Tuomi [Wed, 28 Feb 2018 12:22:04 +0000 (14:22 +0200)]
login-common: ssl_require_crl works both ways
It applies for incoming and outgoing connections.
Aki Tuomi [Wed, 28 Feb 2018 11:29:51 +0000 (13:29 +0200)]
login-common: Fix boolean misuse in preverify_ok
Fixes problem where dovecot does not accept revoked cert
when CRL checking has been disabled.
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.
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)
Sergey Kitov [Tue, 13 Mar 2018 14:36:44 +0000 (16:36 +0200)]
lib-mail: html2text: do not parse entity when quote_level > 0.
&entities inside blockquotes are added to text, while other text is
not, this leads to strange results.
Sergey Kitov [Fri, 6 Apr 2018 12:48:02 +0000 (15:48 +0300)]
lib-mail: Fix include guards for istream-nonuls.h
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.
Timo Sirainen [Mon, 9 Apr 2018 13:41:19 +0000 (16:41 +0300)]
imapc: Fix crash when handling empty mailboxes.
Broken by
c05b4ac76c4c6012958f1cc37e2fccf7a7d31c33
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))
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.
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.
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)
Arkadiusz Miśkiewicz [Wed, 21 Mar 2018 09:29:26 +0000 (11:29 +0200)]
lib-master: Fix dns_wildcard_match usage
Broken by
446c0b02a7802b676e893ccc4934fc7318d950ea
Aki Tuomi [Mon, 19 Mar 2018 09:51:01 +0000 (11:51 +0200)]
NEWS: Add v2.2.35 release notes
Martti Rannanjärvi [Mon, 19 Mar 2018 10:20:14 +0000 (12:20 +0200)]
lib-dcrypt: Add libssl_iostream.la to LIBADD
This allows running the tests in src/lib-dcrypt.
Aki Tuomi [Mon, 19 Mar 2018 09:30:14 +0000 (11:30 +0200)]
NEWS: Update up to 2.2.34
Timo Sirainen [Wed, 7 Mar 2018 09:24:30 +0000 (11:24 +0200)]
notify: Fix crash if NO_NOTIFY transaction is rolled back during commit
Fixes: Panic: no notify_mail_txn found
Timo Sirainen [Thu, 15 Mar 2018 11:19:53 +0000 (13:19 +0200)]
imapc: Update mail size also when RFC822.SIZE is smaller than fetched header size
If this isn't done, istream-mail will detect that the fetched header is
larger than RFC822.SIZE and fail with "Cached message size smaller than
expected"
Timo Sirainen [Thu, 15 Mar 2018 10:20:14 +0000 (12:20 +0200)]
imapc: Update mail size also when istream_opened() hook is called
When fetching a message body the cached message size was set. However,
if istream_opened() hook was used this wasn't done. If a client had
fetched both (RFC822.SIZE BODY.PEEK[]) and the server sent a wrong
RFC822.SIZE, that size was used for the message body size, which resulted
in "Cached message size larger than expected" errors.
Aki Tuomi [Tue, 6 Mar 2018 13:15:01 +0000 (15:15 +0200)]
lib-master: Correctly match when local_name has multiple names
Reported by J. Nick Koston <nick@cpanel.net>
Aki Tuomi [Tue, 6 Mar 2018 08:33:27 +0000 (10:33 +0200)]
lib-master: Reply from config process is tabescaped
Found by J. Nick Koston <nick@cpanel.net>
Aki Tuomi [Sat, 10 Mar 2018 17:43:27 +0000 (19:43 +0200)]
config: tabescape local name and service
Aki Tuomi [Tue, 6 Mar 2018 08:31:51 +0000 (10:31 +0200)]
config: Make local_name comparison faster
Based on patch by J. Nick Koston <nick@cpanel.net>
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.
Timo Sirainen [Mon, 12 Mar 2018 13:06:13 +0000 (15:06 +0200)]
imapc: Don't try to add mails to index if they already exist there
Broken by
259a4ca5943123915a019799623d2e4a4ef7fd15 when imapc was used
with (not in-memory) index files.
This caused errors like "Append with UID 200, but next_uid = 201"
Martti Rannanjärvi [Mon, 5 Mar 2018 12:55:04 +0000 (14:55 +0200)]
charset-alias: Don't return value from void functions
Aki Tuomi [Mon, 12 Mar 2018 12:50:32 +0000 (14:50 +0200)]
lib-dcrypt: test-stream - Ensure more is read when buffer becomes empty
Aki Tuomi [Mon, 12 Mar 2018 12:48:41 +0000 (14:48 +0200)]
lib-dcrypt: istream-decrypt - Read more if buffer is empty
If there is no more buffered data, try to decrypt more.
- Fixes Panic: file istream.c: line 192 (i_stream_read): assertion failed: (!stream->blocking)
- Fixes infinite loop when stream is not blocking
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 [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 [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
Aki Tuomi [Tue, 6 Mar 2018 07:42:46 +0000 (09:42 +0200)]
doc: Update example-config description for ssl_require_crl
Timo Sirainen [Wed, 28 Feb 2018 13:09:02 +0000 (15:09 +0200)]
example-config: Add mail_attachment_detection_options
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.
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
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
Timo Sirainen [Thu, 15 Feb 2018 16:16:15 +0000 (18:16 +0200)]
imap: Don't set storage callbacks before namespaces are created
This fixes sending untagged OK/NO notifications from storage (e.g. lock
waits/override notifications). It was broken by
e031d9aaae59a9f79710dc1138b76b69272615a3
Timo Sirainen [Thu, 15 Feb 2018 16:15:16 +0000 (18:15 +0200)]
imap: Add client_create_finish() to finish namespace creation.
Timo Sirainen [Thu, 15 Feb 2018 16:13:20 +0000 (18:13 +0200)]
imap: When running standalone, delay initializing namespaces until PREAUTH is sent
Most importantly this makes the code paths similar for standalone and
non-standalone clients, which is needed by the following commits.
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
Martti Rannanjärvi [Thu, 30 Nov 2017 10:03:36 +0000 (12:03 +0200)]
lib-ssl-iostream,login-common: Use SSL_CTX_set_min_proto_version
Use SSL_CTX_set_min_proto_version to set the minimum ssl protocol
version where available.
Martti Rannanjärvi [Sat, 11 Nov 2017 02:28:57 +0000 (04:28 +0200)]
lib-ssl-iostream: Add ssl_protocols_to_min_protocol()
This detects minimum SSL protocol version from the ssl_protocols
setting.
Martti Rannanjärvi [Thu, 30 Nov 2017 09:15:50 +0000 (11:15 +0200)]
configure.ac: Add SSL_CTX_set_min_proto_version detection
Martti Rannanjärvi [Mon, 19 Feb 2018 12:51:41 +0000 (14:51 +0200)]
login-common: Explicitly ignore SSL_CTX_set_ecdh_auto() return value
This is to fix a compiler warning.
Aki Tuomi [Mon, 19 Feb 2018 07:54:09 +0000 (09:54 +0200)]
login-common,lib-ssl-iostream: Use SSL_CTX_set_ecdh_auto
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 12:49:59 +0000 (14:49 +0200)]
imap: Don't enforce sending SNIPPET reply as literal
Also change it to use "cur_str" since the reply is never very long.
Timo Sirainen [Fri, 16 Feb 2018 12:46:36 +0000 (14:46 +0200)]
imap: Add parenthesis to FETCH SNIPPET (FUZZY text) response
Otherwise it violates the RFC 3501 text about FETCH responses.
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.
Hideo Yoshizane [Thu, 25 Jan 2018 00:36:22 +0000 (19:36 -0500)]
charset-alias-plugin
Timo Sirainen [Thu, 9 Nov 2017 13:18:29 +0000 (15:18 +0200)]
lib-charset: Allow plugins to replace charset_* functions
They just need to point charset_utf8_vfuncs to their own implementation.
Timo Sirainen [Thu, 9 Nov 2017 13:12:05 +0000 (15:12 +0200)]
lib-charset: Move non-iconv UTF-8 only translation code to its own file
Stephan Bosch [Fri, 9 Feb 2018 22:57:29 +0000 (23:57 +0100)]
lib-http: server: Recreate connection IO after streams change.
Stephan Bosch [Fri, 9 Feb 2018 22:56:55 +0000 (23:56 +0100)]
lib-http: client: Recreate connection IO after streams change.