This guide helps you verify that email is sending correctly from your server via command line. It also includes steps to make the test command work for CloudLinux with CageFS.
๐จ Send a Simple Test Email
Run the following command:
echo "Proof that email is being sent from the server just fine" | mail -s "Proof that email is being sent from the server just fine" email@yourdomain.com
โ Replace
email@yourdomain.comwith your actual email address.
๐ ๏ธ CloudLinux with CageFS: Add Mail Utility (s-nail)
If you’re using CloudLinux with CageFS, the mail command might not work by default. You’ll need to add the s-nail package to CageFS.
- Add
s-nailto CageFS:
cagefsctl --addrpm s-nail
- Force CageFS to Update for All Users:
cagefsctl --force-update
Once done, the mail command will work correctly inside jailed environments for your users.
