I have a small SoHo network of machines and I have postfix installed on
most of them for sending mail. The machines sit behind a NAT router
which connects them to the internet, the domain name (as seen from the
outside world) is zbmc.eu. All the machines are running xubuntu 10.04
and have postfix 2.7.0.
Within the LAN behind the router the machines have names like
chris.zbmc.eu, mws.zbmc.eu, dps.zbmc.eu and so on.
Most things are working OK, I can send and receive mail on my desktop
machine OK via my ISP's smarthost and I get local messages OK.
My problem has arisen on one of the machines which is a headless server,
it's dps.zbmc.eu. I want E-Mail from that machine to be sent out via
the mailhub machine on the network which is mws.zbmc.eu. The problem is
that, whatever I try, the mailhub machine sees mail sent from dps.zbmc.eu
as coming from zbmc.eu (well, its IP) and rejects it with a 'relaying
denied' message.
The bottom of /etc/postfix/main.cf on dps.zbmc.eu is:-
myhostname = dps.zbmc.eu
alias_maps = hash:/etc/aliases
alias_database = hash:/etc/aliases
myorigin = /etc/mailname
mydestination = dps.zbmc.eu, localhost.zbmc.eu, localhost
relayhost = mws.zbmc.eu
mynetworks = 127.0.0.0/8 [::ffff:127.0.0.0]/104 [::1]/128
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = loopback-only
inet_protocols = ipv4
What I see in /var/log/mail.log is:-
Nov 16 16:04:20 mws postfix/smtpd[31242]: connect from unknown[84.45.228.40]
Nov 16 16:04:20 mws postfix/smtpd[31242]: NOQUEUE: reject: RCPT from
unknown[84.45.228.40]: 554 5.7. 1 <[email protected]>: Relay access denied;
from=<[email protected]> to=<[email protected]> proto=ESMTP helo=<dps.zbmc.eu>
Nov 16 16:04:20 mws postfix/smtpd[31242]: disconnect from
unknown[84.45.228.40]
So why does postfix see the connection as if it comes from 84.45.228.40?
It's as if it thinks the connection is from zbmc.eu as opposed to
dps.zbmc.eu but everything is set to say I'm sending from dps.zbmc.eu.
The command 'host dps.zbmc.eu' returns 'dps.zbmc.eu has address
192.168.1.2' on both dps.zbmc.eu and on mws.zbmc.eu. (Oh, /etc/mailname
contains dps.zbmc.eu too)
Any help or suggestions would be most welcome, I can supply more
information if needed.
A rejected message is as follows:-
Date: Tue, 16 Nov 2010 16:02:54 +0000 (GMT)
From MAILER-DAEMON Tue Nov 16 16: 2:54 2010
From: Mail Delivery System <[email protected]>
To: [email protected]
Subject: Undelivered Mail Returned to Sender
[-- Attachment #1: Notification --]
[-- Type: text/plain, Encoding: 7bit, Size: 0.5K --]
This is the mail system at host dps.zbmc.eu.
I'm sorry to have to inform you that your message could not
be delivered to one or more recipients. It's attached below.
For further assistance, please send mail to postmaster.
If you do so, please include this problem report. You can
delete your own text from the attached returned message.
The mail system
<[email protected]>: host zbmc.eu[84.45.228.40] said: 554 5.7.1
<[email protected]>: Relay access denied (in reply to RCPT TO command)
[-- Attachment #2: Delivery report --]
[-- Type: message/delivery-status, Encoding: 7bit, Size: 0.3K --]
Reporting-MTA: dns; dps.zbmc.eu
X-Postfix-Queue-ID: E83EE100283
X-Postfix-Sender: rfc822; [email protected]
Arrival-Date: Tue, 16 Nov 2010 16:02:53 +0000 (GMT)
Final-Recipient: rfc822; [email protected]
Action: failed
Status: 5.7.1
Remote-MTA: dns; zbmc.eu
Diagnostic-Code: smtp; 554 5.7.1 <[email protected]>: Relay access denied
[-- Attachment #3: Undelivered Message --]
[-- Type: message/rfc822, Encoding: 7bit, Size: 0.5K --]
Return-Path: <[email protected]>
Received: by dps.zbmc.eu (Postfix, from userid 1000)
id E83EE100283; Tue, 16 Nov 2010 16:02:53 +0000 (GMT)
Date: Tue, 16 Nov 2010 16:02:53 +0000
From: Chris Green <[email protected]>
To: [email protected]
Subject: Test message
Message-ID: <[email protected]>
MIME-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
User-Agent: Mutt/1.5.20 (2009-06-14)
This is a test
--
Chris Green (at server dps)
--
Chris Green