Simple Mail Example
This is a simple mail server configuration for a host that
does no hosting, but wants to control access and use
of email.
divert(-1)
### Definitions for sendmail
###
divert(0)
Set the version number for the .cf file
VERSIONID(`@(#)little.biz.mc 8.10 (Berkeley)5/19/1998')
Set the operating system type and cause it to read ../ostype/linux.m4.
OSTYPE(`linux')
Set the domain to generic and cause it to read ../domain/generic.m4. This
sets the redirect, forward_path and use_cw_file options (typically).
DOMAIN(`generic')
Automatically rebuild the aliases file if necessary.
define(`confAUTO_REBUILD',`1m')
Define the connect time out period.
define(`confTO_CONNECT',`1m')
Undefine some unnecessary things.
undefine (`UUCP_RELAY')
undefine (`BITNET_RELAY')
We want even local mail to show the correct domain.
FEATURE (always_add_domain)
Use the sendmail restricted shell for mailing to programs and use
mail.local since it should be a better mailer.
FEATURE(`smrsh',`/usr/sbin/smrsh')
FEATURE(`local_lmtp',`/usr/bin/mail.local')
We will redirect to addresses listed in the access database with a
RELAY flag. Also, we will reject any mail addresses to
address.REDIRECT wht 551 user not local; please try .
FEATURE(redirect)
Which mailers are allowed to send send/receive mail.
MAILER(local)
MAILER(smtp)
The /etc/mail/aliases File
The aliases file can be used to set up mailing lists and to perform some
of the functions that are performed by the virtusertable.
root: root,admin,smith
webmaster: admin,smith,wwwuser
shipping: mickj,janisj,georgeh
mgmt: petert,randyb,felixc,petern
acctng: dennyy,maryannef
johnl: john@stereo.com
production: :include:/etc/mail/lists/production
The /etc/mail/access File
The access file is used to limit access to the sendmail capabilities. In this
case, there are some domains that we don't want to accept mail from as well
as some specific users.
sleazy.com REJECT
202.36.4 REJECT
sales@ DISCARD
bob@usedcars.com ERROR:550 I don't want to buy a car