Support / KnowledgeBase

 
Search the KnowledgeBase Search

How can I block specific incoming emails?

  • Applies to: (dv) 3.5, (dv) 4.0

  • Difficulty: Easy

  • Time needed: 10 minutes

  • Tools needed: Plesk administrator access, SSH, root access

 
  • Applies to: (dv) 4.0
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: Plesk administrator access
  • Applies to: (dv) 3.5
    • Difficulty: Easy
    • Time Needed: 10
    • Tools Required: Plesk administrator access, SSH, root access

Overview

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 topic we encourage you to check their original article since 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

For detailed instructions and screen shots, please see: this article - specifically steps 5 and 6.

Via Plesk

  1. Log in to your server's Plesk Control Panel and click on Server, see Figure 1.

    1176_01
    Figure 1.

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

    1176_02
    Figure 2.

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

    1176_03
    Figure 3.

  4. Select Add Addresses, see Figure 4.

    1176_04
    Figure 4.

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

    1176_05
    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.
  6. 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.

    1176_06
    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:

  1. Log into your server with a root or sudo user via SSH.
  2. Open or create your badmailfrom file by executing the following command:
    
    vi /var/qmail/control/badmailfrom
    
  3. 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.

  4. 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
    

User Comments

No visitor comments posted. Post a comment
Fields marked with an asterisk(*) are required. Comment on this article
Fill out the form below if you would like to comment on this article.
 
 
 

(code is not case-sensitive)
 
Submit
 
 

Continue