From cf08a29f540f05d65ee766cbae281b739d46f2fe Mon Sep 17 00:00:00 2001 From: "root@deleuze.hcoop.net" <> Date: Tue, 13 Feb 2007 17:46:21 -0500 Subject: [PATCH] mwolson: First attempt at delivering to AFS --- conf.d/main/01_exim4-config_listmacrosdefs | 3 +++ conf.d/router/600_exim4-config_userforward | 2 ++ conf.d/router/700_exim4-config_procmail | 2 ++ conf.d/router/900_exim4-config_local_user | 3 +++ get-token | 8 ++++++++ update-exim4.conf.conf | 2 +- 6 files changed, 19 insertions(+), 1 deletion(-) create mode 100755 get-token diff --git a/conf.d/main/01_exim4-config_listmacrosdefs b/conf.d/main/01_exim4-config_listmacrosdefs index fec1059..c0e06d2 100644 --- a/conf.d/main/01_exim4-config_listmacrosdefs +++ b/conf.d/main/01_exim4-config_listmacrosdefs @@ -153,3 +153,6 @@ MAIN_LOG_SELECTOR = +tls_cipher +tls_peerdn # hcoop-change: use file_transport = address_file for /etc/aliases # delivery, as per old configuration SYSTEM_ALIASES_FILE_TRANSPORT = address_file + +# hcoop-change: deliver mail to AFS +MAILDIR_HOME_MAILDIR_LOCATION = /afs/hcoop.net/common/email/$local_part diff --git a/conf.d/router/600_exim4-config_userforward b/conf.d/router/600_exim4-config_userforward index 59259ca..61ae035 100644 --- a/conf.d/router/600_exim4-config_userforward +++ b/conf.d/router/600_exim4-config_userforward @@ -19,6 +19,7 @@ # 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 @@ -26,6 +27,7 @@ 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 8d827c7..10d8a4a 100644 --- a/conf.d/router/700_exim4-config_procmail +++ b/conf.d/router/700_exim4-config_procmail @@ -1,3 +1,4 @@ +# hcoop-change: acquire AFS token for the user procmail: debug_print = "R: procmail for $local_part@$domain" @@ -10,6 +11,7 @@ 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 423c729..ffa2b8e 100644 --- a/conf.d/router/900_exim4-config_local_user +++ b/conf.d/router/900_exim4-config_local_user @@ -5,11 +5,14 @@ # 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/get-token b/get-token new file mode 100755 index 0000000..3000e7d --- /dev/null +++ b/get-token @@ -0,0 +1,8 @@ +# Get an AFS token for the given user. +# +# This is used to deliver mail with the appropriate credentials. + +KRB5CCNAME=FILE:/tmp/krb5cc_$1.email + +kinit -kt /etc/keytabs/$1.email.keytab +aklog diff --git a/update-exim4.conf.conf b/update-exim4.conf.conf index 4f2ce20..e8cb6f6 100644 --- a/update-exim4.conf.conf +++ b/update-exim4.conf.conf @@ -25,7 +25,7 @@ dc_minimaldns='false' dc_relay_nets='' dc_smarthost='' CFILEMODE='644' -dc_use_split_config='false' +dc_use_split_config='true' dc_hide_mailname='' dc_mailname_in_oh='true' dc_localdelivery='maildir_home' -- 2.20.1