PDA

View Full Version : Mail Header and Postfix


kkonline
26th December 2008, 21:38
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!!!)

falko
27th December 2008, 14:15
What's in /etc/postfix/main.cf?

How did you set up your email account?

kkonline
27th December 2008, 19:15
# Debian specific: Specifying a file name will cause the first
# line of that file to be used as the name. The Debian default
# is /etc/mailname.
#myorigin = /etc/mailname

smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no

# appending .domain is the MUA's job.
append_dot_mydomain = no

# Uncomment the next line to generate "delayed mail" warnings
#delay_warning_time = 4h

# TLS parameters
smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt
smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key
smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:${queue_directory}/smtpd_scache
smtp_tls_session_cache_database = btree:${queue_directory}/smtp_scache

# See /usr/share/doc/postfix/TLS_README.gz in the postfix-doc package for
# information on enabling SSL in the smtp client.

myhostname = mail.mysite.org
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
#mydestination = mail.mysite.org, debian.4.x86_64, localhost.4.x86_64, localhost
relayhost =
mynetworks = 127.0.0.0/8
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = all
smtpd_sasl_local_domain =
smtpd_sasl_auth_enable = yes
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject _unauth_destination
smtpd_tls_auth_only = no
smtp_use_tls = yes
smtp_tls_note_starttls_offer = yes
smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem
smtpd_tls_loglevel = 1
smtpd_tls_received_header = yes
smtpd_tls_session_cache_timeout = 3600s
tls_random_source = dev:/dev/urandom

virtual_maps = hash:/etc/postfix/virtusertable

mydestination = /etc/postfix/local-host-names

The emails are configured using ispconfig and I use swiftmailer to send the mails

falko
28th December 2008, 14:14
What's in /etc/mailname?

kkonline
28th December 2008, 14:20
it's mysite.org

falko
29th December 2008, 13:43
What are the outputs of hostname and hostname -f?

What's the output of postconf -d | grep localhost.localdomain?

kkonline
29th December 2008, 16:47
debian:~# hostname
debian.4.x86_64
debian:~# hostname -f
mysite.org
debian:~# postconf -d | grep localhost.localdomain
debian:~#

kkonline
29th December 2008, 17:28
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

The /etc/resolve.conf gives


nameserver 127.0.0.1
search vpsfarm.com
Is this ok?

falko
30th December 2008, 14:13
I think it shows 127.0.0.1 because you're sending the email directly from the server using a webmail application. This should be ok.