1

Topic: Removing Originial Sender IP from headers

==== Required information ====
- iRedMail version: 0.8.6
- Store mail accounts in MySQL
- Debain 7 64Bit
- Related log if you're reporting an issue:
====

hey guys I was wondering if anyone had any success writing  PCRE lines to remove the original IP/Agent/Name form the send, so that the chains on the headers starts at localhost 127.0.0.1 on the server rather than my Outlook Agent/IP

I know we will need to use in the postfix main.cf
smtp_header_checks = pcre:/path/to/file

but I am not sure what rules I need to put in.

NOTE: I currently use both DKIM and DomainKeys with iRedMail so we can not strip those please.

Thanks!

2 (edited by Neutro 2014-04-27 18:00:31)

Re: Removing Originial Sender IP from headers

Hi,

1°) Add this at the end of "/etc/amavis/conf.d/50-user":

$insert_received_line = 0;
$allowed_added_header_fields{lc('Received')} = 0;


2°) Add this at the end of "/etc/postfix/main.cf":


smtp_header_checks = pcre:/etc/postfix/header_checks.pcre
smtp_mime_header_checks = pcre:/etc/postfix/mime_header_checks.pcre


3°) use command "nano /etc/postfix/header_checks.pcre" and add this inside the file:

/^Received: from .*YOUR IP ADDRESS HERE.*/     IGNORE


4°) use command "nano /etc/postfix/mime_header_checks.pcre" and add this inside the file:

/^Received: from .*YOUR IP ADDRESS HERE.*/     IGNORE


5°) Restart your server

6°) Check headers. Enjoy smile

3

Re: Removing Originial Sender IP from headers

Hi

I had some issues with your solution:
"Starting amavisd: Variable $insert_received_line was retired, changing its value has no effect. See release notes."

And also I am after a more scalable solution that manually entering my IP, I want to have so that none of my clients will be shown. they are all on dynamic IPs too

4

Re: Removing Originial Sender IP from headers

Bump, does anyone know how to go about removing these from the email headers (for all clients and their IPs) while still keeping DKIM and DomainKeys all running sweet?

5

Re: Removing Originial Sender IP from headers

This is of interest to me as well; removing client IP from the header. It already works if web-mail/roundcube is used, but not for other email clients.

6 (edited by Neutro 2014-05-11 19:42:03)

Re: Removing Originial Sender IP from headers

adamBB wrote:

Hi

I had some issues with your solution:
"Starting amavisd: Variable $insert_received_line was retired, changing its value has no effect. See release notes."

And also I am after a more scalable solution that manually entering my IP, I want to have so that none of my clients will be shown. they are all on dynamic IPs too

$insert_received_line = 0;

I found out that this line is deprecated, so you can remove it safely. The second one will do the job.

Could you post a full e-mail source from your server?

Basicly if the IP of your clients are shown in the following line:

/^Received: from .*CLIENT IP HERE.*/     IGNORE

you just have to filter this line as I explained it to you earlier using:

/^Received: from .*/     IGNORE

this will remove all references to "received from" in your source e-mails.

PS: you can check your e-mail source by sending an e-mail here:

http://www.mail-tester.com/