client_name = ${extract{1}{:}{${lookup{$host}nwildlsearch{CONFDIR/passwd.client}{$value}fail}}}
client_secret = ${extract{2}{:}{${lookup{$host}nwildlsearch{CONFDIR/passwd.client}{$value}fail}}}
-# hcoop-change: Authenticate against /etc/courier/userdb.dat for plain
+# hcoop-change: Authenticate against /etc/courier/exim.dat for plain
# and login authenticators
userdb_plain:
${if \
crypteq {$3} \
{${extract{systempw}{${tr{${lookup{$2} \
- dbm{/etc/courier/userdb.dat} \
+ dbm{/etc/courier/exim.dat} \
}}{|}{ }}}}} \
{yes} \
{no} \
${if \
crypteq {$2} \
{${extract{systempw}{${tr{${lookup{$1} \
- dbm{/etc/courier/userdb.dat} \
+ dbm{/etc/courier/exim.dat} \
}}{|}{ }}}}} \
{yes} \
{no} \
virtual_user:
driver = accept
transport = virtual_delivery
- require_files = /home/vmail/${domain}/${local_part}
-# condition = ${extract{mail}{${tr{${lookup{$local_part@$domain} \
-# dbm{/etc/courier/userdb.dat} \
-# }}{|}{ }}}}
+# require_files = /home/vmail/${domain}/${local_part}
+ condition = ${extract{mail}{${tr{${lookup{$local_part@$domain} \
+ dbm{/etc/courier/exim.dat} \
+ }}{|}{ }}}}
debug_print = "T: virtual_delivery for $local_part@$domain"
driver = appendfile
user = ${extract{uid}{${tr{${lookup{$local_part@$domain} \
- dbm{/etc/courier/userdb.dat} \
+ dbm{/etc/courier/exim.dat} \
}}{|}{ }}}}
group = mail
mode = 0660
envelope_to_add
return_path_add
directory = ${extract{mail}{${tr{${lookup{$local_part@$domain} \
- dbm{/etc/courier/userdb.dat} \
+ dbm{/etc/courier/exim.dat} \
}}{|}{ }}}}${run{/etc/exim4/get-token \
${extract{uid}{${tr{${lookup{$local_part@$domain} \
- dbm{/etc/courier/userdb.dat} \
+ dbm{/etc/courier/exim.dat} \
}}{|}{ }}}}}{}}
maildir_format
USER=$1
LOGFILE=/tmp/exim4/get-token-log.$USER
-if [ "$REALUSER" = "root" ]; then
- if [ -n "$2" ]; then
+if test "$REALUSER" = "root"; then
+ if test -n "$2"; then
echo "Error: running as root even after trying to change to $USER" \
> $LOGFILE
exit 1
# Decide whether the user exists: getent returns 0 error code if so
getent passwd "$USER" >/dev/null
- if [ $? -ne 0 ]; then
+ if test $? -ne 0; then
echo "$USER is not a local user, so ignoring them"
exit 1
else
fi
fi
+# Make sure USER exists, and resolve UIDs to a login name
+USER=$(getent passwd "$USER" | cut -d':' -f 1)
+
+if test -z "$USER"; then
+ echo "$USER is not a local user, so ignoring them"
+ exit 1
+fi
+
# fuse stdin and stderr
exec 2>&1