TL;DR
Yes, you can add an email address to a cPanel account’s forwarders list without using the cPanel interface. This is done through SSH access and command-line tools.
How to Add an Email Forwarder Without cPanel Access
- Access Your Server via SSH: You’ll need Secure Shell (SSH) access to your web hosting server. Use a terminal application (like Terminal on macOS/Linux or PuTTY on Windows). Connect using your username and password, or an SSH key.
ssh user@yourdomain.com - Identify the Account: Determine the cPanel account you want to modify. If you have multiple domains hosted on the server, you may need to specify which account’s email forwarders you are changing.
- Use the
/usr/local/cpanel/bin/forwarderscript: This is the primary tool for managing email forwarders from the command line.The basic syntax is:
/usr/local/cpanel/bin/forwarder --add user@yourdomain.com destination_email@example.com- Replace user with the username of the cPanel account.
- Replace yourdomain.com with the domain name associated with the account.
- Replace destination_email@example.com with the email address you want to forward messages to.
- Example: To add a forwarder for
info@yourdomain.comforwarding tomyotheremail@gmail.com, use:/usr/local/cpanel/bin/forwarder --add info@yourdomain.com myotheremail@gmail.com - Verify the Forwarder: You can verify that the forwarder has been added using the command line:
/usr/local/cpanel/bin/forwarder --list user@yourdomain.comThis will output a list of all existing forwarders for the specified account.
- Error Handling: If you encounter errors, check:
- That the username and domain name are correct.
- That the destination email address is valid.
- Your server’s permissions; you may need root access for certain operations (though this script generally works within user accounts).
Important Note: Always be careful when using command-line tools, as incorrect commands can have unintended consequences. Back up your data regularly.