Remove/hide sender's ip from postfix?

Collapse

Unconfigured Ad Widget

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • Delaney martin
    Senior Member
    • Jun 2022
    • 187

    Remove/hide sender's ip from postfix?

    VPS Hosting
    Hi, I am trying to hide the client IP from emails sent from Postfix.

    Here is an example of what I mean:

    Received: from mail.[removed].com (adsl-75-37-61-254.dsl.frs2ca.sbcglobal.net [55.27.21.245])

    Notice this line (adsl-75-37-61-254.dsl.frs2ca.sbcglobal.net [55.27.21.245])

    I want to remove that line from the email.

    Thanks in advance.
  • wisly.k
    Senior Member
    • May 2022
    • 192

    #2
    Here are the steps to Remove Client's IP from Postfix:


    Edit Postfix Main Configuration

    Open your main.cf file:

    sudo nano /etc/postfix/main.cf

    Add the following line at the end of the file:

    header_checks = regexp:/etc/postfix/header_checks
    • The header_checks option allows Postfix to filter email headers using regular expressions.
    Create the Header Check File

    Now, create the header_checks file:

    sudo nano /etc/postfix/header_checks

    Add this line to remove any Received: headers containing IP addresses:

    /^Received:.*\(.*\[.*\].*\)/ IGNORE
    • The IGNORE action completely removes any matching lines from the email headers.
    Apply Configuration Changes

    After saving the files, run:

    sudo postmap /etc/postfix/header_checks

    sudo systemctl restart postfix



    Comment

    Working...
    X