Merge pull request #84 from Ursadon/master

Added return code for is_mail_new()
This commit is contained in:
Serghey Rodin 2013-11-07 02:24:31 -08:00
commit 95c265ea58

View file

@ -143,14 +143,14 @@ is_mail_new() {
if [ ! -z "$check_acc" ]; then if [ ! -z "$check_acc" ]; then
echo "Error: mail account $1 exist" echo "Error: mail account $1 exist"
log_event "$E_EXISTS" "$EVENT" log_event "$E_EXISTS" "$EVENT"
exit exit $E_EXISTS
fi fi
check_als=$(awk -F "ALIAS='" '{print $2}' $USER_DATA/mail/$domain.conf ) check_als=$(awk -F "ALIAS='" '{print $2}' $USER_DATA/mail/$domain.conf )
check_als=$(echo "$check_als" | cut -f 1 -d "'" | grep -w $1) check_als=$(echo "$check_als" | cut -f 1 -d "'" | grep -w $1)
if [ ! -z "$check_als" ]; then if [ ! -z "$check_als" ]; then
echo "Error: mail alias $1 exist" echo "Error: mail alias $1 exist"
log_event "$E_EXISTS" "$EVENT" log_event "$E_EXISTS" "$EVENT"
exit exit $E_EXISTS
fi fi
} }