Cannot edit /etc/mailips on cPanel Server

Check /etc/mailips permissions:


# ls -lah /etc/mailips

It should show the following:

# ls -lah /etc/mailips
-rw-r----- 1 root mail 0 Mar 11 21:40 /etc/mailips

If it does not show root:mail for ownership, then fix that:

# chown root:mail /etc/mailips

If it doesn’t show 640 for file permissions, fix that:

# chmod 640 /etc/mailips

If it does have the right ownership and permissions, then next check the file isn’t set to be immutable:

# lsattr /etc/mailips

It might look like the following if it is okay:

# lsattr /etc/mailips
-------A----- /etc/mailips

Or below if it is unwritable

# lsattr /etc/mailips
----i--------e- /etc/mailips

An uppercase A is fine. If it has a lowercase i or a lowercase a, then it isn’t fine, and those need removed:

# chattr -ia /etc/mailips

Now it looks like

# lsattr /etc/mailips
-------------e- /etc/mailips

Leave a Comment