How cPanel Mail forwarders can be managed via SSH
Managing cPanel Mail forwarders via SSH
Earlier we have discussed the working of mail forwarder, which is undoubtedly a very useful and an important feature. And it is also true that we all do have a long list of forwarders for our respective domains.
cPanel’s web interface is the one what is primarily responsible for the creation as well as editing of mail forwarders. The cPanel’s developers have subdivided the long list of forwarders in multiple pages, that has been already discussed earlier.
Those who have VPS hosting approach
For those who have VPS hosting approach, they might prefer to edit the file directly which contain the forwarders. An SSH interconnection can be very helpful to achieve this. SSH may automatically be disabled on the server for the sake of security and this would lead you to request SSH access through your host.
Change directory to etc/valiases/: once you are successfully logged in to your VPS as root, over SSH,
Several files can be seen in valiases
Several files can be seen in valiases, one per domain. If you are unable to find that directory, then you must contact your host. This may occur because of the changes in configuration. This can be considered as the most common path to get your access back to the directory.
Midnight commander like ‘vi’ or ‘nano’ can also be used in those files. In order to create a forwarder, some lines should be added in the following format:
email@example.com firstname.lastname@example.org email@example.com
*: :fail: No Such User Here
It is very much essential to include the last line while creating forwarder so that the delivery could not be made to unknown accounts or to such accounts or addresses which do not exist at all.
VPS hosting plan has many advantages, out of those root access is the one. By root access you are able to directly access files even at a much faster rate than that of cPanel GUI. Apart from this, it also offers more features along with more user control.