Mail Header and Postfix

Hi,
Whenever I send mail it has the following header which takes the mail to spam


 Delivered-To: amigovista@gmail.com
Received: by 10.141.129.17 with SMTP id g17cs376644rvn;
        Fri, 26 Dec 2008 11:05:47 -0800 (PST)
Received: by 10.210.142.10 with SMTP id p10mr177422ebd.95.1230318345065;
        Fri, 26 Dec 2008 11:05:45 -0800 (PST)
Return-Path: <mailer@mysite.com>
Received: from mail.mysite.org (mysite.org [203.54.237.227])
        by mx.google.com with ESMTP id p10si16333536gvf.20.2008.12.26.11.05.43;
        Fri, 26 Dec 2008 11:05:44 -0800 (PST)
Received-SPF: neutral (google.com: 203.54.237.227 is neither permitted nor denied by best guess record for domain of mailer@mysite.com) client-ip=203.54.237.227;
Authentication-Results: mx.google.com; spf=neutral (google.com: 203.54.237.227 is neither permitted nor denied by best guess record for domain of mailer@mysite.com) smtp.mail=mailer@mysite.com
Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
	by mail.mysite.org (Postfix) with SMTP id 66C3B4D0100
	for <amigovista@gmail.com>; Fri, 26 Dec 2008 18:52:59 +0000 (UTC)
To: amigovista@gmail.com
From: mailer@mysite.com
Subject: Hey my first email
Message-Id: <20081226185300.66C3B4D0100@mail.mysite.org>
Date: Fri, 26 Dec 2008 18:52:59 +0000 (UTC)

This is my first email on debian postfix after installing configuring it.
It was easy. See you

Now I want Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) to be replaced by mysite.org and then check if mail reaches the inbox.

I have postfix running on debian etch. How do I do the required changes


telnet mysite.org 25
Trying 203.54.237.227...
Connected to mysite.org.
Escape character is '^]'.
220 mail.mysite.org ESMTP Postfix (Debian/GNU)
mail from:<mailer@mysite.com>
250 2.1.0 Ok
rcpt to:<amigovista@gmail.com>
data
To: amigovista@gmail.com
From: mailer@mysite.com
Subject: Hey my first email
This is my first email on debian postfix after installing configuring it.
It was easy. See you
554 5.7.1 <amigovista@gmail.com>: Relay access denied
554 5.5.1 Error: no valid recipients
221 2.7.0 Error: I can break rules, too. Goodbye.
Connection closed by foreign host.

but
debian:~# telnet localhost 25 works fine (send mail atleast to spam!!!)

Simple: Use a different computer to send e-mail to yourself (at this server).

Regards,

DK

Hello,

Mails sent from any machine generally bear the machine’s hostname in the header. Changing the hostname of your system should help you with this.


Received: from HOSTNAME

Regards

I just edit /etc/hostname. and now in the email header it shows

Received: from [208.8.237.227] (mysite.org [127.0.0.1])
	by mail.mysite.org (Postfix) with ESMTP id 48EB44D00FE
	for <testmail@gmail.com>; Mon, 29 Dec 2008 15:07:06 +0000 (UTC)

After changing /etc/hostname localhost.localdomain was replaced by mysite.org but the ip still is 127.0.0.1 which i think should be 208.8.237.227

my /etc/hosts is

127.0.0.1       mysite.org  localhost.localdomain   localhost debian.4.x86_64

my /etc/resolve.conf gives


nameserver 127.0.0.1
search vpsfarm.com

Is this ok?

krishna,

As long as you’re looking at the server from the server, it’ll always be 127.0.0.1. Use another computer on the LAN or Internet.

Regards,

DK

Hello,

my /etc/hosts is
Code:

127.0.0.1 mysite.org localhost.localdomain localhost debian.4.x86_64

This line itself shows that you are mapping your server’s hostname(mysite.org) to the IP 127.0.0.1.
You need to change this file to map your server’s hostname to the server IP(208.8.237.227). Just remove the hostname(mysite.org) from first line and add a second line mapping the hostname to IP.
It should look something like this:


127.0.0.1      localhost.localdomain   localhost  debian.4.x86_64
208.8.237.227  mysite.org

Regards