]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
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.

7 years agosubmission: Truly enforce a configurable message size limit (default 40 MB).
Stephan Bosch [Fri, 6 Apr 2018 23:09:12 +0000 (01:09 +0200)] 
submission: Truly enforce a configurable message size limit (default 40 MB).

Before, it was only checking a provided SIZE parameter to the MAIL command and
not the size of the actually submitted message.

7 years agolmtp: Explicitly disable message size limit enforcement.
Stephan Bosch [Fri, 6 Apr 2018 23:08:34 +0000 (01:08 +0200)] 
lmtp: Explicitly disable message size limit enforcement.

7 years agosubmission: Actively enforce message size limit while copying message data.
Stephan Bosch [Fri, 6 Apr 2018 23:08:11 +0000 (01:08 +0200)] 
submission: Actively enforce message size limit while copying message data.

7 years agolmtp: Actively enforce message size limit while copying message data.
Stephan Bosch [Fri, 6 Apr 2018 23:06:13 +0000 (01:06 +0200)] 
lmtp: Actively enforce message size limit while copying message data.

This is actually currently not relevant to LMTP, but for future implementation
this code is added here already.

7 years agolib-smtp: server: Implement enforcement of maximum message size.
Stephan Bosch [Fri, 6 Apr 2018 23:05:15 +0000 (01:05 +0200)] 
lib-smtp: server: Implement enforcement of maximum message size.

7 years agolib-smtp: command parser: Provide more details in command data size limit error.
Stephan Bosch [Fri, 6 Apr 2018 23:03:58 +0000 (01:03 +0200)] 
lib-smtp: command parser: Provide more details in command data size limit error.

7 years agoconfigure: Create a definition for UOFF_T_MAX.
Stephan Bosch [Fri, 6 Apr 2018 23:00:46 +0000 (01:00 +0200)] 
configure: Create a definition for UOFF_T_MAX.

7 years agolib-smtp: server: Fix error message logged for errors occurring in data wrapper strea...
Stephan Bosch [Wed, 4 Apr 2018 22:34:49 +0000 (00:34 +0200)] 
lib-smtp: server: Fix error message logged for errors occurring in data wrapper stream during DATA transfer.

Used the connection stream rather than the data stream to obtain the error.
Obviously, there is no error on the low-level connection when there is a data
istream (e.g. message size) error.

7 years agolib-smtp: server: DATA command: Restore input handling upon failure.
Stephan Bosch [Fri, 11 May 2018 17:26:45 +0000 (19:26 +0200)] 
lib-smtp: server: DATA command: Restore input handling upon failure.

Fixes command hanging upon failure during data transfer.

7 years agolib-smtp: client: Increase the default BDAT chunk size.
Stephan Bosch [Sat, 17 Mar 2018 17:00:54 +0000 (18:00 +0100)] 
lib-smtp: client: Increase the default BDAT chunk size.

Reduces the number of roundtrips and keeps the TCP window filled better.
The default is now based on the NET_BLOCK_SIZE definition.

7 years agolib: Define NET_BLOCK_SIZE.
Stephan Bosch [Tue, 22 May 2018 07:42:00 +0000 (09:42 +0200)] 
lib: Define NET_BLOCK_SIZE.

This defines the default size for data blocks transferred over the network. It
should be large enough to guarantee filling up the TCP window (for efficiency),
while still preventing sending much data while the peer has already rejected
the rest of the transfer.

7 years agolib: Fix returning error from unlink_directory()
Timo Sirainen [Thu, 26 Apr 2018 23:39:10 +0000 (02:39 +0300)] 
lib: Fix returning error from unlink_directory()

On non-ENOENT errors it was returning 1 instead of -1.

7 years agolmtp: Properly apply the login_greeting setting.
Stephan Bosch [Sat, 12 May 2018 10:15:07 +0000 (12:15 +0200)] 
lmtp: Properly apply the login_greeting setting.

It got ignored during migration of lmtp service to lib-smtp.

7 years agolmtp: proxy: Add support for making proxy client rawlogs using the lmtp_proxy_rawlog_...
Stephan Bosch [Sat, 12 May 2018 10:27:37 +0000 (12:27 +0200)] 
lmtp: proxy: Add support for making proxy client rawlogs using the lmtp_proxy_rawlog_dir setting.

7 years agolmtp: Add support for making server rawlogs using the lmtp_rawlog_dir setting.
Stephan Bosch [Sat, 12 May 2018 10:18:27 +0000 (12:18 +0200)] 
lmtp: Add support for making server rawlogs using the lmtp_rawlog_dir setting.

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

Fixes compiler nit on clang

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

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

7 years agolda: Allow -f sender to omit domain.
Stephan Bosch [Sat, 26 May 2018 11:12:26 +0000 (13:12 +0200)] 
lda: Allow -f sender to omit domain.

Several people complained about the original enforcement of the presence of a
domain (added for v2.3.0) to be too restrictive. Apparently, this legitimately
happens with bounce messages on certain platforms.

7 years agocassandra: Fix empty binary parameters with prepared statements
Timo Sirainen [Wed, 23 May 2018 22:32:40 +0000 (01:32 +0300)] 
cassandra: Fix empty binary parameters with prepared statements

Fixes:
Panic: Trying to allocate 0 bytes

7 years agofs-posix: Support FS_METADATA_WRITE_FNAME for fs_copy()
Timo Sirainen [Tue, 22 May 2018 13:06:15 +0000 (16:06 +0300)] 
fs-posix: Support FS_METADATA_WRITE_FNAME for fs_copy()

7 years agoman: doveadm-mailbox.1.in - Fix doveadm-search-query(7) section
Timo Sirainen [Tue, 22 May 2018 07:59:11 +0000 (10:59 +0300)] 
man: doveadm-mailbox.1.in - Fix doveadm-search-query(7) section

7 years agofs-posix: Fix fs_iter_next() to return any kinds of files.
Timo Sirainen [Mon, 14 May 2018 12:46:01 +0000 (15:46 +0300)] 
fs-posix: Fix fs_iter_next() to return any kinds of files.

Only regular files and symlinks were returned. It should return everything
else as well (fifos, sockets, devices).

7 years agocassandra: Fix consistency=quorum to work
Timo Sirainen [Thu, 17 May 2018 13:29:28 +0000 (16:29 +0300)] 
cassandra: Fix consistency=quorum to work

Previously it could have been used by setting "consistency=", but this was
an accident.

7 years agocassandra: Use fallback_consistency on more types of errors
Timo Sirainen [Thu, 3 May 2018 14:06:04 +0000 (17:06 +0300)] 
cassandra: Use fallback_consistency on more types of errors

This could allow for example read_consistency=local-quorum with
read_fallback_consistency=quorum, so most of the time the reads are
from local datacenter, but in case it has problems you can switch to
other datacenters.

7 years agocassandra: Cleanup - Move code to query_error_want_fallback()
Timo Sirainen [Thu, 3 May 2018 13:58:21 +0000 (16:58 +0300)] 
cassandra: Cleanup - Move code to query_error_want_fallback()

This allows extending it more easily.

7 years agofs-posix: Strip trailing "/" from filenames
Timo Sirainen [Tue, 15 May 2018 14:50:27 +0000 (17:50 +0300)] 
fs-posix: Strip trailing "/" from filenames

This is mainly because "doveadm fs delete -R" adds it to indicate to the
fs-driver that the whole directory is wanted to be deleted. This change
fixes fs-posix to work with NFS, where otherwise unlink("symlink-to-dir/")
fails with ENOTDIR. Without NFS the same call succeeds.

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

Fix by Martin Waschbüsch.

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

7 years agomdbox: Assume that empty uid maps found during sync are harmless
Josef 'Jeff' Sipek [Mon, 23 Apr 2018 22:15:51 +0000 (18:15 -0400)] 
mdbox: Assume that empty uid maps found during sync are harmless

Instead of failing the sync and causing index rebuild, just skip over
the empty uid maps.  Chances are that they these records came from
various plugins that create fake mails.

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

Fixes: Panic: file pop3c-client.c: line 308 (pop3c_client_wait_one): assertion failed: (client->fd != -1 || client->state == POP3C_CLIENT_STATE_CONNECTING)
7 years agofs-posix: Fix iterating nonexistent symlinks when readdir() returns DT_UNKNOWN
Timo Sirainen [Thu, 29 Mar 2018 18:24:11 +0000 (14:24 -0400)] 
fs-posix: Fix iterating nonexistent symlinks when readdir() returns DT_UNKNOWN

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

7 years agoplugins/old-stats: Remove restrict_access_set_dumpable calls from process_io_open().
Sergey Kitov [Thu, 26 Apr 2018 06:48:39 +0000 (09:48 +0300)] 
plugins/old-stats: Remove restrict_access_set_dumpable calls from process_io_open().

proc_io_fd is opened in preinit(), while process have root access, so
restrict_access_set_dumpable() calls are not needed.

7 years agolib: Call module's preinit function, when loading
Sergey Kitov [Wed, 18 Apr 2018 10:30:50 +0000 (13:30 +0300)] 
lib: Call module's preinit function, when loading

7 years agoplugins/old-stats: Add old-stats preinit() which opens mail stats io.
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.

7 years agolib-fs: fs-posix - Add accurate-mtime parameter
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.

7 years agolib-fs: Update FS_METADATA_WRITE_FNAME comment
Timo Sirainen [Thu, 26 Apr 2018 15:23:54 +0000 (18:23 +0300)] 
lib-fs: Update FS_METADATA_WRITE_FNAME comment

7 years agolib-fs: fs-posix - FS_METADATA_WRITE_FNAME replaces the full path
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.

7 years agolib-fs: fs-metawrap - Pass FS_METADATA_WRITE_FNAME through to parent fs
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.

7 years agolib-storage: Remove mail_attachment_detection_options=add-flags-on-fetch parsing
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.

7 years agolib-storage: Fail if mail_attachment_detection_options has invalid options
Timo Sirainen [Thu, 26 Apr 2018 13:41:55 +0000 (16:41 +0300)] 
lib-storage: Fail if mail_attachment_detection_options has invalid options

7 years agolib-storage: Set $Has[No]Attachment earlier among other cached data
Timo Sirainen [Thu, 19 Apr 2018 13:38:22 +0000 (16:38 +0300)] 
lib-storage: Set $Has[No]Attachment earlier among other cached data

7 years agolib-index: mail_index_sync_map() - Don't try to-resync extension updates
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.

7 years agolib-index: Remove extension record sync handlers
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

7 years agolib: uni_utf8_get_valid_data() - Add ATTR_WARN_UNUSED_RESULT
Timo Sirainen [Wed, 25 Apr 2018 12:23:35 +0000 (15:23 +0300)] 
lib: uni_utf8_get_valid_data() - Add ATTR_WARN_UNUSED_RESULT

Ignoring the return value most likely leads to buggy code, so make sure it's
checked.

7 years agolib-storage: Don't ignore uni_utf8_get_valid_data() return value
Timo Sirainen [Wed, 25 Apr 2018 12:22:37 +0000 (15:22 +0300)] 
lib-storage: Don't ignore uni_utf8_get_valid_data() return value

It's not supposed to happen, so call i_unreached()

7 years agolib-fts: Minor fix to randomness test in test-fts-tokenizer
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.

7 years agofts: Fix indexing input that contains NULs
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.

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

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

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

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

Workarounds:

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

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

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

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

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

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

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

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

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

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

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

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

The result is not checked anyway.

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

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

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

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

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

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

7 years ago.gitignore: Ignore doc/man/doveadm-rebuild.1
Martti Rannanjärvi [Thu, 26 Apr 2018 10:18:01 +0000 (13:18 +0300)] 
.gitignore: Ignore doc/man/doveadm-rebuild.1

7 years agodoveadm: Add rebuild attachments command
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.