diff --git a/action.sh b/action.sh index a1dd741..d878339 100755 --- a/action.sh +++ b/action.sh @@ -36,7 +36,7 @@ PASS=$(cat "$3") ## FUNCTIONS function checkaction { - REGEX="^adduser$|^changepw$|^listusers$|^userdetail$|^deluser$|^sizeall$|^sizeuser$|^viewdata$" + REGEX="^adduser$|^changepw$|^listusers$|^userdetail$|^deluser$|^sizeall$|^sizeuser$|^viewdata$|^addalias$" if [[ $1 =~ $REGEX ]]; then echo "true" else @@ -212,6 +212,29 @@ if [ "$ACTION" == "adduser" ]; then fi fi # /adduser +# # # # # +# ADD ALIAS +# # # # # +if [ "$ACTION" == "addalias" ]; then + echo "Extracting details of Email account..." + echo + + DEST=$PASS + + if $(userexists "$USER"); then + echo "User \"$USER\" does already exist!" + exit 1 + fi + + if ! $(userexists "$DEST"); then + echo "Destination account \"$DEST\" does not exist!" + exit 1 + fi + + vaddalias $USER $DEST + +fi # /addalias + # # # # # # CHANGE PASSWORD # # # # # diff --git a/index.php b/index.php index 995ebef..fbdfe36 100644 --- a/index.php +++ b/index.php @@ -43,6 +43,23 @@ + + + »« Add an email redirection +
This creates an alias email account. This account has no mailbox + but just redirects all mails to another account.
+ +