Outils pour utilisateurs

Outils du site


tutoriaux:install-email-server:postfix-remove-headers

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

tutoriaux:install-email-server:postfix-remove-headers [2023/05/25 18:00] – créée fratertutoriaux:install-email-server:postfix-remove-headers [2023/05/25 18:06] (Version actuelle) frater
Ligne 13: Ligne 13:
 </WRAP> </WRAP>
  
-In order for this to work, your main.cf file will have to have a reference to the header_checks file as follows:+In order for this to work, your ''main.cf'' file will have to have a reference to the ''header_checks'' file as follows: 
 <code bash>header_checks = regexp:/etc/postfix/maps/header_checks</code> <code bash>header_checks = regexp:/etc/postfix/maps/header_checks</code>
  
-It is recommended that you keep all of your postfix map files in one directory along with any checks files. In this case, these will be kept in /etc/postfix/maps.+It is recommended that you keep all of your postfix map files in one directory along with any checks files. In this case, these will be kept in ''/etc/postfix/maps''.
  
 ===== HEADER_CHECKS DETAILS ===== ===== HEADER_CHECKS DETAILS =====
  
-In addition to any spam filters (see our header_checks file for more information), the below lines should be added to your header_checks file to preserve privacy and remove headers for the internal operations of your mail server:+In addition to any spam filters (see our ''header_checks'' file for more information), the below lines should be added to your ''header_checks'' file to preserve privacy and remove headers for the internal operations of your mail server:
  
-    # Sample For Dropping Headers:  +<code> 
-    #/^Header: IfContains/  IGNORE +# Sample For Dropping Headers:  
-    /^Received: from 127.0.0.1/ IGNORE +#/^Header: IfContains/  IGNORE 
-    /^User-Agent:/  IGNORE +/^Received: from 127.0.0.1/ IGNORE 
-    /^X-Mailer:/  IGNORE +/^User-Agent:/  IGNORE 
-    /^X-Originating-IP:/  IGNORE+/^X-Mailer:/  IGNORE 
 +/^X-Originating-IP:/   IGNORE 
 +</code>
  
-Each line above will search for headers tha have the content between the /^ and the / and will remove each line within the email headers that matches. As an example, the line “/^Received: from 127.0.0.1 .*/ IGNORE” will erase any lines from the email headers that list previous handoffs from an internal mail process to another. This is most commonly used for antivirus or antispam functions on a mail server.+Each line above will search for headers tha have the content between the ''/^'' and the ''/'' and will remove each line within the email headers that matches. As an example, the line “/^Received: from 127.0.0.1 .*/ IGNORE” will erase any lines from the email headers that list previous handoffs from an internal mail process to another. This is most commonly used for antivirus or antispam functions on a mail server.
  
 The following lines are related to Anomy Sanitizer and SpamAssassin – two very useful products. These three lines will remove references from the headers for the two software packages, making sure that the users of the system will not easily identify the software that is running on the back end. The following lines are related to Anomy Sanitizer and SpamAssassin – two very useful products. These three lines will remove references from the headers for the two software packages, making sure that the users of the system will not easily identify the software that is running on the back end.
  
-    # Sample For Dropping Headers:  +<code> 
-    #/^Header: IfContains/  IGNORE +# Sample For Dropping Headers:  
-    /^Received: from 127.0.0.1/ IGNORE +#/^Header: IfContains/  IGNORE 
-    /^X-Sanitizer:/  IGNORE +/^Received: from 127.0.0.1/ IGNORE 
-    /^X-Spam-Status:/  IGNORE +/^X-Sanitizer:/  IGNORE 
-    /^X-Spam-Level:/  IGNORE+/^X-Spam-Status:/  IGNORE 
 +/^X-Spam-Level:/  IGNORE 
 +</code>
  
 If one were to want to remove all headers relevant to personal information and previous hosts on which the email has passed, the following would be a possible configuration. Note that by removing all of this information, some mail servers will automatically identify emails passing through this system as spam. You will also be removing useful information for troubleshooting any problems that may arise with the mail server. If one were to want to remove all headers relevant to personal information and previous hosts on which the email has passed, the following would be a possible configuration. Note that by removing all of this information, some mail servers will automatically identify emails passing through this system as spam. You will also be removing useful information for troubleshooting any problems that may arise with the mail server.
  
-    # Sample For Dropping Headers:  +<code> 
-    #/^Header: IfContains/ IGNORE +# Sample For Dropping Headers:  
-    /^Received:/  IGNORE +#/^Header: IfContains/ IGNORE 
-    /^User-Agent:/  IGNORE +/^Received:/  IGNORE 
-    /^Message-ID:/  IGNORE +/^User-Agent:/   IGNORE 
-    /^X-Mailer:/  IGNORE +/^Message-ID:/  IGNORE 
-    /^X-MimeOLE:/  IGNORE +/^X-Mailer:/  IGNORE 
-    /^X-MSMail-Priority:/ IGNORE +/^X-MimeOLE:/  IGNORE 
-    /^X-Spam-Status:/ IGNORE +/^X-MSMail-Priority:/ IGNORE 
-    /^X-Spam-Level:/ IGNORE +/^X-Spam-Status:/ IGNORE 
-    /^X-Sanitizer:/ IGNORE +/^X-Spam-Level:/ IGNORE 
-    /^X-Originating-IP:/ IGNORE+/^X-Sanitizer:/ IGNORE 
 +/^X-Originating-IP:/ IGNORE 
 +</code>
  
 ===== OTHER METHODS OF IMPLEMENTATION ===== ===== OTHER METHODS OF IMPLEMENTATION =====
Ligne 59: Ligne 66:
 Another method of keeping only the headers that you want would be as follows: Another method of keeping only the headers that you want would be as follows:
  
-    /^((Resent-)?From|To|Cc|Date|Return-Path|Message-ID):/ OK +<code> 
-    /./ IGNORE+/^((Resent-)?From|To|Cc|Date|Return-Path|Message-ID):/ OK 
 +/./ IGNORE 
 +</code>
  
 In this case, we are specifying all of the headers that are OK on the fist line, and removing all of the rest on the second line. In this case, we are specifying all of the headers that are OK on the fist line, and removing all of the rest on the second line.
tutoriaux/install-email-server/postfix-remove-headers.txt · Dernière modification : 2023/05/25 18:06 de frater