How to block Users from sending Mail on DirectAdmin with 2 steps.
In some cases, system administrators on which there is a user who sends emails with high frequency or is infected with malicious code and continuously spams out, affecting the whole system. If you want to thoroughly handle that problem but don’t know how, the following article is a helpful solution for you.
Step 1: SSH into your DirectAdmin system
To block Users from sending Mail on DirectAdmin, we first need to SSH or access your VPS/server with root privileges. If you don’t know how to SSH into your VPS/Server, you can refer to the following tutorial:
After successfully SSH, we continue with step 2 to continue the configuration.
Step 2: Add the user to the blacklist
Note: Blocking by User means that all mail Accounts created on that User will not be able to send emails.
On DirectAdmin, the developer has support for blocking SpamBlocker through the blacklist_usernames block file with the path:
If at the path /etc/virtual/, you do not see the file blacklist_usernames, you can create it manually. After creating the file, you will block the User by entering the correct User name to block in the blacklist_usernames file, similar to below:
Or there is a command to add User to the file faster, you can refer to the below:
echo "User_can_chan" >> /etc/virtual/blacklist_usernames
Once completed, save and restart DirectAdmin with the command below:
systemctl restart directadmin
Step 3: Check the result
After configuring in step 2, you access DirectAdmin and check the email sending feature of the User just blocked to see the results.
Here are the results before and after I made the user block configuration
As you can see, when sending email, it will be blocked and logged User does not have permission to send email as below:
SMTP Error (550): Failed to add recipient “email@example.com” (user account (thegioi) is not allowed to send emails. E-Mail delivery blocked.).
Above are detailed instructions on how to block Users from sending Emails on DirectAdmin. Hopefully, this article lets you know how to block and limit abusive users and spam emails from affecting your system. Don’t forget to share if you find this helpful article.
You can refer to other instructions at the link below:
If you need assistance, you can contact support in the ways below:
- Hotline 247: 028 730 24768 (Ext 0)
- Ticket/Email: You use the email to register for the service and send it directly to: firstname.lastname@example.org .