]> git.ipfire.org Git - thirdparty/dovecot/core.git/log
thirdparty/dovecot/core.git
6 years agomdbox: Always sync dovecot.map.index with MAIL_INDEX_SYNC_FLAG_UPDATE_TAIL_OFFSET
Timo Sirainen [Mon, 17 Jun 2019 10:59:10 +0000 (13:59 +0300)] 
mdbox: Always sync dovecot.map.index with MAIL_INDEX_SYNC_FLAG_UPDATE_TAIL_OFFSET

This avoids errors after the next commit.

6 years agolib-index: mail_index_sync_update_mailbox_offset() - Remove unnecessary code
Timo Sirainen [Mon, 10 Jun 2019 19:58:44 +0000 (22:58 +0300)] 
lib-index: mail_index_sync_update_mailbox_offset() - Remove unnecessary code

The function call has no side effects, and the return values aren't used.

6 years agosubmission: submission_backend_relay_create() - Allow caller to specify SASL mechanism
Timo Sirainen [Thu, 13 Jun 2019 20:06:34 +0000 (23:06 +0300)] 
submission: submission_backend_relay_create() - Allow caller to specify SASL mechanism

6 years agosubmission: submission_backend_relay_create() - Allow caller to specify IP
Timo Sirainen [Wed, 12 Jun 2019 08:30:47 +0000 (11:30 +0300)] 
submission: submission_backend_relay_create() - Allow caller to specify IP

This way the caller can already provide IP address for the host.

6 years agosubmission: Add recipient-delimiter to settings
Timo Sirainen [Mon, 10 Jun 2019 14:29:32 +0000 (17:29 +0300)] 
submission: Add recipient-delimiter to settings

This allows plugins to easily access it.

6 years agolib-storage: Add mail_storage_service_get_global()
Timo Sirainen [Mon, 10 Jun 2019 14:27:29 +0000 (17:27 +0300)] 
lib-storage: Add mail_storage_service_get_global()

This allows accessing the global mail storage service. Normally there is
only a single service created for the process at a time, so this allows
accessing it.

6 years agolib: Add net_get_hosterror_type()
Timo Sirainen [Wed, 12 Jun 2019 08:50:08 +0000 (11:50 +0300)] 
lib: Add net_get_hosterror_type()

6 years agolib-smtp: Remove SMTP_ADDRESS_LITERAL() macro
Martti Rannanjärvi [Mon, 17 Jun 2019 18:00:56 +0000 (21:00 +0300)] 
lib-smtp: Remove SMTP_ADDRESS_LITERAL() macro

gcc 9 no longer stores compound literals in function scope, so this
macro is dangerous if you don't know it is a compound literal.

6 years agolda: Stop using SMTP_ADDRESS_LITERAL() macro
Martti Rannanjärvi [Mon, 17 Jun 2019 17:51:36 +0000 (20:51 +0300)] 
lda: Stop using SMTP_ADDRESS_LITERAL() macro

Change DEFAULT_ENVELOPE_SENDER to a const struct smtp_address instead.
gcc 9 no longer stores compound literals in function scope, so this is
safer.

6 years agolib-smtp: Expand SMTP_ADDRESS_LITERAL() macro
Martti Rannanjärvi [Mon, 17 Jun 2019 17:26:47 +0000 (20:26 +0300)] 
lib-smtp: Expand SMTP_ADDRESS_LITERAL() macro

This makes the use of compound literal explicit.

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

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

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

To allow unit-testing this function it becomes global.

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

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

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

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

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

Prevents treating numbers as string in JSON printer

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

Not all text editors add LF to the last line.

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

To avoid future confusion.

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

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

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

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

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

format = bar
format_args = ...
}

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

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

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

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

6 years agolib-storage: Sync mailbox after autoexpunging
Timo Sirainen [Wed, 12 Jun 2019 07:58:37 +0000 (10:58 +0300)] 
lib-storage: Sync mailbox after autoexpunging

This actually finishes expunging the mails. Previously the mails were
just marked to be expunged in the transaction log, and the next session
that opened the mailbox finished the expunging.

6 years agolib-index: Make sure tail_offset is updated after calling expunge handlers
Timo Sirainen [Tue, 5 Feb 2019 22:17:52 +0000 (14:17 -0800)] 
lib-index: Make sure tail_offset is updated after calling expunge handlers

Since it's a bit troublesome to track whether expunge handlers were actually
called, we can just assume that as long as syncing sees expunges, they were
called (and thet most likely were).

This fixes a bug where dovecot.index.cache header's record_count kept
shrinking and deleted_record_count kept increasing after each sync.
These values were only used to determine when to compress the cache, so
its only effect was that the cache could have been compressed earlier
than necessary.

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

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

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

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

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

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

Broken in 7f0dcac9942910c2934ceab1230e539043167601

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

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

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

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

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

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

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

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

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

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

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

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

6 years agolib-dict: dict-sql - Add username as parameter
Aki Tuomi [Fri, 19 Apr 2019 17:39:32 +0000 (20:39 +0300)] 
lib-dict: dict-sql - Add username as parameter

SQL statement caching works better when the username is provided
as parameter instead of part of the query, since the caching
can now cache same statements despite username changes.

6 years agolib-dns: Remove unused Valgrind disable
Martti Rannanjärvi [Thu, 27 Dec 2018 09:55:31 +0000 (11:55 +0200)] 
lib-dns: Remove unused Valgrind disable

6 years agolib: Add test-fd-util.c to test i_close() panic message
Martti Rannanjärvi [Thu, 23 May 2019 15:49:18 +0000 (18:49 +0300)] 
lib: Add test-fd-util.c to test i_close() panic message

6 years agocassandra: Handle cass_future_set_callback() calling callback immediately
Timo Sirainen [Mon, 20 May 2019 11:16:52 +0000 (14:16 +0300)] 
cassandra: Handle cass_future_set_callback() calling callback immediately

The previous code always assumed it would be called from another thread, but
due to race conditions this wasn't true always. The lookup could have
already finished by the time cass_future_set_callback() was called, in which
case it called the callback immediately.

If the callback was called from the main thread, it still wrote to the
fd_pipe. Because this was a blocking write, it was possible that the pipe
ended becoming full, which caused the whole dict process to hang.

6 years agocassandra: Move cassandra_callback_run() earlier
Timo Sirainen [Mon, 20 May 2019 11:16:08 +0000 (14:16 +0300)] 
cassandra: Move cassandra_callback_run() earlier

Simplifies the next commit.

6 years agolib: test-event-flatten - Fix initializators for value
Aki Tuomi [Wed, 22 May 2019 06:12:08 +0000 (09:12 +0300)] 
lib: test-event-flatten - Fix initializators for value

Older gcc complains about using anonymous members directly,
so instead use nested braces. This fixes the issue.

Continues fix in ae3c9db544c40367cded872a5f46dbd6abc8cd78

6 years agolib: Add initializers to test-event-flatten
Martti Rannanjärvi [Tue, 21 May 2019 10:16:52 +0000 (13:16 +0300)] 
lib: Add initializers to test-event-flatten

This is to fix a compiler warning.

6 years agolib: ostream-file - Use TCP_NODELAY when uncorking, not corking
Timo Sirainen [Mon, 20 May 2019 13:33:30 +0000 (16:33 +0300)] 
lib: ostream-file - Use TCP_NODELAY when uncorking, not corking

6 years agolib: ostream-file - Don't try to set TCP options after stream is closed
Timo Sirainen [Mon, 20 May 2019 20:46:43 +0000 (23:46 +0300)] 
lib: ostream-file - Don't try to set TCP options after stream is closed

Flushing the buffer could close the stream and the fd.

6 years agostats: event export - Add tabescaped plain text format support
Josef 'Jeff' Sipek [Thu, 4 Apr 2019 11:25:45 +0000 (14:25 +0300)] 
stats: event export - Add tabescaped plain text format support

This commit adds support for format=tab-text.

Since we don't care to select a native timestamp data type, one must specify
exactly one time-* format_args token.

6 years agostats: event export - Add http-post transport support
Josef 'Jeff' Sipek [Thu, 4 Apr 2019 11:24:50 +0000 (14:24 +0300)] 
stats: event export - Add http-post transport support

This commit adds support for transport=http-post.

The value of transport_args is used as the HTTP POST URL.

6 years agostats: event export - Add log transport support
Josef 'Jeff' Sipek [Thu, 4 Apr 2019 11:24:24 +0000 (14:24 +0300)] 
stats: event export - Add log transport support

This commit adds support for transport=log.

The log transport ignores transport_args.

6 years agostats: event export - Add json format support
Josef 'Jeff' Sipek [Thu, 4 Apr 2019 11:23:41 +0000 (14:23 +0300)] 
stats: event export - Add json format support

This commit adds support for format=json.

Since JSON doesn't have a native timestamp data type, one must specify
exactly one time-* format_args token.

6 years agostats: event export - Implement core functionality
Josef 'Jeff' Sipek [Fri, 19 Apr 2019 13:48:26 +0000 (09:48 -0400)] 
stats: event export - Implement core functionality

The core event exporter feature.  It extends the metric { } config blocks
and adds new event_exporter { } blocks.

event_exporter EXNAME {
        format = FMT                    # required, see below
        format_args = FMTARGS           # optional, see below
        transport = TRANSPORT           # required, see below
        transport_args = TRANSPORTARGS  # optional, see below
}
metric METNAME {
        ... normal metric fields ...
        exporter = EXNAME        # required to make export happen
        exporter_include = INCS  # optional, see below
}

FMT is a string identifying which format to serialize the event into. As of
this commit, the only valid value is "none" (always the empty string).

FMTARGS is a set of tokens that tweak how certain data types are encoded. If
not specified, the format's default is used ("none" always emits empty strings
so it doesn't care what this is set to, future formats will make use of this
setting).  Currently the only possible tokens are: "time-rfc3339" and
"time-unix" - as their names imply, they format all timestamps as either
RFC3339 or Unix-style seconds since 1970-01-01 00:00:00 UTC.

TRANSPORT is a string identifying how to transport the serialized event. As
of this commit, the only valid value is "drop" which simply drops the event.

TRANSPORTARGS is a string used by the transport to tweak its behavior. The
drop transport ignores the args.

INCS is a string made up of tokens ("name", "hostname", "timestamps",
"categories", and "fields") which control what parts of an event are
exported. It can be set to any set of those (including empty set) and the
order doesn't matter.  It defaults to all 5 tokens.

6 years agolib-master: Use event_minimize() to simplify the event before sending to stats
Josef 'Jeff' Sipek [Mon, 1 Apr 2019 12:52:04 +0000 (15:52 +0300)] 
lib-master: Use event_minimize() to simplify the event before sending to stats

6 years agolib: Add event_minimize()
Josef 'Jeff' Sipek [Mon, 1 Apr 2019 10:23:41 +0000 (13:23 +0300)] 
lib: Add event_minimize()

At times, we want to simplify the structure of events before sending them to
the stats process thereby minimizing the amount of data transfered and the
amount of work the stats process has to do.  This simplification before
sending allows us to incur the CPU penalty in the (many) sending processes
instead of in the (sole & single-threaded) stats process.

Unlike the code in lib-master, this implementation flattens part of the
parent chain backwards so that parents' fields are properly overridden by
their children.  It exists in lib because it shares code with the recently
added event_flatten().

6 years agolib-master: Fix event stats test compare function arg order
Josef 'Jeff' Sipek [Thu, 11 Apr 2019 21:31:34 +0000 (17:31 -0400)] 
lib-master: Fix event stats test compare function arg order

The arguments were backwards.

6 years agolib: Move event filter test's event categories from stack to .data
Josef 'Jeff' Sipek [Tue, 16 Apr 2019 22:45:21 +0000 (18:45 -0400)] 
lib: Move event filter test's event categories from stack to .data

Event categories must not be allocated on the stack.  Categories must be
accessible for the duration of the program runtime.

6 years agostats: Rename stats filter to indicate what it is for
Josef 'Jeff' Sipek [Thu, 7 Mar 2019 17:58:35 +0000 (12:58 -0500)] 
stats: Rename stats filter to indicate what it is for

This makes the next commit a little cleaner.

6 years agolib-master: Add a comment clarifying when events must be sent to stats
Josef 'Jeff' Sipek [Fri, 19 Apr 2019 13:50:53 +0000 (09:50 -0400)] 
lib-master: Add a comment clarifying when events must be sent to stats

6 years agolib-master: minor refactor of stats_client_send_event()
Josef 'Jeff' Sipek [Fri, 15 Mar 2019 01:19:59 +0000 (21:19 -0400)] 
lib-master: minor refactor of stats_client_send_event()

This makes later event exporting commits cleaner.

6 years agolib: Add event_flatten() to return a flattened event
Josef 'Jeff' Sipek [Fri, 15 Mar 2019 00:30:29 +0000 (20:30 -0400)] 
lib: Add event_flatten() to return a flattened event

6 years agolib: replace event_copy_categories_fields() into two
Josef 'Jeff' Sipek [Fri, 15 Mar 2019 00:21:15 +0000 (20:21 -0400)] 
lib: replace event_copy_categories_fields() into two

It is more flexible to allow to copy only categories or only fields.

6 years agolib: fixup str_append_tabescaped()'s { placement
Josef 'Jeff' Sipek [Fri, 3 May 2019 14:30:39 +0000 (10:30 -0400)] 
lib: fixup str_append_tabescaped()'s { placement

This makes it consistent with the rest of the file.

6 years agolib: ostream-file - Ignore ENOPROTOOPT error also when setting TCP_NODELAY
Timo Sirainen [Fri, 17 May 2019 13:13:17 +0000 (16:13 +0300)] 
lib: ostream-file - Ignore ENOPROTOOPT error also when setting TCP_NODELAY

This happens in some OSes.

6 years agolib: ostream-file - Don't use TCP_CORK or TCP_NODELAY for UNIX sockets
Timo Sirainen [Fri, 17 May 2019 13:12:24 +0000 (16:12 +0300)] 
lib: ostream-file - Don't use TCP_CORK or TCP_NODELAY for UNIX sockets

Either they fail or just don't do anything.

6 years agovirtual: Fix calling mail_add_temp_wanted_fields() before mail is set
Timo Sirainen [Fri, 27 Apr 2018 11:26:46 +0000 (14:26 +0300)] 
virtual: Fix calling mail_add_temp_wanted_fields() before mail is set

Fixes:
Panic: file virtual-mail.c: line 123 (backend_mail_get): assertion failed: (bbox != NULL)

6 years agovirtual: Fix mail.add_temp_wanted_fields() to handle headers correctly
Timo Sirainen [Fri, 27 Apr 2018 10:56:13 +0000 (13:56 +0300)] 
virtual: Fix mail.add_temp_wanted_fields() to handle headers correctly

The header that was passed to backend contained wrong index numbers, causing
wrong headers to be used.

6 years agolib-storage: Update mail_add_temp_wanted_fields() comment
Timo Sirainen [Fri, 27 Apr 2018 10:52:28 +0000 (13:52 +0300)] 
lib-storage: Update mail_add_temp_wanted_fields() comment

6 years agolib-storage: Move code to a new mailbox_header_lookup_merge()
Timo Sirainen [Fri, 27 Apr 2018 10:49:53 +0000 (13:49 +0300)] 
lib-storage: Move code to a new mailbox_header_lookup_merge()

6 years agolib: ostream-file - Don't try to set TCP_NODELAY for non-socket fds
Timo Sirainen [Wed, 15 May 2019 07:25:47 +0000 (10:25 +0300)] 
lib: ostream-file - Don't try to set TCP_NODELAY for non-socket fds

Also log if there are any unexpected errors.

6 years agolib-storage: Don't try to set attachment keywords if bodystructure wasn't parsed
Aki Tuomi [Wed, 15 May 2019 07:49:09 +0000 (10:49 +0300)] 
lib-storage: Don't try to set attachment keywords if bodystructure wasn't parsed

This was broken in 057028e3f5567e21c964005ffccda1055fa86508 as there are
code paths leading here that omit bodystructure processing.

Fixes Panic: file index-mail.c: line 1150 (index_mail_parse_body_finish): assertion failed: (mail->data.parsed_bodystructure)

6 years agolib: Make sure uncorking ostream-file flushes network output immediately
Timo Sirainen [Fri, 10 May 2019 15:06:46 +0000 (18:06 +0300)] 
lib: Make sure uncorking ostream-file flushes network output immediately

TCP_CORK and TCP_NODELAY are separate things, but we'll treat them similarly
for our ostream corking API. It was always intended that all data written
inside corking would be delayed until uncork, and immediately sent
afterwards.

This change removes unnecessary extra 40ms delays, which may happen when
proxying.

6 years agodoveadm: Add error_r to server_connection_create()
Martti Rannanjärvi [Mon, 13 May 2019 13:16:43 +0000 (16:16 +0300)] 
doveadm: Add error_r to server_connection_create()

6 years agolib: i_zero*() - Update comment, especially about arrays
Timo Sirainen [Mon, 13 May 2019 13:03:27 +0000 (16:03 +0300)] 
lib: i_zero*() - Update comment, especially about arrays

6 years agolib: i_zero*() - Remove extra "+"
Timo Sirainen [Mon, 13 May 2019 12:57:26 +0000 (15:57 +0300)] 
lib: i_zero*() - Remove extra "+"

It was ignored by compilers though.

6 years agodoveadm-dsync: Always cleanup after connection
Aki Tuomi [Fri, 10 May 2019 12:55:22 +0000 (15:55 +0300)] 
doveadm-dsync: Always cleanup after connection

Go through the same error handling path every time. Fixes
Panic: file ioloop.c: line 826 (io_loop_destroy): assertion failed: (ioloop == current_ioloop)

This happened because the ioloop wasn't destroyed
on error.

6 years agodoveadm-dsync: Move actual command execution to dsync_server_run_command
Aki Tuomi [Fri, 10 May 2019 12:54:37 +0000 (15:54 +0300)] 
doveadm-dsync: Move actual command execution to dsync_server_run_command

Simplifies next commit

6 years agolib-storage: Attachment flag detection shouldn't cause mail body to be opened
Timo Sirainen [Fri, 10 May 2019 16:16:07 +0000 (19:16 +0300)] 
lib-storage: Attachment flag detection shouldn't cause mail body to be opened

Fetching cached mail headers with
mail_attachment_detection_options=add-flags-on-save caued IMAP BODYSTRUCTURE
to be fetched as well. If it wasn't already cached, this caused opening the
mail body to generate it. Also the result wasn't added to cache, so the
inefficient behavior continued.

6 years agoglobal: Add asserts to make static analyzers happy
Timo Sirainen [Thu, 9 May 2019 16:52:51 +0000 (19:52 +0300)] 
global: Add asserts to make static analyzers happy

6 years agodoveadm dict: Make it clear that *iter_flags can't dereference NULL pointer
Timo Sirainen [Thu, 9 May 2019 16:48:43 +0000 (19:48 +0300)] 
doveadm dict: Make it clear that *iter_flags can't dereference NULL pointer

It's not possible to dereference it anyway, because only "doveadm dict iter"
has these iter parameters. This change fixes warnings from static analyzers.

6 years agolib-storage: Fix mail_user_home_mkdir() crash when user has no home directory
Timo Sirainen [Thu, 9 May 2019 16:27:18 +0000 (19:27 +0300)] 
lib-storage: Fix mail_user_home_mkdir() crash when user has no home directory

This is used only by dsync when creating lock file. It wouldn't work
without a home directory anyway.

6 years agolib: net_*() - Make sure sockaddr_union is always cleared
Timo Sirainen [Thu, 9 May 2019 16:22:28 +0000 (19:22 +0300)] 
lib: net_*() - Make sure sockaddr_union is always cleared

Fixes scan-build warnings

6 years agolib: data-stack - Make STACK_BLOCK_DATA() behavior clearer
Timo Sirainen [Thu, 9 May 2019 16:19:42 +0000 (19:19 +0300)] 
lib: data-stack - Make STACK_BLOCK_DATA() behavior clearer

Otherwise scan-build thinks that it's pointing outside valid memory in the
struct and gives an error:

"Memory set function accesses out-of-bound array element"

6 years agoglobal: Change CALLBACK_TYPECHECK() to used with subtraction
Timo Sirainen [Thu, 9 May 2019 12:29:34 +0000 (15:29 +0300)] 
global: Change CALLBACK_TYPECHECK() to used with subtraction

This is because clang's -Wstring-plus-int gave warnings when using
"string" + CALLBACK_TYPECHECK(), but there are no warnings when using
"string" - CALLBACK_TYPECHECK(). It would have been enough to change
only the string parameters to use "-", but for consistency this commit
changes all of them.

6 years agodict: Make sure connection IO is stopped when client is disconnected
Timo Sirainen [Fri, 10 May 2019 14:45:14 +0000 (17:45 +0300)] 
dict: Make sure connection IO is stopped when client is disconnected

I'm not sure if this fixes anything, but it makes the behavior closer to
what it was before 2ff2da52146609f4459bd0f7fd603e13400cb85e.

6 years agodict: Fix client connection reference counting
Timo Sirainen [Fri, 10 May 2019 14:44:04 +0000 (17:44 +0300)] 
dict: Fix client connection reference counting

If the client disconnected while commands were still running, the destroy
callback could have been called multiple times.

Broken by 2ff2da52146609f4459bd0f7fd603e13400cb85e

Fixes:
Panic: file dict-connection.c: line 149 (dict_connection_unref): assertion failed: (array_count(&conn->cmds) == 0)

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

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

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

Doing so will break quota warnings.

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

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

6 years agolib: connection - Make sure the connection name is always available.
Stephan Bosch [Thu, 28 Mar 2019 20:41:53 +0000 (21:41 +0100)] 
lib: connection - Make sure the connection name is always available.

6 years agolib-storage: maildir: maildir-copy - Fix omission of keywords while copying message...
Stephan Bosch [Fri, 11 Jan 2019 13:33:59 +0000 (14:33 +0100)] 
lib-storage: maildir: maildir-copy - Fix omission of keywords while copying message with hardlinking.

6 years agolib-storage: maildir: maildir-save - Move final copying of keywords to a separate...
Stephan Bosch [Fri, 11 Jan 2019 13:16:39 +0000 (14:16 +0100)] 
lib-storage: maildir: maildir-save - Move final copying of keywords to a separate function.

6 years agosubmission: Remove unnecessary client.session_id
Timo Sirainen [Wed, 8 May 2019 09:42:09 +0000 (12:42 +0300)] 
submission: Remove unnecessary client.session_id

It's also available in client.user.session_id

6 years agosubmission: Remove duplicate %{session} from submission_logout_format handling
Timo Sirainen [Wed, 8 May 2019 09:41:13 +0000 (12:41 +0300)] 
submission: Remove duplicate %{session} from submission_logout_format handling

It already comes from mail_user_var_expand_table()

6 years agopop3: Remove unnecessary client.session_id
Timo Sirainen [Wed, 8 May 2019 09:37:41 +0000 (12:37 +0300)] 
pop3: Remove unnecessary client.session_id

It's also available in client.user.session_id

6 years agopop3: Remove duplicate %{session} from pop3_logout_format handling
Timo Sirainen [Wed, 8 May 2019 09:35:51 +0000 (12:35 +0300)] 
pop3: Remove duplicate %{session} from pop3_logout_format handling

It already comes from mail_user_var_expand_table()

6 years agologin-common: Add a comment to remember to keep login %variables synced
Timo Sirainen [Wed, 8 May 2019 09:30:25 +0000 (12:30 +0300)] 
login-common: Add a comment to remember to keep login %variables synced

6 years agopop3: Remove duplicate %d from pop3_logout_format handling
Timo Sirainen [Wed, 8 May 2019 09:25:39 +0000 (12:25 +0300)] 
pop3: Remove duplicate %d from pop3_logout_format handling

The first %d was always used as intended, so this didn't actually cause any
bugs. It was confusing though.

6 years agolib: event-log - Add support for logging with log_type as a parameter.
Stephan Bosch [Sun, 10 Mar 2019 22:09:46 +0000 (23:09 +0100)] 
lib: event-log - Add support for logging with log_type as a parameter.

6 years agoNEWS: Add news for 2.3.6
Aki Tuomi [Mon, 29 Apr 2019 06:01:44 +0000 (09:01 +0300)] 
NEWS: Add news for 2.3.6

6 years agofts-solr: Add soft_commit setting
John Fawcett [Wed, 24 Apr 2019 07:37:55 +0000 (10:37 +0300)] 
fts-solr: Add soft_commit setting

soft_commit=yes|no: send softCommit to the solr server, default yes is backwards compatible behaviour
If setting to no autoSoftCommit on solr should be set to something reasonable (e.g. 60 seconds)
in file solrconfig.xml

6 years agofts-solr: Add batch_size configuration option
John Fawcett [Wed, 24 Apr 2019 07:34:49 +0000 (10:34 +0300)] 
fts-solr: Add batch_size configuration option

batch_size: configure the number of emails sent in single requests to solr, default 1000

6 years agofts-solr: Only increment ctx->mails_since_flush after flush
Aki Tuomi [Mon, 29 Apr 2019 11:07:19 +0000 (14:07 +0300)] 
fts-solr: Only increment ctx->mails_since_flush after flush

Otherwise it gets wrongly increment before flush.