How do i change the default root email address?

miletjs

Verified User
Joined
Aug 29, 2009
Messages
10
All my email notifications such as logwatch is being sent to [email protected]

I want to change the root email to my real email address. How can I possibly do this?
 
Create a forwarder in the root directory or adjust the settings of csf/lfd to use a different e-mail.
 
To create a forward file, make a file named .forward inside this file list the e-mail address you want these e-mails to be sent too. Save in it the /root directory and that's it.
 
For root emails, edit:
/etc/aliases

add something like:

root: [email protected]

and root emails will be forwarded there (can be a local email address)

Direct root emails are not permitted by exim, hence the forwarder/alias would be needed.
 
For root emails, edit:
/etc/aliases

add something like:

root: [email protected]

and root emails will be forwarded there (can be a local email address)

Direct root emails are not permitted by exim, hence the forwarder/alias would be needed.

Thank you nimafire.

Why this is not in the knowledge base, is beyond me.
It's something that should be set correctly for every server.
 
Why this is not in the knowledge base, is beyond me.
Because this is basic Linux knowledge.
You can't set that correctly for every server either because some do not want mail from or to root and everybody want's a different e-mail adres in there.
 
Try and change admin's email in its details in Directadmin (it edit user page for admin).
 
Thanks i will finding this
Would be nice if a feature is implemented on the future versions that allow to change this trough DA panel, as on Cpanel/Whm contact options.
Thanks
 
There is a difference between admin e-mail address and root e-mail address.
Admin e-mail address is described above and will change the address from messages send from [email protected] but root is different.

To change the root address, that is basic OS knowledge.
Either edit /etc/aliases file, remove the # comment and and change root: marc to root: [email protected] or create a file .forward in /root with your mail address as content.

In either case restart your exim service afterwards.
 
There is a difference between admin e-mail address and root e-mail address.
Admin e-mail address is described above and will change the address from messages send from [email protected] but root is different.

To change the root address, that is basic OS knowledge.
Either edit /etc/aliases file, remove the # comment and and change root: marc to root: [email protected] or create a file .forward in /root with your mail address as content.

In either case restart your exim service afterwards.
The explanation is really great, thnx for that.

I did that, changed /etc/aliases created a .forward in /root and also restarted the exim service. The emailadress from admin user is also changed.

But still the system mails are send from root@hostname.

What else can be the issue?
 
changed /etc/aliases created a .forward in /root
Pointing to the same address? In fact it's use either, not both at the same time. :)

But still the system mails are send from root@hostname.
Exactly which system mails? Because the above solution is to who will receive the root mail. So yes that is still send from root.
This will however only be the OS mails, so really OS or firewall related, not the DA system mails like if you're over quota.

You won't be able to change the from if it's really OS mails originated by root. Root can't be changed.
You can only change the from if it's from directadmin's admin@hostname mail adres.
 
Exactly which system mails? Because the above solution is to who will receive the root mail. So yes that is still send from root.
This will however only be the OS mails, so really OS or firewall related, not the DA system mails like if you're over quota.
for example "New Message: Your backups are now ready" and "Mail delivery failed: returning message to sender" and mail from cloudliux messages "WMT report - 2024-04-01"
 
I don't use Cloudlinux so I don't now about that.

Mail delivery failed is from Exim which is run by mail user so that will be the mailer-daemon sending that to you or otherwise root.

Your backups are now ready message, is send by admin@hostname and can be changed by changing the admin mail address. As explained in post #8 and linked to in post #12.
 
Back
Top