From e9cfbd0749d170d1682f2346254e6dae4d63802d Mon Sep 17 00:00:00 2001 From: "root@deleuze.hcoop.net" <> Date: Tue, 13 Feb 2007 19:07:30 -0500 Subject: [PATCH] mwolson: Only get token once, rather than 1-3 times --- conf.d/router/550_exim4-get_token | 11 +++++++++++ conf.d/router/600_exim4-config_userforward | 3 --- conf.d/router/700_exim4-config_procmail | 2 -- conf.d/router/900_exim4-config_local_user | 3 --- conf.d/transport/90_exim4-config_devnull | 8 ++++++++ 5 files changed, 19 insertions(+), 8 deletions(-) create mode 100644 conf.d/router/550_exim4-get_token create mode 100644 conf.d/transport/90_exim4-config_devnull diff --git a/conf.d/router/550_exim4-get_token b/conf.d/router/550_exim4-get_token new file mode 100644 index 0000000..03f2ea4 --- /dev/null +++ b/conf.d/router/550_exim4-get_token @@ -0,0 +1,11 @@ +# hcoop-change: acquire AFS token for the user -- the condition is +# executed for side-effects only, and nothing should ever be accepted +# by this router + +get_token: + driver = accept + domains = +local_domains + condition = ${run{/usr/bin/pagsh.openafs -c /etc/exim4/get-token ${local_part}}{0}{0}} + transport = dev_null + no_verify + no_expn diff --git a/conf.d/router/600_exim4-config_userforward b/conf.d/router/600_exim4-config_userforward index 61ae035..eab0ff0 100644 --- a/conf.d/router/600_exim4-config_userforward +++ b/conf.d/router/600_exim4-config_userforward @@ -18,8 +18,6 @@ # The four transports specified at the end are those that are used when # forwarding generates a direct delivery to a directory, or a file, or to a # pipe, or sets up an auto-reply, respectively. -# -# hcoop-change: acquire AFS token for the user userforward: debug_print = "R: userforward for $local_part@$domain" driver = redirect @@ -27,7 +25,6 @@ userforward: check_local_user file = $home/.forward require_files = $local_part:$home/.forward - condition = ${run{/usr/bin/pagsh.openafs -c /etc/exim4/get-token ${local_part}}{1}{0}} no_verify no_expn check_ancestor diff --git a/conf.d/router/700_exim4-config_procmail b/conf.d/router/700_exim4-config_procmail index 10d8a4a..8d827c7 100644 --- a/conf.d/router/700_exim4-config_procmail +++ b/conf.d/router/700_exim4-config_procmail @@ -1,4 +1,3 @@ -# hcoop-change: acquire AFS token for the user procmail: debug_print = "R: procmail for $local_part@$domain" @@ -11,7 +10,6 @@ procmail: ${if exists{/etc/procmailrc}\ {/etc/procmailrc}{${home}/.procmailrc}}:\ +/usr/bin/procmail - condition = ${run{/usr/bin/pagsh.openafs -c /etc/exim4/get-token ${local_part}}{1}{0}} no_verify no_expn diff --git a/conf.d/router/900_exim4-config_local_user b/conf.d/router/900_exim4-config_local_user index ffa2b8e..423c729 100644 --- a/conf.d/router/900_exim4-config_local_user +++ b/conf.d/router/900_exim4-config_local_user @@ -5,14 +5,11 @@ # This router matches local user mailboxes. If the router fails, the error # message is "Unknown user". -# hcoop-change: acquire AFS token for the user - local_user: debug_print = "R: local_user for $local_part@$domain" driver = accept domains = +local_domains check_local_user local_parts = ! root - condition = ${run{/usr/bin/pagsh.openafs -c /etc/exim4/get-token ${local_part}}{1}{0}} transport = LOCAL_DELIVERY cannot_route_message = Unknown user diff --git a/conf.d/transport/90_exim4-config_devnull b/conf.d/transport/90_exim4-config_devnull new file mode 100644 index 0000000..e96857a --- /dev/null +++ b/conf.d/transport/90_exim4-config_devnull @@ -0,0 +1,8 @@ +# hcoop-change: Dummy transport needed by get_token router, in case +# something goes horribly wrong with the configuration -- this should +# be impossible to call + +dev_null: + debug_print = "T: throwing away email for $local_part@$domain" + driver = appendfile + file = /dev/null -- 2.20.1