mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-08-04 10:05:00 +02:00
docs: Refactor pages for Account Management (#4122)
* docs: Relocate account / auth pages into a common section * docs: Update references to relocated pages * docs: Add account management overview page Updates remaining links to account sections on this page instead (_for `accounts`, `aliases`, `quotas`_). This page will cover the features and defer to separate pages for more specific content where relevant. * docs: Correct relocated pages titles and links * docs: Accounts (Dovecot Master) - Minor revisions * docs: Fix highlighting roundcube PHP snippet in OAuth2 page * docs: Accounts (File) - Refactor - Manual method not necessary to document. - Condense `setup` example guidance. - Quotas / Aliases content migrated to Overview when not specific about file provisioner. Some of the content is this commit is not a complete revision. * chore: Temporary commit * docs(refactor): Sub-addressing section Much better docs on the sub-addressing feature supported by Postfix and Dovecot, along with the guidance with usage in Sieve. * docs: Revise accounts section Add some context regarding DMS accounts and their distinction/overlap from the email address functionality, and it's relevant context for receiving/sending. File provisioner, minor revisions to referencing associated config files and account management. * docs: Minor adjustments * docs: Refactor the quota section Better documented with links and coverage over the workaround details we've implemented. * docs: Revise the quota section Minor revisions with phrasing, admonitions for structure and better explanation of the feature functionality/purpose. * docs: Alias section refactor Extensively covers known issues and technical details that have been discussed often enough. The improvements should benefit both users and maintainers. * docs: Refactor master accounts page This rewrite should more clearly document the feature, along with a better example and additional links for reference. * docs: OAuth2 revision Minor update to this page: - Links extracted to bottom of page as per convention. - ENV file example converted to preferred `compose.yaml` ENV settings. * docs: Sieve minor revisions - Correct link to subaddressing section - Make the config file example snippets intended filename less ambiguous. - Minor rephrasng. * docs: Revise accounts overview section Revised the account section and added additional clarity for common confusion with relation to sender address and multi-domain support. Top of the page now clarifies it's a technical reference and directs users to the related pages for configuration / caveats. Technical Overview links to Dovecot docs were missing. * docs: Another revision pass File based provisioner docs: - Sections indent with info admonitions. - Accounts section expanded with config format and example. - Quotas section expanded and shifted to bottom (alphabetical sort). - Split into `setup` CLI and config reference groups. Overview page: - Sections indent with info admonitions. - Revised content. * docs(chore): Shift sub-addressing section This is related to accounts and aliases, but not provisioners, thus extract out of the accounts parent section. * docs: Document `postfix-accounts.cf` third column This lacked documentation but was community contributed feature to allow further customization of a Dovecot Account. It has caveats as DMS does not take these into consideration anywhere in scripts. Documenting officially for better awareness. * docs: Revise and expand supplementary pages Better outline the OAuth2 login process, the two supported login mechanisms and their docs/rfcs, along with documenting caveat with mail client compatibility. Add a verification tip for the OAuth2 support, showing how `curl` can be used, along with caveat presently affecting the `curl` in DMS v14. Additionally note the feature still isn't documented fully, providing the user with additional references for more information. `ACCOUNT_PROVISIONER` ENV docs minimized. No `OIDC` provisioner plans, the OAuth2 docs page now mentions SCIM 2.0 API as the next step towards resolving that concern. The tip admonition was removed as it no longer provides value, instead we link to the Account Management overview page. Dovecot Master Accounts docs page now lightly document the `setup` CLI and config format for the feature. * docs: Fix broken anchor links Some anchor links to different parts of our docs have gone stale. This branch also broke a few itself that I missed. The build now only reports issues with anchor links to Content Tabs, which it must not be aware of during the build (_MKDocs Material specific feature?_) * docs(lint): Fix indentation level * chore: Add entry to `CHANGELOG.md` + corrections
This commit is contained in:
parent
c5f125c973
commit
0698ad9370
25 changed files with 828 additions and 259 deletions
|
@ -81,22 +81,76 @@ For more examples or a detailed description of the Sieve language have a look at
|
|||
[sieve-info::examples]: http://sieve.info/examplescripts
|
||||
[third-party::sieve-examples]: https://support.tigertech.net/sieve#sieve-example-rules-jmp
|
||||
|
||||
## Automatic Sorting Based on Subaddresses
|
||||
## Automatic Sorting Based on Sub-addresses { #subaddress-mailbox-routing }
|
||||
|
||||
It is possible to sort subaddresses such as `user+mailing-lists@example.com` into a corresponding folder (here: `INBOX/Mailing-lists`) automatically.
|
||||
When mail is delivered to your account, it is possible to organize storing mail into folders by the [subaddress (tag)][docs::accounts-subaddressing] used.
|
||||
|
||||
```sieve
|
||||
require ["envelope", "fileinto", "mailbox", "subaddress", "variables"];
|
||||
!!! example "Example: `user+<tag>@example.com` to `INBOX/<Tag>`"
|
||||
|
||||
if envelope :detail :matches "to" "*" {
|
||||
set :lower :upperfirst "tag" "${1}";
|
||||
if mailboxexists "INBOX.${1}" {
|
||||
fileinto "INBOX.${1}";
|
||||
} else {
|
||||
fileinto :create "INBOX.${tag}";
|
||||
}
|
||||
}
|
||||
```
|
||||
This example sorts mail into inbox folders by their tag:
|
||||
|
||||
```sieve title="docker-data/dms/config/user@example.com.dovecot.sieve"
|
||||
require ["envelope", "fileinto", "mailbox", "subaddress", "variables"];
|
||||
|
||||
# Check if the mail recipient address has a tag (:detail)
|
||||
if envelope :detail :matches "to" "*" {
|
||||
# Create a variable `tag`, with the the captured `to` value normalized (SoCIAL => Social)
|
||||
set :lower :upperfirst "tag" "${1}";
|
||||
|
||||
# Store the mail into a folder with the tag name, nested under your inbox folder:
|
||||
if mailboxexists "INBOX.${tag}" {
|
||||
fileinto "INBOX.${tag}";
|
||||
} else {
|
||||
fileinto :create "INBOX.${tag}";
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
When receiving mail for `user+social@example.com` it would be delivered into the `INBOX/Social` folder.
|
||||
|
||||
??? tip "Only redirect mail for specific tags"
|
||||
|
||||
If you want to only handle specific tags, you could replace the envelope condition and tag assignment from the prior example with:
|
||||
|
||||
```sieve title="docker-data/dms/config/user@example.com.dovecot.sieve"
|
||||
# Instead of `:matches`, use the default comparator `:is` (exact match)
|
||||
if envelope :detail "to" "social" {
|
||||
set "tag" "Social";
|
||||
```
|
||||
|
||||
```sieve title="docker-data/dms/config/user@example.com.dovecot.sieve"
|
||||
# Alternatively you can also provide a list of values to match:
|
||||
if envelope :detail "to" ["azure", "aws"] {
|
||||
set "tag" "Cloud";
|
||||
```
|
||||
|
||||
```sieve title="docker-data/dms/config/user@example.com.dovecot.sieve"
|
||||
# Similar to `:matches`, except `:regex` provides enhanced pattern matching.
|
||||
# NOTE: This example needs you to `require` the "regex" extension
|
||||
if envelope :detail :regex "to" "^cloud-(azure|aws)$" {
|
||||
# Normalize the captured azure/aws tag as the resolved value is no longer fixed:
|
||||
set :lower :upperfirst "vendor" "${1}";
|
||||
# If a `.` exists in the tag, it will create nested folders:
|
||||
set "tag" "Cloud.${vendor}";
|
||||
```
|
||||
|
||||
**NOTE:** There is no need to lowercase the tag in the conditional as the [`to` value is a case-insensitive check][sieve-docs::envelope].
|
||||
|
||||
??? abstract "Technical Details"
|
||||
|
||||
- Dovecot supports this feature via the _Sieve subaddress extension_ ([RFC 5233][rfc::5233::sieve-subaddress]).
|
||||
- Only a single tag per subaddress is supported. Any additional tag delimiters are part of the tag value itself.
|
||||
- The Dovecot setting [`recipient_delimiter`][dovecot-docs::config::recipient_delimiter] (default: `+`) configures the tag delimiter. This is where the `local-part` of the recipient address will split at, providing the `:detail` (tag) value for Sieve.
|
||||
|
||||
---
|
||||
|
||||
`INBOX` is the [default namespace configured by Dovecot][dovecot-docs::namespace].
|
||||
|
||||
- If you omit the `INBOX.` prefix from the sieve script above, the mailbox (folder) for that tag is created at the top-level alongside your Trash and Junk folders.
|
||||
- The `.` between `INBOX` and `${tag}` is important as a [separator to distinguish mailbox names][dovecot-docs::mailbox-names]. This can vary by mailbox format or configuration. DMS uses [`Maildir`][dovecot-docs::mailbox-formats::maildir] by default, which uses `.` as the separator.
|
||||
- [`lmtp_save_to_detail_mailbox = yes`][dovecot-docs::config::lmtp_save_to_detail_mailbox] can be set in `/etc/dovecot/conf.d/20-lmtp.conf`:
|
||||
- This implements the feature globally, except for the tag normalization and `INBOX.` prefix parts of the example script.
|
||||
- However, if the sieve script is also present, the script has precedence and will handle this task instead when the condition is successful, otherwise falling back to the global feature.
|
||||
|
||||
## Manage Sieve
|
||||
|
||||
|
@ -104,8 +158,7 @@ The [Manage Sieve](https://doc.dovecot.org/admin_manual/pigeonhole_managesieve_s
|
|||
|
||||
!!! example
|
||||
|
||||
```yaml
|
||||
# compose.yaml
|
||||
```yaml title="compose.yaml"
|
||||
ports:
|
||||
- "4190:4190"
|
||||
environment:
|
||||
|
@ -122,3 +175,14 @@ The extension is known to work with the following ManageSieve clients:
|
|||
|
||||
- **[Sieve Editor](https://github.com/thsmi/sieve)** a portable standalone application based on the former Thunderbird plugin.
|
||||
- **[Kmail](https://kontact.kde.org/components/kmail/)** the mail client of [KDE](https://kde.org/)'s Kontact Suite.
|
||||
|
||||
[docs::accounts-subaddressing]: ../account-management/overview.md#sub-addressing
|
||||
|
||||
[dovecot-docs::namespace]: https://doc.dovecot.org/configuration_manual/namespace/
|
||||
[dovecot-docs::mailbox-names]: https://doc.dovecot.org/configuration_manual/sieve/usage/#mailbox-names
|
||||
[dovecot-docs::mailbox-formats::maildir]: https://doc.dovecot.org/admin_manual/mailbox_formats/maildir/#maildir-mbox-format
|
||||
[dovecot-docs::config::lmtp_save_to_detail_mailbox]: https://doc.dovecot.org/settings/core/#core_setting-lmtp_save_to_detail_mailbox
|
||||
[dovecot-docs::config::recipient_delimiter]: https://doc.dovecot.org/settings/core/#core_setting-recipient_delimiter
|
||||
|
||||
[rfc::5233::sieve-subaddress]: https://datatracker.ietf.org/doc/html/rfc5233
|
||||
[sieve-docs::envelope]: https://thsmi.github.io/sieve-reference/en/test/core/envelope.html
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue