diff --git a/commands/exim_forwardadd.sh b/commands/exim_forwardadd.sh index af5e32f..597ad93 100644 --- a/commands/exim_forwardadd.sh +++ b/commands/exim_forwardadd.sh @@ -5,4 +5,5 @@ read emailfrom echo "Forward TO email: " read emailto -echo "$(cat /etc/exim4/forward/$emailfrom)$emailto," > "/etc/exim4/forward/$emailfrom" +DIR=/etc/exim4/forward +echo "$(cat $DIR/$emailfrom)$emailto," > "$DIR/$emailfrom" diff --git a/commands/exim_forwarddel.sh b/commands/exim_forwarddel.sh index d88a94f..dc9f1eb 100644 --- a/commands/exim_forwarddel.sh +++ b/commands/exim_forwarddel.sh @@ -5,4 +5,6 @@ read emailfrom echo "Forward TO email: " read emailto -sed -i "s/$emailto,//g" "/etc/exim4/forward/$emailfrom" +DIR=/etc/exim4/forward +sed -i "s/$emailto,//g" "$DIR/$emailfrom" +[[ ! -s $DIR/$emailfrom ]] && rm -f $DIR/$emailfrom diff --git a/commands/exim_forwardlist.sh b/commands/exim_forwardlist.sh new file mode 100644 index 0000000..c45bb0b --- /dev/null +++ b/commands/exim_forwardlist.sh @@ -0,0 +1,7 @@ +#!/usr/bin/env bash + +DIR=/etc/exim4/forward +for file in $DIR/* +do + echo "$file: $(cat $DIR/$file)" +done diff --git a/commands/exim_userdel.sh b/commands/exim_userdel.sh index 0a57aba..567d132 100644 --- a/commands/exim_userdel.sh +++ b/commands/exim_userdel.sh @@ -5,6 +5,8 @@ read username echo "Domain: " read domain -sed "/$username/d" "/etc/exim4/domains/$domain" +DIR=/etc/exim4/domains +sed -i "/$username/d" "$DIR/$domain" +[[ ! -s $DIR/$domain ]] && rm -f $DIR/$domain userdb "$username@$domain" del makeuserdb diff --git a/commands/exim_userlist.sh b/commands/exim_userlist.sh new file mode 100644 index 0000000..99d25eb --- /dev/null +++ b/commands/exim_userlist.sh @@ -0,0 +1,3 @@ +#!/usr/bin/env bash + +userdb -show