Search Our Database
How to allow a user in SMTP_ALLOW in csf.conf
Introduction
ConfigServer Security & Firewall (CSF) includes SMTP_BLOCK to prevent users from sending emails directly via SMTP except through the local mail server. To permit a specific user to send mail even with SMTP blocking enabled, you must explicitly add the user to the SMTP_ALLOWUSER setting in the csf.conf file.
Prerequisites
- Root SSH access to the server
- CSF installed
- Text editor like vi, vim, or any other
Step-by-Step Guide
Step 1: Access the Server via SSH
- Open a terminal on your local machine.
- Connect to your server using SSH:
ssh root@your-server-ip
Step 2: Open the csf.conf File
- Use a text editor to open the configuration file:
vi /etc/csf/csf.conf
Step 3: Modify the SMTP_ALLOW Setting
- Search for the line that begins with SMTP_ALLOWUSER.
- Add the desired Linux username(s) to the list. For example:
SMTP_ALLOWUSER = "mailuser"
To allow multiple users, separate them with commas:
SMTP_ALLOWUSER = "mailuser1,mailuser2"
Step 4: Save and Exit
- Save changes and exit the text editor.
- In vi, press ESC, type :wq, then press ENTER.
Step 5: Restart CSF
- Apply the new configuration by restarting CSF:
csf -r
Conclusion
By adding the user to the SMTP_ALLOWUSER list in csf.conf, you grant them permission to bypass SMTP restrictions imposed by CSF. Always verify the configuration after changes to ensure intended behavior. For further assistance, contact support at support@ipserverone.com.
Article posted on 1 July 2025 by s.clem.