>>Чтоб вышеуказанные правила работали тоже нужно писать правила.
>>Вот была такая статья http://www.linux.org.ru/profile/_white/books/sendmail-firewall.html
>
>в этой статье автор пишет файрволльные правила "в хвост sendmail.mc", но по
>синтаксису все эти правила похожи на содержимое файла sendmail.cf. Может в
>статье опечатка?
sendmail.mc - это файл в специальном формате и обрабатывается впоследствии
препроцессором m4 (утилита такая), после обработки и создается файл
конфигурации sendmail.cf. Собственные правила пишутся и помещаются в
sendmail.mc в самом низу:
------------------------- sendmail.mc-порядок ----------------------
divert(-1)
примечание
divert(0) (окончание необрабатываемой части)
VERSIONID
OSTYPE
DOMAIN
dnl - это комментарий
FEATURE
dnl комментарий
local macro definitions
MAILER
LOCAL_CONFIG
LOCAL_RULE_*
LOCAL_RULESETS
-----------------------------------------------------------------------
-------------------------- sendmail.mc-пример -------------------------
divert(-1)
include(`/usr/share/sendmail/m4/cf.m4')
#
# Sendmail 8.xx.x configuration file for domain.su
#
divert(0)dnl
VERSIONID(`JINR: sunct0.mc lavr+vvm')
OSTYPE(openbsd)
dnl - это комментарий
FEATURE(relay_entire_domain)
FEATURE(always_add_domain)
FEATURE(access_db)
FEATURE(mailertable)
FEATURE(virtusertable)
dnl Use local-host-names instead sendmail.cw
FEATURE(`use_cw_file')
dnl LAVR - use blacklist for lock user via access.db
FEATURE(blacklist_recipients)dnl
FEATURE(notsticky)dnl
FEATURE(nouucp,reject)
FEATURE(`delay_checks')
dnl - используем внешние free антиспам базы
FEATURE(`dnsbl', `relays.ordb.org', `Spam bloked - see http://ordb.org/')dnl
FEATURE(dnsbl,`list.dsbl.org', `Spam bloked - see http://dsbl.org/')dnl
FEATURE(dnsbl,`bl.spamcop.net', `Spam blocked - see http://spamcop.net/bl.shtml? $&{client_addr}')dnl
FEATURE(dnsbl,`ex.dnsbl.org', `Spam bloked - see http://www.dnsbl.org/')dnl
MASQUERADE_AS(`domain.ru')dnl
FEATURE(`masquerade_envelope')dnl
FEATURE(`no_default_msa')
define(`confSMTP_LOGIN_MSG',`JINR-Net Antispam-MTA; "Non-authorized relaying DENIED." ')
define(`confPRIVACY_FLAGS',`authwarnings,noexpn,novrfy,nobodyreturn,noetrn,needmailhelo')dnl
define(`confNO_RCPT_ACTION', `add-to-undisclosed')dnl
define(`confMAX_MIME_HEADER_LENGTH', `256/128')dnl
define(`confEIGHT_BIT_HANDLING', `pass8')
define(`confMAX_MESSAGE_SIZE', `2000000')
define(`confMAX_RCPTS_PER_MESSAGE', `10')
define(`confMAX_HOP', `30')dnl
dnl Drop double bounce error message
define(`confDOUBLE_BOUNCE_ADDRESS', `')dnl
dnl Wait a day before sending mail about deferred messages
define(`confTO_QUEUEWARN', `1d')dnl
dnl Wait 5 days before giving up and bouncing the message
define(`confTO_QUEUERETURN', `5d')dnl
dnl Some overloaded issues
define(`confQUEUE_LA', `3')
define(`confREFUSE_LA', `5')
define(`confMAX_DAEMON_CHILDREN', `10')
define(`confCONNECTION_RATE_THROTTLE', `2')
dnl HACK(require_rdns)dnl
MAILER(local)dnl
MAILER(smtp)dnl
dnl конфигурация для локальных правил
LOCAL_CONFIG
#
# Regular expression to reject:
# * numeric-only localparts from aol.com and msn.com
# * localparts starting with a digit from juno.com
# * localparts longer than 20 characters from aol.com
#
#--lavr, add some other *dialup*.com/net and etc below
Kcheckaddress regex -a@MATCH
^([0-9]+<@(aol|msn)\.com|[0-9][^<]*<@juno\.com|.{20}[^<]+<@aol\.com)\.?>
#
# Names that won't be allowed in a To: line (local-part and domains)
#
#--lavr, add below something you needs
C{RejectToLocalparts} friend you user gluck
C{RejectToDomains} public.com the-internet.com
dnl сами локальные правила
LOCAL_RULESETS
#
# Header checks
#
HTo: $>CheckTo
HMessage-Id: $>CheckMessageId
HSubject: $>Check_Subject
HX-Spanska: $>Spanska
#
# Melissa worm detection (done in Check_Subject)
# See http://www.cert.org/advisories/CA-99-04-Melissa-Macro-Virus.html
#
D{MPat}Important Message From
D{MMsg}This message may contain the Melissa virus; see http://www.cert.org/advisories/CA-99-04-Melissa-Macro-Virus.html
#
# ILOVEYOU worm detection (done in Check_Subject)
# See http://www.datafellows.com/v-descs/love.htm
#
D{ILPat}ILOVEYOU
D{ILMsg}This message may contain the ILOVEYOU virus; see http://www.datafellows.com/v-descs/love.htm
#
# Reject some mail based on To: header
#
SCheckTo
R$={RejectToLocalparts}@$* $#error $: "553 Header error"
R$*@$={RejectToDomains} $#error $: "553 Header error"
#
# Enforce valid Message-Id to help stop spammers
#
SCheckMessageId
R< $+ @ $+ > $@ OK
R$* $#error $: 553 Header Error
#
# Happy99 worm detection
#
SSpanska
R$* $#error $: "553 Your system is probably infected by the Happy99 worm; see http://www.symantec.com/avcenter/venc/data/happy99.worm.html"
#
# Check Subject line for worm/virus telltales
#
SCheck_Subject
R${MPat} $* $#error $: 553 ${MMsg}
RRe: ${MPat} $* $#error $: 553 ${MMsg}
R${ILPat} $#error $: 553 ${ILMsg}
RRe: ${ILPat} $#error $: 553 ${ILMsg}
-------------------------------------------------------------------------