1
0
mirror of https://github.com/lukesmithxyz/emailwiz synced 2025-04-09 17:19:19 +02:00

close #329, fix #337, close #326

This commit is contained in:
Luke Smith 2025-03-05 19:28:51 +01:00
parent 8ce112c4d8
commit 3998323db0
No known key found for this signature in database
GPG Key ID: 4C50B54A911F6252

@ -1,15 +1,15 @@
#!/bin/sh
domain="$1"
[ -z "$domain" ] && exit
# Input validation to allow only valid domain characters
if ! [[ "$domain" =~ ^[a-zA-Z0-9.-]+$ ]]; then
echo "Invalid domain format. Only alphanumeric characters, dashes, and dots are allowed."
echo "Give a valid domain as an argument to add mail server for it. Only alphanumeric characters, dashes, and dots are allowed."
exit 1
fi
subdom="mail"
maildomain="mail.$(cat /etc/mailname)"
# Add the domain to the valid postfix addresses
grep -q "^mydestination.*$domain" /etc/postfix/main.cf ||