Block mail ports 25 in cpanel

A common question!

In cPanel, you can block mail ports 25 (SMTP) to prevent spam and unauthorized access to your email accounts. Here's how:

Method 1: Using the cPanel interface

  1. Log in to your cPanel account.
  2. Click on the "Security" icon.
  3. Scroll down to the "Email" section.
  4. Click on "Email Routing".
  5. In the "SMTP Ports" section, click on the "Edit" button.
  6. In the "SMTP Ports" window, select the "Block" option next to "Port 25".
  7. Click "Save" to save your changes.

Method 2: Using the WHM (Web Host Manager) interface

  1. Log in to your WHM account.
  2. Click on the "Mail" icon.
  3. Scroll down to the "SMTP Ports" section.
  4. Click on the "Edit" button next to "SMTP Ports".
  5. In the "SMTP Ports" window, select the "Block" option next to "Port 25".
  6. Click "Save" to save your changes.

Method 3: Using the command line (for advanced users)

  1. Log in to your server using SSH.
  2. Run the following command: sudo /usr/local/cpanel/bin/setmailports -b 25
  3. This will block port 25 for all email accounts on your server.

After blocking port 25, you may need to configure your email clients to use alternative ports, such as port 587 (Submission) or port 2525 (Submission). You can also configure your email clients to use a mail relay or a third-party SMTP service.

Remember to test your email setup after blocking port 25 to ensure that your email accounts are still functioning correctly.