DirectAdmin Message System – Complete Guide to From Address Logic, Message Cleanup, and Custom Message Templates

The DirectAdmin Message System handles system notifications, tickets, and internal messages. This guide explains how the “From” address is determined, how system generated and user generated messages differ, how to automatically clean old messages, and how to customize message templates to include message content.

Address LogicMessage Cleanup

~2 min read · Updated Mar 1, 2026

1. How the “From” Address Is Determined


DirectAdmin sends notifications for system events, tickets, and internal messages. The recipient (To) is configured inside the Message System interface, but the From address depends on how the message was generated.

---

1.1 System Generated Notifications

These include:

  • Backup/Restore notifications
  • Update notices
  • Brute force attack alerts
  • Internal system warnings

For these messages, DirectAdmin determines the From address using the following logic:

  1. Find the creator= value in the user.conf of the affected account.
  2. If creator=root, DirectAdmin assumes creator=admin.
  3. From the creator’s user.conf:
    • If name= is set and not equal to the username, use that name.
    • Otherwise, use the Message System’s configured name.
  4. Use the creator’s email= value to assemble:
    
    From: name 
        
---

1.2 Human Generated Messages (Tickets, Replies, User Messages)

For messages written by users, DirectAdmin uses:

  • name= from user.conf
  • email= from user.conf
---

1.3 Fallback Behavior

If required fields are missing:

  • name → taken from msg_sys variable
  • email → constructed as:
    
    username@servername
        
---

2. How to Empty the Message System


Since DirectAdmin 1.47, you can automatically delete messages based on:

  • Message age (days)
  • Message subject

These options appear at the bottom of the Message System page and inside the Brute Force Monitor.

Two configuration variables control this behavior:


delete_messages_days=0
delete_tickets_days=0

Notes:

  • Ticket age is based on the last reply, not the original creation date.
  • If a ticket file is deleted manually but still listed in tickets.list, DirectAdmin will automatically remove the stale entry.
---

3. How to Include Message Content in Email Notifications


DirectAdmin supports a special token to embed the full message content inside notification emails:


|MESSAGE|

How to enable it:


cd /usr/local/directadmin/data/templates/custom
cp ../message_*.txt .

This copies:

  • message_user.txt
  • message_tech.txt

Edit these files and insert |MESSAGE| wherever you want the message body to appear.

---

Important Notes:

  • The token is not sanitized—plaintext emails are safe, but HTML emails may be risky.
  • If your template starts with <html>, avoid using |MESSAGE|:
    • HTML injection is possible
    • Newlines will not convert to <br>

Written & researched by Dr. Shahin Siami

Related Articles

Email Client Configuration & Dovecot Quota/Monitoring Guide for DirectAdmin Users

This guide explains how to configure popular email clients (iPhone Mail, Thunderbird, Gmail POP/SMTP), enable Dovecot LMTP quota warnings, and check the last login time for all email accounts on a DirectAdmin server. It includes step by step instructions, recommended IMAP/SMTP settings, and useful administrative scripts.

Continue

Troubleshooting Dovecot in DirectAdmin – Fixing IMAP Errors, Authentication Issues, and SSL Certificate Checks

Dovecot is the IMAP/POP3 server used by DirectAdmin. Sometimes users encounter errors such as “Connection dropped by IMAP server” or “unknown user” during authentication. This guide explains how to fix corrupted Dovecot indexes, understand authentication logs, hide unnecessary warnings, and manually inspect SSL certificates on IMAP ports 143 and 993.

Continue

DNS Troubleshooting in DirectAdmin – When named is Running but Domains Do Not Resolve

Sometimes the named (BIND) service runs normally, yet DNS queries fail or domains do not resolve from outside. This guide provides a complete troubleshooting workflow for checking named listeners, firewall rules, named.conf configuration, DNS propagation issues, subdomain problems, resolv.conf errors, and common Apache/Nginx misconfigurations.

Continue

Managing DNS Records in DirectAdmin – Complete Practical Guide for Administrators

DirectAdmin provides a powerful DNS management system that allows administrators to control TTL values, create SRV records, enable DNSSEC, manage subdomain delegation, automate TLSA records, and perform mass DNS updates. This guide explains all essential DNS operations in DirectAdmin with real-world examples and best practices.

Continue

DNS and Nameservers in DirectAdmin – Complete, Practical, and Professional Guide

DNS is the backbone of the internet, responsible for translating domain names into IP addresses. DirectAdmin allows you to create private nameservers (ns1/ns2), manage DNS zones, configure DNS clustering, use external DNS, and troubleshoot common issues. This guide provides a complete, clear, and practical explanation of DNS concepts and their implementation in DirectAdmin.

Continue

CustomBuild in DirectAdmin – Complete Guide to Installation, Updates, Configuration, and Advanced Customization

CustomBuild is DirectAdmin’s primary software management system. It installs, updates, configures, and rebuilds essential services such as Apache, Nginx, PHP, MariaDB/MySQL, Exim, Dovecot, FTP servers, and more. Because most components are compiled from source, CustomBuild offers exceptional flexibility, fast access to new versions, and optimized performance.

Continue