How can I block specific incoming emails?
End of Life Warning
This service has a pending End of Life. Please move to a current service as soon as possible. For more information, please see: (dv) Dedicated-Virtual 4.0: Migration Information.
READ ME FIRST
This article has been mirrored from the Parallels Knowledge Base as a courtesy to our (dv) Dedicated-Virtual Server customers. As they are the authoritative source of the information covered in this article, we encourage you to check their original article. Keep in mind that this content is subject to change.
(mt) Media Temple makes a best effort to ensure the accuracy of all content contained herein. Please use our feedback form below if you would like to report any inaccuracies. Please note that our feedback form is not an official support channel.
The publishing of this information does not imply support of this article. This article is provided solely as a courtesy to our customers. Please consult our (dv) Scope of Support for further information.
Instructions
- Log into the Plesk Control Panel for your domain.
-
Click on the Mail tab at the top. See Figure 1:

Figure 1. Click on Mail. -
Click on your email address in the list. See Figure 2:

Figure 2. Click on your email address. -
Then, click on the Spam Filter tab. See Figure 3:

Figure 3. Click on Spam Filter. -
Click on Show Advanced Settings. See Figure 4:

Figure 4. Click on Show Advanced Settings. -
Here, you can change the filter sensitivity, or add email addresses to your White list or Black list. For the sensitivity, a lower number will make the spam filter stricter, and a higher number will allow more messages through. Click OK when you're done. See Figure 5:

Figure 5. Change your spam filter sensitivity, and access your block and allow lists.
Via Plesk
-
Log in to your server's Plesk Control Panel and click on Server, see Figure 1.

Figure 1. -
Look for the Spam Filter icon and select it to go to your SpamAssassin settings page, see Figure 2.

Figure 2. -
Select the tab for managing the global block list settings, see Figure 3.

Figure 3. -
Select Add Addresses, see Figure 4.

Figure 4. -
Select the From list option and add the patterns you would like to filter as illustrated in Figure 5.

Figure 5.
TIP:
To get you started, here are a couple of examples:
- *@*.<ccTLD> - Block e-mails from a specific country's top-level domain.
- *@domain.tld - Block e-mails from a specific domain.
-
Once you are done inputting entries for this list, select OK and you'll be brought back to the previous screen. You will see a confirmation that your entries have been added, see Figure 6.

Figure 6.
Add addresses via SSH
This method goes one step beyond marking unwanted messages as spam. It will actually send a bounceback to the sender, with the following message:
SMTP error from remote mail server after RCPT TO:<username@example.com>: host mail.example.com [70.32.86.175]: 553 sorry, your envelope sender is in my badmailfrom list (#5.7.1)
To add email addresses to your badmailfrom list via SSH, please follow these instructions:
- Log into your server with a root or sudo user via SSH.
-
Open or create your badmailfrom file by executing the following command:
vi /var/qmail/control/badmailfrom -
Add each desired email address, server name, or IP on a separate line. Save the file.
TIP:
vi tip: Press "i" to enter "insert mode" so you can type and copy/paste. Press "Esc" to exit "insert mode" when you are done modifying the file. Type ":wq" to save and quit.
-
Restart the appropriate mail services with the following line:
/usr/local/psa/admin/bin/mailmng -o ; /usr/local/psa/admin/bin/mailmng -p ; /etc/init.d/xinetd restart ; /etc/init.d/qmail restart