On Tue, Nov 16, 2010 at 11:52:36AM -0500, Randy Ramsdell wrote: > Chris G wrote: > >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 <ch...@halon.org.uk>: Relay access > > denied; from=<ch...@dps.zbmc.eu> to=<ch...@halon.org.uk> 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) > > > > It connects from 84.45.228.40. Either fix the that or add that to > mynetworks on mws.zbmc.eu.
Yes, I realise that "It connects from 84.45.228.40" but I can find no reason at all *why* the postfix server process on mws.zbmc.eu thinks that the connection is from 84.45.228.40. Wherever I look on my LAN the IP address of dps.zbmc.eu is reported as 192.168.1.2. From the outside world dps.zbmc.eu is non-existent. So where is the postfix on mws.zbmc.eu getting the address 84.45.228.40 for dps.zbmc.eu? Alternatively (and this seems more likely to me) the postfix on mws.zbmc.eu is seeing the connection come from zbmc.eu for some reason and that *does* resolve to 84.45.228.40. What I'm asking is *why* it's seeing the connection from zbmc.eu even though I have set everything that I can see to say it's dps.zbmc.eu. If I try 'telnet mws.zbmc.eu 25' from dps.zbmc.eu then sendmail reports 'connect from dps.zbmc.eu[192.168.1.2]' in the mail.log which is what I want. However if I call sendmail (postfix's sendmail) directly on dps.zbmc.eu and send a message to mws.zbmc.eu then it's reported (as noted above) as 'connect from unknown[84.45.228.40]'. So it would seem that the postfix sendmail on dps.zbmc.eu is, for some reason, deciding that it's zbmc.eu/84.45.228.40 for some reason that I can't fathom. I.e. the question is why the postfix on dps.zbmc.eu thinks it's sending from 84.45.228.40 even though I've set just about everything I can think of in main.cf to tell it that it's dps.zbmc.eu. -- Chris Green