exim4:sieve_filter
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
exim4:sieve_filter [2016/11/14 14:37] – peter | exim4:sieve_filter [2020/07/15 09:30] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 9: | Line 9: | ||
< | < | ||
userforward: | userforward: | ||
- | driver = redirect | + | |
- | allow_filter | + | allow_filter |
- | user = mail | + | user = mail |
- | group = mail | + | group = mail |
- | file = / | + | file = / |
- | no_verify | + | no_verify |
- | no_expn | + | no_expn |
- | check_ancestor | + | check_ancestor |
- | file_transport = local_delivery | + | file_transport = local_delivery |
- | pipe_transport = address_pipe | + | pipe_transport = address_pipe |
- | reply_transport = address_reply | + | reply_transport = address_reply |
- | condition = ${if exists{/ | + | condition = ${if exists{/ |
</ | </ | ||
Line 27: | Line 27: | ||
< | < | ||
local_delivery: | local_delivery: | ||
- | driver = appendfile | + | |
- | check_string = "" | + | check_string = "" |
- | delivery_date_add | + | delivery_date_add |
- | directory = / | + | directory = / |
- | directory_mode = 770 | + | directory_mode = 770 |
- | envelope_to_add | + | envelope_to_add |
- | group = mail | + | group = mail |
- | maildir_format | + | maildir_format |
- | maildir_tag = , | + | maildir_tag = , |
- | message_prefix = "" | + | message_prefix = "" |
- | message_suffix = "" | + | message_suffix = "" |
- | mode = 0660 | + | mode = 0660 |
</ | </ | ||
Line 58: | Line 58: | ||
#end = autoresponder = | #end = autoresponder = | ||
</ | </ | ||
+ | |||
+ | or | ||
+ | |||
+ | < | ||
+ | # Sieve filter | ||
+ | require [" | ||
+ | |||
+ | #begin = forward = | ||
+ | # | ||
+ | redirect :copy " | ||
+ | #end = forward = | ||
+ | |||
+ | #begin = autoresponder = | ||
+ | # | ||
+ | vacation :days 1 :subject " | ||
+ | #end = autoresponder = | ||
+ | |||
+ | #begin = filters = | ||
+ | #sieve filter | ||
+ | |||
+ | |||
+ | # | ||
+ | if header :contains [" | ||
+ | fileinto " | ||
+ | stop ; | ||
+ | } | ||
+ | |||
+ | #end sieve filter | ||
+ | |||
+ | #end = filters = | ||
+ | keep ; | ||
+ | </ | ||
+ | |||
+ | ===== Another approach ===== | ||
+ | |||
+ | Should you want to use Exim's Sieve support there are three main caveats: | ||
+ | |||
+ | * Sieve files accessed from redirect routers need to be readable by the uid of the process that handles the SMTP connection, (e.g. Debian-exim) | ||
+ | * While the [[http:// | ||
+ | * Exim requires that sieve filter files identify themselves with "# Sieve filter" | ||
+ | |||
+ | < | ||
+ | ACTIVE_SIEVE = / | ||
+ | VACATION_DIR = / | ||
+ | VDOM_MAILDIR = / | ||
+ | </ | ||
+ | |||
+ | The following router is installed to / | ||
+ | |||
+ | < | ||
+ | vdom_sieve: | ||
+ | debug_print = "R: vdom_sieve for $local_part@$domain" | ||
+ | driver = redirect | ||
+ | domains = +local_domains | ||
+ | require_files = ACTIVE_SIEVE | ||
+ | no_verify | ||
+ | no_expn | ||
+ | check_ancestor | ||
+ | allow_filter = true | ||
+ | local_part_suffix = +* : -* | ||
+ | local_part_suffix_optional | ||
+ | data = "# | ||
+ | sieve_useraddress = " | ||
+ | sieve_subaddress = " | ||
+ | sieve_vacation_directory = VACATION_DIR | ||
+ | pipe_transport = address_pipe | ||
+ | reply_transport = address_reply | ||
+ | file_transport = vdom_sieve_file | ||
+ | </ | ||
+ | |||
+ | Note, the redirect router allows either " | ||
+ | |||
+ | / | ||
+ | |||
+ | < | ||
+ | vdom_sieve_file: | ||
+ | debug_print = "T: vdom_sieve_file for $local_part@$domain ($address_file)" | ||
+ | driver = appendfile | ||
+ | delivery_date_add | ||
+ | envelope_to_add | ||
+ | return_path_add | ||
+ | directory = VDOM_MAILDIR/ | ||
+ | {^.(INBOX|inbox)/ | ||
+ | maildir_format = true | ||
+ | user = vmail | ||
+ | group = vmail | ||
+ | </ | ||
+ | | ||
+ | Note: The directory line might need a little fixing to fully support Maildir, but currently it replaces "/" | ||
===== References ===== | ===== References ===== | ||
+ | |||
+ | http:// | ||
https:// | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// |
exim4/sieve_filter.1479134263.txt.gz · Last modified: 2020/07/15 09:30 (external edit)