From owner-freebsd-hackers Sat Nov 15 16:21:05 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.7/8.8.7) id QAA06296 for hackers-outgoing; Sat, 15 Nov 1997 16:21:05 -0800 (PST) (envelope-from owner-freebsd-hackers) Received: from awfulhak.demon.co.uk (awfulhak.demon.co.uk [158.152.17.1]) by hub.freebsd.org (8.8.7/8.8.7) with ESMTP id QAA06291 for ; Sat, 15 Nov 1997 16:20:53 -0800 (PST) (envelope-from brian@awfulhak.org) Received: from gate.lan.awfulhak.org (localhost [127.0.0.1]) by awfulhak.demon.co.uk (8.8.7/8.8.7) with ESMTP id AAA22259 for ; Sun, 16 Nov 1997 00:10:14 GMT (envelope-from brian@gate.lan.awfulhak.org) Message-Id: <199711160010.AAA22259@awfulhak.demon.co.uk> X-Mailer: exmh version 2.0zeta 7/24/97 To: freebsd-hackers@FreeBSD.org Subject: /etc/mail filters in 2.2.5 Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Sun, 16 Nov 1997 00:10:14 +0000 From: Brian Somers Sender: owner-freebsd-hackers@FreeBSD.org X-Loop: FreeBSD.org Precedence: bulk Hi. I'm no sendmail expert, so perhaps someone with more of a clue than I do can tell me if I've got a pilot error. I installed the /etc/mail stuff a few days ago, and added a few sites to domains.txt, specifically: BIGFOOT.DALTEK.NET^M #blocked. contact postmaster I did a ``make install'' and HUP'd sendmail and checked the log to see that it had restarted. Just to confirm things, grepping for ``bigfoot.daltek.net'' in spamsites.db says it's there, and grepping for ``spamsites.db'' in /etc/sendmail.cf gives: Kspamsites hash -o -a.REJECT /etc/mail/spamsites.db I just received this: Nov 15 23:50:50 gate sendmail[21528]: XAA21528: from=, size=1874, class=0, pri=31874, nrcpts=1, msgid=<199711152014.OAA26126@merc ury.gmds.com>, proto=SMTP, relay=punt-1a.mail.demon.net [194.217.242.134] Shouldn't this have been rejected ? I've enclosed my complete .mc if anyone's interested. The second bit was directly copied from the stuff in /etc/mail. Thanks for any suggestions. -- Brian , , Don't _EVER_ lose your sense of humour.... VERSIONID(`gate.mc version 1.2') OSTYPE(bsd4.4)dnl FEATURE(nouucp)dnl MAILER(local)dnl MAILER(smtp)dnl define(`confQUEUE_FACTOR',1)dnl Cwgate.lan.awfulhak.org Cwawfulhak.demon.co.uk Cwawfulhak.org define(`confTO_QUEUEWARN',3d)dnl define(`confFORWARD_PATH', `/var/forward/$u:$z/.forward')dnl MASQUERADE_AS(`awfulhak.org')dnl FEATURE(allmasquerade)dnl FEATURE(masquerade_envelope)dnl FEATURE(nocanonify)dnl FEATURE(nodns)dnl Dmawfulhak.demon.co.uk define(`confDOMAIN_NAME',`awfulhak.demon.co.uk')dnl define(`confDELIVERY_MODE', `d')dnl # database declarations Kdenyip hash -o -a.REJECT /etc/mail/denyip.db Kspamsites hash -o -a.REJECT /etc/mail/spamsites.db # called with host.tld and IP address of connecting host. # ip address must NOT be in the "denyip" database Scheck_relay R$* $| [$+ $1 $| $2 should not be needed R$* $| $+] $1 $| $2 same (bat 2nd ed p510) R$* $| $* $: $1 $| $(denyip $2 $) R$* $| $*.REJECT $#error $: 521 blocked. contact postmaster@FreeBSD.ORG ($2) # host must *not* be in the "spamsites" database R$+.$+.$+ $| $* $2.$3 $| $4 R$+.$+ $| $* $: $(spamsites $1.$2 $) $| $3 R$*.REJECT $| $* $#error $: 521 blocked. contact postmaster@FreeBSD.ORG ($1) # Host must be resolvable, currently not used at hub.freebsd.org #R$* $| $* $: <$1 $| $2> $>3 foo@$1 #R <$*> $*<@$*.> $: $1 #R <$*> $*<@$*> $#error $: 451 Domain does not resolve ($1) # called with envelope sender, "Mail From: xxx", of SMTP conversation # Scheck_mail R$* $: $>3 $1 R $* < @ $+ . > $: $2 # R $* < @ $+ > $#error $: "451 Domain does not resolve" R $* < @ $+ > $: $2 R$+.$+.$+ $2.$3 R$* $: $(spamsites $1 $: OK $) ROK $@ OK R$+.REJECT $#error $: 521 $1 # for testing check_relay and check_mail # if we type "$|", sendmail will split this into two tokens "$" and "|" # this rule glues prevent sendmail from splitting "$|" # to use: /usr/sbin/sendmail -bt # host.domain.tld $| 111.222.333.444 Sxlat R$* $$| $* $: $1 $| $2 R$* $| $* $@ $>check_relay $1 $| $2