Home WebServer PanelDirectAdmin How to block Users from sending Mail on DirectAdmin

How to block Users from sending Mail on DirectAdmin

Published: Last Updated on

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.

Implementation Guide

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:

AZDIGI Tutorial

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:

How to block Users from sending Mail on DirectAdmin

Or there is a command to add User to the file faster, you can refer to the below:

AZDIGI Tutorial
echo "User_can_chan" >> /etc/virtual/blacklist_usernames

Once completed, save and restart DirectAdmin with the command below:

AZDIGI Tutorial
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

  • Before
How to block Users from sending Mail on DirectAdmin
  • After
How to block Users from sending Mail on DirectAdmin

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 “kiendt@azdigi.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:

Đánh giá

Tham gia nhóm hỗ trợ Server - Hosting

Tham gia nhóm Hỗ trợ Server - Hosting & WordPress để cùng nhau hỏi đáp và hỗ trợ các vấn đề về WordPress, tối ưu máy chủ/server.

Tham gia ngay

Bài viết cùng chuyên mục

AZDIGI – Không chỉ là đơn vị hàng đầu trong lĩnh vực Web Hosting và Máy chủ, chúng tôi mong muốn mang lại những kiến thức bổ ích nhất và luôn cập nhật thường xuyên cho cộng đồng người đam mê thiết kế website, công nghệ,…

Vui lòng không sao chép nội dung nếu chưa xin phép. Designed and Developed by PenciDesign