docs: Sieve minor revisions

- Correct link to subaddressing section
- Make the config file example snippets intended filename less ambiguous.
- Minor rephrasng.
This commit is contained in:
polarathene 2024-07-15 15:36:57 +12:00
parent 652c7967d0
commit 6a10759ff8
2 changed files with 10 additions and 11 deletions

View File

@ -57,7 +57,7 @@ An alias is typically a full email address that will either be:
As a side effect of the alias workaround for the `FILE` provisioner with this feature, aliases can be used for account login. This is not intentional. As a side effect of the alias workaround for the `FILE` provisioner with this feature, aliases can be used for account login. This is not intentional.
### Sub-addressing ### Sub-addressing { #subaddressing }
!!! info !!! info

View File

@ -81,7 +81,7 @@ For more examples or a detailed description of the Sieve language have a look at
[sieve-info::examples]: http://sieve.info/examplescripts [sieve-info::examples]: http://sieve.info/examplescripts
[third-party::sieve-examples]: https://support.tigertech.net/sieve#sieve-example-rules-jmp [third-party::sieve-examples]: https://support.tigertech.net/sieve#sieve-example-rules-jmp
## Automatic Sorting Based on Subaddresses { #subaddress-mailbox-routing } ## Automatic Sorting Based on Sub-addresses { #subaddress-mailbox-routing }
When mail is delivered to your account, it is possible to organize storing mail into folders by the [subaddress (tag)][docs::accounts-subaddressing] used. When mail is delivered to your account, it is possible to organize storing mail into folders by the [subaddress (tag)][docs::accounts-subaddressing] used.
@ -89,7 +89,7 @@ When mail is delivered to your account, it is possible to organize storing mail
This example sorts mail into inbox folders by their tag: This example sorts mail into inbox folders by their tag:
```sieve ```sieve title="docker-data/dms/config/user@example.com.dovecot.sieve"
require ["envelope", "fileinto", "mailbox", "subaddress", "variables"]; require ["envelope", "fileinto", "mailbox", "subaddress", "variables"];
# Check if the mail recipient address has a tag (:detail) # Check if the mail recipient address has a tag (:detail)
@ -110,22 +110,22 @@ When mail is delivered to your account, it is possible to organize storing mail
??? tip "Only redirect mail for specific tags" ??? tip "Only redirect mail for specific tags"
If you want to handle only specific tags this way, you could adjust these two lines from the prior example: If you want to only handle specific tags, you could replace the envelope condition and tag assignment from the prior example with:
```sieve ```sieve title="docker-data/dms/config/user@example.com.dovecot.sieve"
# Instead of `:matches`, use the default comparator `:is` (exact match) # Instead of `:matches`, use the default comparator `:is` (exact match)
if envelope :detail "to" "social" { if envelope :detail "to" "social" {
set "tag" "Social"; set "tag" "Social";
``` ```
```sieve ```sieve title="docker-data/dms/config/user@example.com.dovecot.sieve"
# You can provide a list of values to match for: # Alternatively you can also provide a list of values to match:
if envelope :detail "to" ["azure", "aws"] { if envelope :detail "to" ["azure", "aws"] {
set "tag" "Cloud"; set "tag" "Cloud";
``` ```
```sieve ```sieve title="docker-data/dms/config/user@example.com.dovecot.sieve"
# Similar to `:matches`, but `:regex` is more full featured for pattern matching. # Similar to `:matches`, except `:regex` provides enhanced pattern matching.
# NOTE: This example needs you to `require` the "regex" extension # NOTE: This example needs you to `require` the "regex" extension
if envelope :detail :regex "to" "^cloud-(azure|aws)$" { if envelope :detail :regex "to" "^cloud-(azure|aws)$" {
# Normalize the captured azure/aws tag as the resolved value is no longer fixed: # Normalize the captured azure/aws tag as the resolved value is no longer fixed:
@ -158,8 +158,7 @@ The [Manage Sieve](https://doc.dovecot.org/admin_manual/pigeonhole_managesieve_s
!!! example !!! example
```yaml ```yaml title="compose.yaml"
# compose.yaml
ports: ports:
- "4190:4190" - "4190:4190"
environment: environment: