summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuke Smith <luke@lukesmith.xyz>2025-03-05 19:28:51 +0100
committerLuke Smith <luke@lukesmith.xyz>2025-03-05 19:28:51 +0100
commit3998323db0b52e4cfe4f7ab5dde527ae8e753310 (patch)
treeb19e21d3588ecea84cc60cf09f5456edfb13bc75
parent8ce112c4d8d17793d6319ec391aed5c348627b6b (diff)
close #329, fix #337, close #326HEADmaster
-rwxr-xr-xadddomain.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/adddomain.sh b/adddomain.sh
index fe95a90..74b20ad 100755
--- a/adddomain.sh
+++ b/adddomain.sh
@@ -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 ||