Local Mail handling -- off by default?

rmpel

New member
Joined
Sep 25, 2025
Messages
3
Hi. Sorry if this has been asked and answered, but I cannot find it (probably because both local and mail are quite common words)

Is there a way to configure DirectAdmin so new users, or new domains for existing users, have the "Local Mail" checkbox OFF by default? We rarely use the mail service on DA and we seem to be forgetting this often, resulting in lost emails to our clients.

Thank you ever so much :)

Remon.
 
Hello Remon,

Create /usr/local/directadmin/scripts/custom/domain_create_post.sh script by adding the below code into it.

Bash:
#!/bin/sh
FILE=/etc/virtual/domains
cp -f $FILE $FILE.backup
grep -v -e "^$domain\$" $FILE > $FILE.tmp
mv -f $FILE.tmp $FILE
chmod 644 $FILE
chown mail:mail $FILE
exit 0;

Save and exit the code and change the chmod of the script to 755.

Bash:
chmod 755 /usr/local/directadmin/scripts/custom/domain_create_post.sh

source link: https://www.interserver.net/tips/kb/how-to-set-mail-server-in-directadmin/
 
Hi Alex, THANK YOU! :)

Not the solution I would have come up with by myself.

I will pass it on to the team :)
 
Back
Top