Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Administrators

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 03-16-2008, 01:59 PM
Senior Member
 
Posts: 52
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
Reply With Quote
  #2 (permalink)  
Old 03-17-2008, 12:23 AM
Zimbra Consultant & Moderator
 
Posts: 20,312
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
Reply With Quote
  #3 (permalink)  
Old 03-17-2008, 01:03 AM
Senior Member
 
Posts: 52
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:
from localhost (localhost.localdomain [127.0.0.1])

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
Reply With Quote
  #4 (permalink)  
Old 03-17-2008, 02:12 AM
Moderator
 
Posts: 7,928
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 02:44 AM.. Reason: Path to file was incorrect
Reply With Quote
  #5 (permalink)  
Old 03-17-2008, 02:28 AM
Moderator
 
Posts: 7,928
Default

Quote:
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.
__________________
Reply With Quote
  #6 (permalink)  
Old 03-17-2008, 02:39 AM
Senior Member
 
Posts: 52
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 02:43 AM.. Reason: Path to file was incorrect
Reply With Quote
  #7 (permalink)  
Old 03-17-2008, 02:42 AM
Moderator
 
Posts: 7,928
Default

Did you switch user to zimbra first ?
__________________
Reply With Quote
  #8 (permalink)  
Old 03-17-2008, 02:45 AM
Senior Member
 
Posts: 52
Default

yes, I forgot to switch first. I edited my reply above.
Reply With Quote
  #9 (permalink)  
Old 03-17-2008, 02:50 AM
Moderator
 
Posts: 7,928
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
__________________
Reply With Quote
  #10 (permalink)  
Old 03-17-2008, 02:55 AM
Senior Member
 
Posts: 52
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
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.