Update exim4 auth config to handle LOGIN
[hcoop/zz_old/config/exim4-hopper.git] / get-token
... / ...
CommitLineData
1#!/bin/bash
2# Get an AFS token for the given user.
3#
4# This is used to deliver mail with the appropriate credentials.
5
6# fuse stdin and stderr
7exec 2>&1
8USER=$1
9
10# all future output goes to this file
11exec >&/tmp/get-token-log.$USER
12
13# check that setuid happened
14whoami
15
16# set the credentials cache
17export KRB5CCNAME=FILE:/tmp/krb5cc_$USER.email
18
19# eliminate any previous tokens
20kdestroy
21unlog
22KEYTAB=/etc/keytabs/user.daemon/$USER
23
24# display command-to-be-invoked as a sanity check
25echo kinit -kt $KEYTAB $USER/daemon@HCOOP.NET
26
27kinit -kt $KEYTAB $USER/daemon@HCOOP.NET
28aklog
29
30# list tokens, for the sake of debugging
31#tokens