Message System
How is the From address determined?
Whenever a new message or ticket is generated, you'll get a notification from the Message System. The recipient (To) of these notifications is set in the Message System itself. Click the link at the top right of your interface.
However, the From address set in these messages can be set a few ways, depending on from where the message was generated.
- System notifications, created internally.
- Backup/Restore notifications, updates, attacks, etc.
For these internally generated messages (System Notifications), the From header is determined by: a) find the creator=
value from the user.conf
of the given account. b) if creator=root
, assume creator=admin
c) From that creator's user.conf
, check the name=
value. If it's set to a value other than their DA username, use that name, else use the Message System value. d) From that same creator's user.conf
file, take the email=
to assemble: From: name <email>
- Tickets, Messages, and Replies (human generated)
- the
name=
andemail=
value from theuser.conf
of the sender are used.
- Fallback, in the event that any required variables are missing or blank:
- name is taken from the msg_sys variable
- email is created by using the DA username, @ the servername (hostname) set in the directadmin.conf.
How to empty the message system
Since DirectAdmin version 1.47 the ability to clear messages from the Message System based on the Subject and/or the Date of the message was added into the panel.
The options can be found on the bottom of the "Message System" as well as in the Brute Force Monitor (same table, different default selected value).
The interface modifies two directadmin.conf variables which equal zero by default:
delete_messages_days=0
delete_tickets_days=0
When finding the date of a ticket, DA will use the time of the last reply. So if you've got a ticket going on for 3 years, the time is based on the most recent message. Meaning, if you replied yesterday to the ticket that was opened 3 years ago and the delete_ticket_days=365
, then this ticket will not be deleted.
Note, if you delete the data from disk, and the ticket number is still in the tickets.list
file, that's fine. DA will now ignore missing tickets, and remove that bad entry from the tickets.list
when noticed.
How to send mail content
If you wish to see the message in the notification, the following token has been added:
|MESSAGE|
To use it, type:
cd /usr/local/directadmin/data/templates/custom
cp ../message_*.txt .
This will copy the message_user.txt
and message_tech.txt
to the custom templates folder. Edit these files and insert the |MESSAGE| token wherever you wish.
Note that this token is not sanitized for any characters. For plaintext emails, this should be fine.
If you have <html>
at the top of your message templates and are using html emails, this token isn't recommended. For one, the client could send you malicious emails. Another reason is that newlines wouldn't have <br>
line breaks, thus the message would be a bit messy.
CMD_JSON_LANG: Show info on most recent messages/tickets
Calls to the following will show information on the most recent messages/tickets:
/CMD_JSON_LANG?domain=domain.com&&json=yes&request=global&show%5Fextra=yes
and must contain the following as shown above to do so:
request=global
show_extra=yes
Additional JSON output will be included:
"recent_tickets":
{
"000005329":
{
"from": "diradmin",
"id": "000005329",
"name": "Message System",
"new": "yes",
"priority": "30",
"status": "open",
"subject": "Warning: The disk usage for one or more of your partitions is running low",
"timestamp": "1617300055",
"type": "message",
"user": "multiple"
},
"000005330":
{
"from": "diradmin",
"id": "000005330",
"name": "Message System",
"new": "yes",
"priority": "30",
"status": "open",
"subject": "Warning: The disk usage for one or more of your partitions is running low",
"timestamp": "1617300061",
"type": "message",
"user": "multiple"
},
"000005331":
{
"from": "diradmin",
"id": "000005331",
"name": "Message System",
"new": "yes",
"priority": "30",
"status": "open",
"subject": "User quotauser has used up 0.0% of their bandwidth and 680% of their allocated disk space",
"timestamp": "1617300139",
"type": "message",
"user": "multiple"
}
}
The "recent_tickets" array holds 3 arrays, one for each of the last 3 messages/tickets, where the contents of each ticket ID will be:
id=12345
#The tail -n1 of the User'sticket.list
filenew=yes|no
#whether seen or not, taken fromtickets.list
value- Everything else #a dump of
data/tickets/123/12345/000.conf
Note, it will only ever show the last entry from the tickets.list
. If an old ticket has a new reply, where there are other new messages/tickets, that reply won't be reflected. It only shows the details of the higher-numbered value from the tickets.list
(the last entry).