OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 

From: Bob Fontana (bfontanacodebench.com)
Date: Sun Mar 02 2003 - 21:07:48 CST


I love Postfix but this problem has had me stumped for days. I've searched
all of the archives for posts related to /etc/hosts, resolv.conf, etc. but
have been unsuccessful in solving this one. I also apologize for sending
MODIFIED host names and public IP addresses.

We have Postfix 2.0.3 with pfixtls-0.8.13-2.0.3-0.9 installed.

It is running chrooted after configuring and executing LINUX2 script.

There are 4 *nix servers behind a Netgear RT314 router.

We have a static IP addresses 99.88.77.0/24 and are the authoritative name
server for example.com.

On the Postfix machine, box4, our /etc/hosts and
/var/spool/postfix/etc/hosts look like this:

        127.0.0.1 localhost.localdomain localhost
        192.168.1.1 router1.example.com router1
        ...
        ...
        192.168.1.15 box1.example.com box1
        192.168.1.17 box2.example.com box2 ns.example.com
        192.168.1.18 box3.example.com box3
        192.168.1.19 box4.example.com box4 mail.example.com mailstore
        ...
        ...

We want to box4 to store mail for all machines on 192.168.1.0/24, so that
automated backup logs and system administration email can be picked up by a
single user using a single POP3 account.

box4 tries to use DNS to resolve the name which results in the following
error when I tried to send something to root on box1:

Mar 2 21:32:53 pp200a postfix/smtpd[30881]: connect from
box1.example.com[192.168.1.15]
Mar 2 21:32:53 pp200a postfix/smtpd[30881]: 0DB8414EC4:
client=box1.example.com[192.168.1.15]
Mar 2 21:32:53 pp200a postfix/cleanup[30883]: 0DB8414EC4:
message-id=<200303030232.h232Wq43003951box1.example.com>
Mar 2 21:32:53 pp200a postfix/qmgr[30877]: 0DB8414EC4:
from=<rootbox1.example.com>, size=4341, nrcpt=1 (queue active)
Mar 2 21:32:53 pp200a postfix/smtpd[30881]: disconnect from
box1.example.com[192.168.1.15]
Mar 2 21:32:53 pp200a postfix/smtp[30885]: 0DB8414EC4:
to=<rootmailstore.example.com>, relay=none, delay=0, status=bounced (Name
service error for name=mailstore.example.com type=A: Host not found)
Mar 2 21:32:53 pp200a postfix/cleanup[30883]: 30C5614EC5:
message-id=<20030303023253.30C5614EC5mailstop.example.com>
Mar 2 21:32:53 pp200a postfix/qmgr[30877]: 30C5614EC5: from=<>, size=6082,
nrcpt=1 (queue active)
Mar 2 21:32:53 pp200a postfix/local[30887]: 30C5614EC5:
to=<markexample.com>, orig_to=<rootbox1.example.com>, relay=local,
delay=0, status=sent (mailbox)

Background:

We configured box1, box2, and box3, which run either Postfix or Sendmail, as
null mail clients whose "smarter host" was mail.example.com as shown in
sendmail.cf:

        DSmail.example.com

This didn't work because Postfix and Sendmail both insisted on resolving
mail.example.com to 99.88.77.66, ignoring /etc/hosts. The ensuing SMTP
connection would fail because the RT314 refuses the connection on port 25
from the LAN side.

So, we tried fooling Postfix Sendmail by placing bogus host name,
mailstore.example.com, into the /etc/hosts files of all 4 boxes. Host
mailstore.example.com has no CNAME entry.

        DSmailstore.example.com

This stopped Postfix and Sendmail from resolving our mail storage machine
and now mail could be sent from box1, box2, and box3 to box4.

However, even though box4's /etc/hosts file contains an alias of
mailstore.example.com and its main.cf contains the line:

        $myhostname = mailstore.example.com

The host mailstore.example.com will not resolve.

The main.cf file contains:

mail_owner = postfix
myhostname = mailstore.example.com
mydomain = example.com
myorigin = $mydomain
inet_interfaces = all
mydestination = $mydomain $myhostname localhost.$mydomain
mail.$mydomain relay.$mydomain box1.$mydomain box2.$mydomain box3.$mydomain
mynetworks = 192.168.2.0/24 192.168.1.0/24 99.88.77.0/24
127.0.0.0/8
virtual_alias_maps = hash:/etc/postfix/virtual
transport_maps = hash:/etc/postfix/transport
mail_spool_directory = /var/spool/mail
header_checks = regexp:/etc/postfix/header_checks
body_checks = regexp:/etc/postfix/body_checks
debug_peer_level = 2
sendmail_path = /usr/sbin/sendmail.postfix
newaliases_path = /usr/bin/newaliases.postfix
mailq_path = /usr/bin/mailq.postfix
setgid_group = postdrop
manpage_directory = /usr/share/man
sample_directory = /usr/share/doc/postfix-2.0.3/samples
readme_directory = /etc/postfix/README_FILES
maps_rbl_domains =
        bl.spamcop.net,
        relays.ordb.org,
        proxies.relays.monkeys.com,
        sbl.spamhaus.org,
        relays.visi.com,
        spam.dnsrbl.net,
        dun.dnsrbl.net

proxy_interfaces = 192.168.1.15, 192.168.1.17, 192.168.1.18, 192.168.1.19,
127.0.0.1

#UCE stuff
...
...
...

smtpd_use_tls = yes

smtpd_tls_key_file = /usr/share/ssl/private/smtpsd.key.pem
smtpd_tls_CAfile = /usr/share/ssl/certs/verisign.pem
smtpd_tls_CApath = /usr/share/ssl/certs
smtpd_tls_cert_file = /usr/share/ssl/certs/smtpsd.pem

smtp_tls_key_file = /usr/share/ssl/private/smtpsd.key.pem
smtp_tls_cert_file = /usr/share/ssl/certs/smtpsd.pem
smtp_tls_CAfile = /usr/share/ssl/certs/verisign.pem
smtp_tls_CApath = /usr/share/ssl/certs

smtpd_tls_received_header = yes
smtpd_tls_loglevel = 0

What's wrong with this configuration?

Thanks in advance.

Bob Fontana
Codebench, Inc.

(561) 883-3218 Voice
(561) 883-2566 Fax

Visit us at http://www.codebench.com