Page 1 of 5 123 ... LastLast
Results 1 to 10 of 45

Thread: Changing localhost (localhost.localdomain [127.0.0.1]) in message headers

  1. #1
    Join Date
    Mar 2008
    Location
    Seattle
    Posts
    52
    Rep Power
    7

    Default Changing localhost (localhost.localdomain [127.0.0.1]) in message headers

    How can I change this section of my outgoing/incoming message headers:

    Code:
    Received: from localhost (localhost.localdomain [127.0.0.1])
    ..to say

    Code:
    Received: from realhostname (realhostname.mydomain.com [Public-IP])
    Also the amavisd section of the headers I want changed from:

    Code:
    Received: from realhostname.mydomain.com ([127.0.0.1])
                  by localhost (realhostname.mydomain.com [127.0.0.1])
    ..to this

    Code:
    Received: from realhostname.mydomain.com ([Public IP])
                  by realhostname (realhostname.mydomain.com [Public IP])
    Basically I don't want the terms localhost, localdomain or 127.0.0.1 in the message headers anywhere.

    This is easy to do with Apache James, I just need to know how to do it with Zimbra/Postfix.

    Thanks for your help

  2. #2
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,587
    Rep Power
    58

    Default

    You should already see a header for you FQDN and the IP of your server in the headers, the ones for localhost are there because a message has been injected in the mail server. Why is this a problem?
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  3. #3
    Join Date
    Mar 2008
    Location
    Seattle
    Posts
    52
    Rep Power
    7

    Default

    This is a new install of Zimbra, and I am running it on a NAT Lan with a dynamic public IP address. Right now the Zimbra install is for testing purposes, but if I can get the message headers to look more like I want them, I will migrate from my Apache James setup to Zimbra.

    -In the past, before I changed the hostname settings in Apache James, some messages from my server would get parsed as spam even after being sent through my ISP smart host. Back then, testing my server against the now defunct ORDB.org led me to remove the terms localhost, and 127.0.0.1 from outgoing message headers.

    So basically the reason I want the terms removed is because I don't want messages from my server being marked as spam because of my dynamic IP.

    I read your replys from January 2007 the last time this was brought up and they didn't help.
    See this link:
    http://www.zimbra.com/forums/install...7-0-0-1-a.html

    I know there is a way to change the format or just remove certain parts of the message headers I just need a little guidance as I am new to Zimbra and Postfix. If you like I can post part of my headers from my Apache James setup so you can see how I would like to model the hostname part of my Zimbra install.

    Thanks

  4. #4
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    Default

    This will probably work (but untested) :-

    Code:
    su - zimbra
    cd /opt/zimbra/postfix/conf
    echo "/^Received: from 127.0.0.1/  	IGNORE" > header_checks
    zmprov modifyConfig zimbraMtaHeaderChecks regexp:/opt/zimbra/postfix/conf/header_checks
    postfix reload
    This should strip your unwanted header. I am unsure about the zmprov though, but hopefully one of the ZM employees/or other mods should be able to put my syntax right.
    Last edited by uxbod; 03-17-2008 at 03:44 AM. Reason: Path to file was incorrect

  5. #5
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    Default

    So basically the reason I want the terms removed is because I don't want messages from my server being marked as spam because of my dynamic IP.
    If you are using a smart host then I do not see what the problem is. Having localhost in the headers does not normally trigger a email to be marked as SPAM.

  6. #6
    Join Date
    Mar 2008
    Location
    Seattle
    Posts
    52
    Rep Power
    7

    Default

    Quote Originally Posted by uxbod View Post
    This will probably work (but untested) :-

    Code:
    su - zimbra
    cd /opt/zimbra/postfix/conf
    echo "/^Received: from 127.0.0.1/  	IGNORE" > header_checks
    zmprov modifyConfig zimbraMtaHeaderChecks regexp:/opt/zimbra/postfix/conf/header_checks
    postfix reload
    This should strip your unwanted header. I am unsure about the zmprov though, but hopefully one of the ZM employees/or other mods should be able to put my syntax right.
    The first command made changes to the headerchecks file and I could see them in the file. This is what I got for the zmprov command:

    Code:
    ERROR: account.INVALID_ATTR_NAME (invalid attr name: [LDAP: error code 17 - zimbraMtaHeaderChecks: attribute type undefined])
    Last edited by uxbod; 03-17-2008 at 03:43 AM. Reason: Path to file was incorrect

  7. #7
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    Default

    Did you switch user to zimbra first ?

  8. #8
    Join Date
    Mar 2008
    Location
    Seattle
    Posts
    52
    Rep Power
    7

    Default

    yes, I forgot to switch first. I edited my reply above.

  9. #9
    Join Date
    Nov 2006
    Location
    UK
    Posts
    8,017
    Rep Power
    25

    Default

    Okay, what you will need to do is update /opt/zimbra/postfix/conf/zmmta.cf and add the following :-

    Code:
    header_checks = regexp:/opt/zimbra/postfix/conf/header_checks
    then do :-

    Code:
    postfix reload

  10. #10
    Join Date
    Mar 2008
    Location
    Seattle
    Posts
    52
    Rep Power
    7

    Default

    in /opt/zimbra/postfix/conf i do not see a file named zmmta.cf
    Do I need to create it or should I add this to main.cf?
    In main.cf I see a line that currently reads:

    header_checks = pcre:/opt/zimbra/conf/postfix_header_checks

Similar Threads

  1. Why is Tomcat shuting down ever nights?
    By trapanator in forum Administrators
    Replies: 2
    Last Post: 11-30-2006, 11:57 PM
  2. fetchmail: SMTP< 250 Ok: queued as
    By daly1 in forum Installation
    Replies: 4
    Last Post: 08-04-2006, 05:23 AM
  3. Problem sending mails
    By fmodola in forum Administrators
    Replies: 3
    Last Post: 04-12-2006, 09:39 AM
  4. MTA is Dying after yum update
    By tonyawbrey in forum Administrators
    Replies: 27
    Last Post: 04-02-2006, 07:11 PM
  5. emails don't show up in inbox in browser
    By pstelzer in forum Installation
    Replies: 10
    Last Post: 12-13-2005, 10:21 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •