exim4:sieve_filter
Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
exim4:sieve_filter [2016/11/14 14:31] – created peter | exim4:sieve_filter [2020/07/15 09:30] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
====== Exim4 - Sieve Filter ====== | ====== Exim4 - Sieve Filter ====== | ||
+ | Exim4 Sieve filter. | ||
+ | |||
+ | The filter contains an automatic response and a forwarding. | ||
+ | |||
+ | router | ||
+ | |||
+ | < | ||
+ | userforward: | ||
+ | driver = redirect | ||
+ | allow_filter | ||
+ | user = mail | ||
+ | group = mail | ||
+ | file = / | ||
+ | no_verify | ||
+ | no_expn | ||
+ | check_ancestor | ||
+ | file_transport = local_delivery | ||
+ | pipe_transport = address_pipe | ||
+ | reply_transport = address_reply | ||
+ | condition = ${if exists{/ | ||
+ | </ | ||
+ | |||
+ | Transport | ||
+ | |||
+ | < | ||
+ | local_delivery: | ||
+ | driver = appendfile | ||
+ | check_string = "" | ||
+ | delivery_date_add | ||
+ | directory = / | ||
+ | directory_mode = 770 | ||
+ | envelope_to_add | ||
+ | group = mail | ||
+ | maildir_format | ||
+ | maildir_tag = , | ||
+ | message_prefix = "" | ||
+ | message_suffix = "" | ||
+ | mode = 0660 | ||
+ | </ | ||
+ | |||
+ | active_script | ||
+ | |||
+ | < | ||
+ | # Sieve filter | ||
+ | require [" | ||
+ | |||
+ | #begin = forward = | ||
+ | # | ||
+ | redirect :copy " | ||
+ | |||
+ | #end = forward = | ||
+ | |||
+ | #begin = autoresponder = | ||
+ | # | ||
+ | vacation :days 1 :subject " | ||
+ | #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 ===== | ||
+ | |||
+ | http:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// | ||
+ | |||
+ | https:// |
exim4/sieve_filter.1479133919.txt.gz · Last modified: 2020/07/15 09:30 (external edit)