Upgrading from Dovecot Pro 3.1.x to Dovecot Pro 3.1.7
Dovecot Pro
Changed Setting Defaults
lock_method now defaults to flock. This is required by obox plugin to avoid data corruption. Attempting to use any other lock_method fails at startup.
Changed Features
The ACL plugin replaced
dovecot-acl-listwithacl-rights.cache, which also caches the mailboxes'dovecot-aclfile rights. Each user's cache is created from the mailboxes'dovecot-aclfiles by the owner's first ACL check or change after the upgrade, which also removes the olddovecot-acl-list. After a downgrade the earlier version recreatesdovecot-acl-listby itself. When the upgraded version finds the list again, it rebuilds the cache. During a rolling upgrade, ACL changes made by a pre-upgrade backend after a user's cache was built are not in that cache, so shared mailbox listings can miss them. This ends at the owner's next ACL check on a new-version backend, which finds thedovecot-acl-listthe pre-upgrade backend recreated and rebuilds the cache. See ACL rights cache.Changed: 3.1.7 ACL entries configured with the
aclfilter are now global ACLs, the same as the entries in the removed global ACL file. Previously they were handled like the rights in a per-mailboxdovecot-aclfile. This changes the behavior in several ways:- A
dovecot-aclentry for the same identifier no longer adds to the configured rights; the configured rights override it. - Configured
anyoneandauthenticatedrights now apply also to the mailbox owner, who previously always kept their default rights. - Negative rights in a
dovecot-aclfile are reset by the first configured entry that matches the user. Note that anaclfilter at the top level of the configuration matches every mailbox of every namespace. - Updating a mailbox's ACLs no longer writes the configured rights into its
dovecot-aclfile, and creating a child mailbox no longer copies them into the child's file. Configuration changes now always take effect, also for mailboxes whose ACLs have been updated. - dsync no longer exports the configured rights as mailbox attributes.
- A
Expired authentication cache entries are no longer used when the passdb or userdb lookup fails with an internal error. This fallback was meant to allow logins while the database is temporarily down, but it was rarely useful and not worth the security risk of using stale authentication data indefinitely with a large cache.
auth_cache_ttlis now the maximum time that cached data is used. During a database outage logins fail after the cache entries have expired.
ACL Rights Cache with obox
See the "Rights Cache" section of acl plugin for how obox serves the cached rights of the mailboxes that are not in metacache.
The first rebuild after the upgrade fetches the shared mailboxes that dovecot-acl-list names and that are not in metacache - expect that one-time fetch. Without a dovecot-acl-list it asks the sharing dictionary whether the user has shares, and then fetches every mailbox that is not in metacache. That reads the whole dictionary unless acl_dict_index is enabled - with a large dictionary consider enabling it.
During a rolling upgrade, an upgraded backend serves the cached rights of the mailboxes that are not in metacache, including rights that a backend running the earlier version revoked, until the mailbox is opened or the cache is rebuilt.
After downgrading an obox installation that uses ACLs, the earlier version rebuilds dovecot-acl-list from the mailboxes that are in metacache only. Shares of the other mailboxes can then disappear from shared mailbox listings, as they could before the ACL rights cache.
During a rolling upgrade, a backend running the earlier version doesn't know acl-rights.cache and leaves it out of the user root index bundles it uploads. A user who returns to an upgraded backend gets the cache rebuilt:
- If the user root index bundle no longer has the cache, it is rebuilt from scratch. That fetches the shared mailboxes that are not in metacache, or every mailbox that is not in metacache if the earlier backend left no
dovecot-acl-listandacl_sharing_mapshows that the user has shares. - If the earlier backend only added a diff bundle, the cache comes back from the base bundle next to the
dovecot-acl-listthe earlier backend recreated. The rebuild then fetches every mailbox that has an entry in the cache or thatdovecot-acl-listnames, also the ones in metacache, because the earlier backend may have changed theirdovecot-aclfiles.
Owners that never log in themselves, such as role mailboxes, only get a cache from an ACL change made as the owner or from doveadm acl recalc -u owner. Shared access through imapc creates it as well, because the backend session runs as the owner. With a direct shared namespace it doesn't, so run doveadm acl recalc for such owners after the upgrade.
ACL User of Master Logins
The acl_user default %{master_user} was always empty in earlier versions, so a master login had the owner rights on all mailboxes of the user it logged in as. In 3.1.7 it is the master user, so the master user's own ACL rights apply, like for any other user. See ACL Master Users.
- If you never set
acl_user, shared access of master logins can be denied where it worked before. Grant the master user the rights it needs. Only if the master logins are used for administration, not for user-to-user shared access, you can keep the owner rights withacl_user = %{user}or an emptyacl_user =. Elsewhere that gives the master login the owner rights, e.g. to delete and rename, on mailboxes that are shared read-only. - If you set
userdb_acl_user=%{auth_user}in a master passdb, it is harmless from 3.1.7. Remove it once every backend runs 3.1.7: a backend on an earlier version gives master logins the owner rights without it. - If you set
userdb_acl_user=%{auth_user}in a passdb for ordinary logins, remove it now. It was always wrong there: if authentication changed the username,%{auth_user}is the original username, so the user lost the owner rights to their own mailbox.
Binary Configuration Cache
If the DOVECOT_CONFIG_CACHE environment variable is set, delete the binary.conf.* files in the directory it names when upgrading. A cache written by an earlier version is not recognized as outdated, and 3.1.7 reads it with the wrong setting type numbers. This can fail with settings errors.
Home Directory Path Handling
mail_home is now a directory path setting. It is the only setting changed this way in 3.1.7.
- A trailing
/is dropped:mail_home = /home/x/becomes/home/x. - After the
%variablesare expanded, the path is normalized (.and..components are resolved) and it must stay under the part of the value before its first%{. For example,/var/vmail/%{user | domain}/%{user | username}must stay under/var/vmail/, but/var/vmailitself is allowed. Otherwise the user's settings are invalid and the login fails. A value that starts with a%variablehas no such part and is only normalized. Symbolic links are not resolved. mail_home = /now means that the user has no home directory, because the trailing/is dropped and the value becomes empty. Earlier versions used/as the home directory. A userdbhomeor-o mail_homeof/is treated the same way.- A
homereturned by the userdb or given with-o mail_home=...is only normalized, not confined to a prefix. The trailing/is dropped before the normalization, so a normalized value of/stays:home=/x/..becomes/, a home directory and not "no home".
Before upgrading, check that mail_home and the userdb home values don't use / as the home directory, and that the mail_home in the configuration can't expand to a path outside the literal prefix.
Usernames With Dot-Only Components
A username component that consists only of dots (., .., ...) would escape its parent directory when the username is used in a path or a dict key, e.g. in mail_home. The components of a username are the parts delimited by / or @. Ordinary dotted usernames such as first.last@example.com are unaffected. The . character stays in the default auth_username_chars, so this is not a character set change.
- Authentication fails for a username with such a component, e.g.
..,..@example.comoruser@... The check is made afterauth_username_translation,auth_username_formatandauth_default_domainhave been applied, and also to the master login username. The auth log shows "Username has a path component consisting only of dots". - A passdb or userdb that returns a
user,usernameordomainfield that changes the username to one with such a component fails the authentication or the user lookup. The log shows "username attempted to be changed to one with a path component consisting only of dots". - In a shared mailbox name, an owner username with such a component, e.g.
shared/../INBOX, is reported as a nonexistent mailbox. - The
fsdict driver adds dots to a dot-only component of a username or key, so that it can't refer to the current or the parent directory. For example, a..username is stored as.....
Before upgrading, find the accounts that have a dot-only component in their username, including the usernames that a passdb or userdb returns, and rename them. After the upgrade these accounts can't log in or be looked up.
Cassandra Uncertain Writes
More Cassandra write errors are now handled as uncertain writes, because the write may have been applied: Cassandra server internal and overloaded errors, the driver running out of hosts to try, replies that couldn't be decoded and any unrecognized server error. Previously these were handled as definite failures, and dictmap deleted the storage object even though the write may have been applied, which could lose mails. Now these are handled as described in Uncertain Writes, so the success is uncertain and file write state is uncertain log messages and the fs_dictmap_dict_write_uncertain event may be seen more often.
Removed Features
| Feature | Notes |
|---|---|
acl_global_path setting | See ACL Settings Migration. |
Cluster Controller
Changed Features
Secrets Mounted as Files
The Controller chart now mounts the Controller secrets as read-only files and points the new SECRETS_DIR setting at them, instead of passing them through environment variables or rendering them into ConfigMaps. The new secretsAsFiles chart value controls this and is enabled by default. See Cluster Controller Secrets for the Kubernetes Secrets the files are taken from.
Check the following before upgrading:
- With
global.cassandra.auth, the Cassandra username and password are no longer rendered into the ConfigMaps. The chart creates thecontroller-cassandraSecret fromglobal.cassandra.auth_configwhen the password is set there. Otherwise, create it before upgrading. - The API secret key in the
controller-apiSecret now reaches the Controller, which refuses to start with an empty key. Make sureCONTROLLER_SECRET_KEYis not empty. - The API and scheduler pods now get the doveadm password as well.
To keep the previous behavior while migrating, set secretsAsFiles: false.
Deprecated Features
| Feature | Notes |
|---|---|
DOVEADM_HTTP_PASSWORD_ENV_VAR | Provide the password as a DOVEADM_HTTP_PASSWORD file in SECRETS_DIR instead. |
doveadm.passwordEnvVar chart value | Only used with secretsAsFiles: false. |
secretsAsFiles: false chart value | Passing the secrets through environment variables and ConfigMaps will be removed. |