X-Git-Url: https://git.distorted.org.uk/~mdw/exim-config/blobdiff_plain/185b5456076ca86959643ce2f19c98c0f82f281e..HEAD:/local.m4 diff --git a/local.m4 b/local.m4 index 78b3e64..fd212a7 100644 --- a/local.m4 +++ b/local.m4 @@ -37,36 +37,9 @@ m4_define(<:FILTER_LOCALUSER:>, SECTION(global, priv)m4_dnl local_from_suffix = CONF_user_suffix_list -SECTION(global, process)m4_dnl -## Restrict users to plausible envelope sender addresses. This is -## surprisingly fiddly. What I actually want to say is that the local part -## must match ^$sender_ident(\$|-) and the domain part must match an -## appropriate domain; but writing a conjunction is rather tricky. And so we -## must burn some addresslist variables. -addresslist wrong_local = ! +user_extaddr -addresslist wrong_domain = ! *@+public -addresslist wrong_address = +wrong_local : +wrong_domain -untrusted_set_sender = : \ - ${LOOKUP_DOMAIN($sender_address_domain, - {${if and {{match_local_part {$sender_ident} {+dom_users}} \ - {match_local_part {$sender_address_local_part} \ - {+dom_locals}}} \ - {*}}})} : \ - ! +wrong_address - ###-------------------------------------------------------------------------- ### Forwarding and redirection for incoming mail. -SECTION(routers, alias)m4_dnl -## Look up the local part in the address map. -alias: - driver = redirect - allow_fail = true - allow_defer = true - user = CONF_filter_user - FILTER_TRANSPORTS - data = ${lookup {$local_part} lsearch {CONF_alias_file}} - SECTION(routers, real)m4_dnl ## A special hack to get mail to a user who has a forward file. Only for ## special effects. @@ -86,28 +59,28 @@ SECTION(routers, forward)m4_dnl ## rejection if possible). Mail sent directly to the user is handled through ## `~/.mail/forward', or `~/.forward', or if neither of those exists, by ## writing the message to `/var/mail/USER'. -filter_verify: - FILTER_LOCALUSER(CONF_userconf_dir/forward.suffix) - FILTER_VERIFY - local_part_suffix = CONF_user_suffix_list -filter_suffix: - FILTER_LOCALUSER(CONF_userconf_dir/forward.suffix) - local_part_suffix = CONF_user_suffix_list - FILTER_TRANSPORTS -filter: - FILTER_LOCALUSER(CONF_userconf_dir/forward) - FILTER_TRANSPORTS -dot_forward: - FILTER_LOCALUSER($home/.forward) - FILTER_TRANSPORTS +FILTER_ROUTER(filter_suffix, + <:FILTER_LOCALUSER(CONF_userconf_dir/forward.suffix) + local_part_suffix = CONF_user_suffix_list:>) +FILTER_ROUTER(filter, + <:FILTER_LOCALUSER(CONF_userconf_dir/forward):>) +FILTER_ROUTER(dot_forward, + <:FILTER_LOCALUSER($home/.forward):>) SECTION(routers, deliver)m4_dnl ## Deliver mail to a user, in the absence of any other instructions. +m4_define(<:DOVECOT_HEADERS:>, <:m4_dnl + Content-Length, Status, X-IMAP, X-IMAPbase, m4_dnl + X-Keywords, X-Status, X-UID:>)m4_dnl deliver: driver = accept check_local_user transport = deliver cannot_route_message = Unknown local part + ## Strip headers used by Dovecot for its own purposes. + headers_remove = RENAME_HEADERS_REMOVE(<:DOVECOT_HEADERS:>) + headers_add = RENAME_HEADERS_ADD(<:DOVECOT_HEADERS:>) + DIVERT(null) ###----- That's all, folks --------------------------------------------------