Usually the
sendmail.cf
file should be built from a
.mc
file
with help of the
m4
macro language processor
.
Use the supplied
HACKs
or
put the rules
(e.g.,
check_mail
or
check_rcpt
)
as given into the .mc file.
Make sure that you have the
LOCAL_CONFIG
and
LOCAL_RULESETS
in front of the respective sections,
otherwise there will be some problems!
.mc
file using the
HACKs
directly could look like this:
include(`../m4/cf.m4') VERSIONID(`@(#)solaris2.mc 8.1 (Berkeley) 6/7/93') OSTYPE(solaris2)dnl DOMAIN(generic)dnl MAILER(local)dnl MAILER(smtp)dnl define(`_IP_LOOKUP_',`1') define(`_DNSVALID_',`1') HACK(use_ip,`/etc/mail/LocalIP') HACK(use_relayto) HACK(check_mail3) HACK(check_rcpt4)
.mc
file using
check_mail
or
check_rcpt
could look like this:
include(`../m4/cf.m4') VERSIONID(`@(#)solaris2.mc 8.1 (Berkeley) 6/7/93') OSTYPE(solaris2)dnl DOMAIN(generic)dnl MAILER(local)dnl MAILER(smtp)dnl LOCAL_CONFIG Kjunk dbm /etc/mail/junk F{LocalIP} /etc/mail/LocalIP F{RelayTo} /etc/mail/relayto LOCAL_RULESETS # check for junk domain/spammers Sjunk # .... Scheck_mail # .... Scheck_rcpt # ....However, this isn't recommended, since only the .m4 files from the distribution are kept up-to-date.
If you want to modify your
sendmail.cf
directly,
put the file references
(e.g.,
F{LocalIP} /etc/mail/LocalIP
)
or map definitions
(e.g.,
Kjunk dbm /etc/mail/junk
)
at the end of the local info section
################## # local info # ##################but before the version number
# Configuration version number DZ8.8.8The exact place doesn't matter that much, but make sure you can find it again. Next, put the new rulesets behind
S98
in
sendmail.cf
So your
sendmail.cf
may now look like this:
################## # local info # ################## Cwlocalhost # file containing names of hosts for which we receive email Fw/etc/sendmail.cw # put the new definitions here, e.g., F{LocalIP} /etc/mail/LocalIP # Configuration version number DZ8.8.8 ############### # Options # ###############and:
################################################################### ### Ruleset 98 -- local part of ruleset zero (can be null) ### ################################################################### S98 # your local additions and thereafter # for example: Scheck_rcpt # make sure you have TABs here, not BLANKs! sendmail will complain otherwise... # first: get client addr R$+ $: $(dequote "" $&{client_addr} $) $| $1 # etc.....