I have two SMTP gateways set up outside my firewall. I want to configure them so that they accept mail FROM: anyone, but who the mail is TO: is limited to a couple of IP addresses. If an attempt is made to relay to any other host, then the relay is rejected. I have tried many configurations with sendmail.cf and have used the M4 compiler to try and create the sendmail.cf. Here is the input to the compile.
divert(0)dnl
VERSIONID(`$Id: generic-hpux10.mc,v 8.11 1999/02/07 07:26:02 gshapiro Exp $')
OSTYPE(hpux11)dnl
DOMAIN(generic)dnl
define(`_X400_UUCP_')dnl
define(`_MASQUERADE_ENVELOPE_')dnl
define(`confTRY_NULL_MX_LIST',`T')dnl
define(`LUSER_RELAY',`name_of_luser_relay')dnl
define(`DATABASE_MAP_TYPE',`dbm')dnl
define(`_CLASS_U_')dnl
define(`confLOG_LEVEL',`10')dnl
define(`confDOMAIN_NAME',`$w.mydomain)dnl
define(`SMART_HOST',`internalgateway.com')dnl
define(`MAIL_HUB',` internalgateway.com')dnl
define(`MASQUERADE_NAME',` internalgateway.com')dnl
define(`confMAILER_NAME',`smtp@mydomain.com')
FEATURE(accept_unresolvable_domains)
FEATURE(always_add_domain)dnl
FEATURE(access_db)dnl
FEATURE(`delay_checks')dnl
MAILER(local)dnl
MAILER(smtp)dnl
Here are the contents of the access DB
to:mydomain.com relay
connect:smtphost.com relay
to:anotherdomain.com relay
connect:anotherdomain.com relay
Everything is working fine with the exception of relay attempts to addresses outside of mydomain.com. It just relays them too. What I am attempting to set up is a closed or private relay hub.
Rich Taft
Sometimes your the windshield, sometimes your the bug