Proper way to edit /etc/aliases

garywsmith

Registered
Mar 7, 2018
4
0
1
California
cPanel Access Level
Root Administrator
Today I went to edit /etc/aliases as one processes is using [email protected] as a recipient and noticed that the familiar mewaliases command is missing. I'm running the cloundlinux version that was an in-place upgrade of centos7.

What's the proper way hash this into the aliases.db file?
 
Last edited by a moderator:

garywsmith

Registered
Mar 7, 2018
4
0
1
California
cPanel Access Level
Root Administrator
Hey there! I would not expect you to need to run "newaliases" on a cPanel machine in order for that file to be read. Are you not seeing this working how you expect on your side?
I just changed it today. I will see if the process that's kicking off the warning gets redirected. I know in the past on other linux boxes I had to run that. Digging deeper it looks like exim uses aliases whereas postfix (that I normally use) would use the aliases.db.
 

cPAdminsMichael

Well-Known Member
Dec 19, 2016
186
67
153
Denmark
cPanel Access Level
Root Administrator
Hi!
While changing this in /etc/aliases is not wrong and will definetely work, on a cPanel server I'd recommend changing who'll get the root mails in WHM (which will add the e-mail addresses as a .forward in /root/)
 

garywsmith

Registered
Mar 7, 2018
4
0
1
California
cPanel Access Level
Root Administrator
Sorry for the delay getting back to this. In times past I would normally just do root: [email protected] in the /etc/aliases file and run newalias. Since newalias doesn't exist I just added the email directly in the alias file and it did not work.

The emails generated from WHM work fine and go where they need to. This email was generating from litespeed with a message about update. It's the only message that isn't being sent to the correct address. The funny part is that the bounce does get sent back to my email. It's weird.
 

cPAdminsMichael

Well-Known Member
Dec 19, 2016
186
67
153
Denmark
cPanel Access Level
Root Administrator
The newaliases is not installed on cPanel systems and if I recall right, is not used for Exim installations.

When that is said, to specify which mail shall receive root mails on a cPanel system, you'd need to configure it in WHM -> Edit System Mail Preferences which in practice adds/modifys .forward in /root folder.
In theory you could change the aliases file, but that would then make the cPanel configuration not working as expected.

If you have indeed configured root mails and mails from Litespeed is still not working, it could be because of a wrong TLD used (i.e. root on another server host)
 
Last edited:
  • Like
Reactions: cPRex