On Fri, Dec 15, 2000 at 03:56:51PM +1100, Marty wrote:
> anyone got any recommendations for sendmail setup guides?
http://www.sendmail.org/ and O'Reilly's sendmail book ("The bat book").
comp.mail.sendmail.
> ie. one that will help me understand how to implement a working /
> non-relaying setup on a configuration like this:
>
> hub (192.168.1.2) ---- (192.168.1.1) gateway (xxx.xxx.xxx.xxx) ---- inet
>
> so that the gateway will accept relaying for inbound and outbound mail for
> our domain.
Is this what you want to do?
1. Accept mail from the outside world for your domain, for delivery to
local accounts.
2. Accept mail from 192.168.1.x (internal hosts) for relay to the
outside world.
If so, it's not difficult but if you've never played with sendmail
before it can be a little daunting. Exact details depend upon the
version of sendmail that you're using, but this should work for 8.8.x
and 8.9.x at least.
Take the default sendmail.mc file - if Redhat, install the sendmail-cf
rpm, and make a copy of /usr/lib/sendmail-cf/cf/redhat.mc; if another
distro, you'll have to find it yourself. Add or change the following
directives:
define(`confPRIVACY_FLAGS',`goaway')
FEATURE(`always_add_domain')
FEATURE(`masquerade_envelope')
MASQUERADE_AS(`your.domain.here')
FEATURE(`limited_masquerade')
MASQUERADE_DOMAIN(`your.domain.here')
FEATURE(`masquerade_entire_domain')
define(`SMART_HOST',`your.isps.smtp.server.here')
LOCAL_CONFIG
Cwyour.domain.here
This is what these things do:
`confPRIVACY_FLAGS' determines whether sendmail allows VRFY and EXPN
commands, and a couple of other things I can't remember (and my bat
book is at home).
`always_add_domain' causes sendmail to add your domain name to any
address if no domain is present.
`masquerade_envelope' tells sendmail to masquerade the envelope part of
the smtp transactions, i.e. it sends the masqueraded domain name
rather than its own hostname.
MASQUERADE_AS tells sendmail the name of the domain to be used for
masquerading.
`limited_masquerade' tells sendmail to only masquerade the domains
listed in MASQUERADE_DOMAIN. This allows you to send mail with
a `From' address in another domain, and it won't be changed to
match your domain.
MASQUERADE_DOMAIN tells sendmail which domains are to be masqeuraded.
Any addresses within these domain(s) will have their domain name
part changed to the domain defined by MASQUERADE_AS.
`masquerade_entire_domain' tells sendmail to masquerade all hosts
within your domain, so [EMAIL PROTECTED] becomes user@domain.
`SMART_HOST' defines the host to which sendmail will send all non-local
mail. It's common to use your ISP's smtp server as a relay host.
LOCAL_CONFIG starts a block in which you can define variables etc which
will appear in the final .cf file.
Cw defines the names of domains which sendmail considers local, i.e. it
will accept mail addressed to those domains and deliver them to
local accounts (after alias and virtual user processing).
Put your domain where I've written `your.domain.here' (two places), and
your ISP's smtp server where I've written
`your.isps.smtp.server.here'.
How you setup your host to relay for local machines depends upon the version
of sendmail:
8.8.x: Add 192.168.1 to the file in the HACK(`use_ip') directive. This is
commonly /etc/mail/ip_allow.
8.9.x: Add this to the .mc file:
FEATURE(`relay_mail_from')
FEATURE(`access_db', `hash /etc/mail/access')
Create a RELAY map:
echo "192.168.212 REJECT" > /etc/mail/access
makemap hash /etc/mail/access < /etc/mail/access
Finally, for all versions of sendmail you need to rebuild the .cf file
with:
cd /usr/lib/sendmail-cf/cf
m4 ../m4/cf.m4 file.mc > file.cf
Put 192.168.1 into /etc/mail/ip_allow (sendmail 8.8.x) or
Save /etc/sendmail.cf, copy the one you've just built to /etc/sendmail.cf,
restart sendmail.
Of course, you'll need to make sure that your gateway machine is also
the MX host for your domain if you want to receive any mail, but that's
a DNS issue, nothing to do with sendmail.
Maybe this helps, maybe it makes things as clear as mud ;-) Let me
know if you need more help, but be patient. I'm off work for the next
three weeks and will only be checking mail occasionally.
Cheers,
John
--
whois [EMAIL PROTECTED]
--
SLUG - Sydney Linux User Group Mailing List - http://slug.org.au/
More Info: http://slug.org.au/lists/listinfo/slug