Home WebServer PanelDirectAdmin How to enable SMTP on DirectAdmin using CSF

How to enable SMTP on DirectAdmin using CSF

by Thạch Phạm
Published: Last Updated on
A+A-
Reset

Some servers that use DirectAdmin with the CSF firewall may prevent you from sending emails via SMTP. In that case, you will need to enable SMTP on DirectAdmin in the CSF interface to be able to do so.

I. Introduction

In a previous article, AZDIGI showed how to install CSF on DirectAdmin. Since CSF is a free and relatively good software firewall, almost every VPS or server should install it.

However, after we install CSF, it will block sending emails via SMTP by default. So, if your website uses SMTP for email notification features such as:

  • Email notification when customers fill out registration forms.
  • Order and reservation notification.

Then it will certainly not work.

Therefore, in this article, I will help you enable SMTP on DirectAdmin when using the CSF firewall in two different ways:

  • Through the CSF interface directly on DirectAdmin.
  • Through the SSH protocol.

II. Enable SMTP on DirectAdmin

We will go through each method one by one.

Method 1: Through the CSF interface directly on DirectAdmin

I think you will prefer to use this method because it is much simpler than method 2. First, to enable SMTP on DirectAdmin using this method, we need to access the DirectAdmin interface with Admin privileges.

Then we access the Extra Feature category and select the ConfigServer Security & Firewall feature as shown below.

enable-smtp-on-directadmin-using-csf

On the main ConfigServer Security & Firewall (CSF) interface, we scroll down a bit to find the CSF configuration section, which will be named Firewall Configuration.

enable-smtp-on-directadmin-using-csf

In this interface, let’s use the quick move button as shown in the image below and select SMTP Settings.

enable-smtp-on-directadmin-using-csf
Quick move button in CSF configuration.
enable-smtp-on-directadmin-using-csf

Here, let’s adjust SMTP_BLOCK from On to Off.

enable-smtp-on-directadmin-using-csf
Enable SMTP on DirectAdmin in the CSF interface.

Then we scroll down to the bottom of the page and select Change to save the new configuration.

enable-smtp-on-directadmin-using-csf
Save the CSF configuration.

Finally, CSF will report that your configuration has been saved. You will need to restart CSF to receive this new configuration. Select the Restart csf+lfd button to restart.

enable-smtp-on-directadmin-using-csf
Restart CSF.

So we have successfully enabled SMTP on DirectAdmin through the CSF interface. You can try to check if your SMTP is working or not.

Method 2: Enable SMTP on DirectAdmin via SSH

In this method, we need to follow the following 3 steps.

Step 1: SSH into your server

To enable SMTP on DirectAdmin via SSH, first, we need to SSH or access your VPS or server as root. Or at least log in to the server with a user with sudo 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 modify the CSF configuration.

Step 2: Modify the CSF configuration

Modifying the CSF configuration is not difficult, we will need to use the following command to open the configuration file.

AZDIGI Tutorial
vi /etc/csf/csf.conf
    

After opening the configuration file with the above command, we will look for the line SMTP_BLOCK = "1" and change it to SMTP_BLOCK = "0".

enable-smtp-on-directadmin-using-csf

Then we need to save this file.

Step 3: Restart CSF

After we have saved the configuration in the previous step, we need to restart CSF to apply this new configuration. We use the following command to restart CSF:

AZDIGI Tutorial
csf -r
    

So we have completed enabling SMTP on DirectAdmin via SSH. Now you can try your features to see if they are working or not.

III. Summary

Enabling SMTP on DirectAdmin will help you a lot if you have just migrated your website from hosting to a new server that you have just installed but SMTP feature is not working.

There are many reasons why SMTP may not work properly. So if after completing this article, your SMTP is still not working, you should check your SMTP configuration on your website.

Or you can refer to the following tutorial to configure your Gmail account as an SMTP email for your website:

Hope this article will be of help to you. Wishing you success!

See more useful articles about DirectAdmin at the following link:

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