Related Items  

Linux and Windows IT Support  


Windows, Apple and Linux IT support and services.

For Software and Web Development.

Postfix drop a particular email



Sometimes we have emails going to a particular address, which cannot be stopped. There are many reasons, but most common is an invalid address, which pollutes the mail queue with invalid entries. The simplest way to solve this is by adding a DISCARD directive for postfix.

If you don't have it already, add this line in

header_checks = regexp:/etc/postfix/header_checks

Create the file (or add to it, if you already have one):

/blockemail@example\.com/    DISCARD

Finally, restart postfix:

/etc/init.d/postfix restart

The file header_checks is very useful for other things. You can, for example, add a subject line to the logs using header_checks file:

/^Subject:/ INFO

The above command directs postfix to save the Subject into the logs. This makes things easier when searching for an email in the logs. The code can be separated by line in header_checks. Keep in mind that the more you add to it, the slower postfix becomes.

Original Article


Comments (1)
1 Saturday, 17 March 2018 19:41
test comment - ignore

Add your comment

Your name:
  The word for verification. Lowercase letters only with no spaces.
Word verification:
yvComment v.1.24.0
Copyright © 1999 - 2024 Virtual Helpme | Techical Support and Maintenance | Original Template: Allrounder