[Raw Msg Headers][Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Anti spam methodologies (is it the new frontier?)




Matus Uhlar <uhlar@ccduck.ke.sanet.sk>
> -> What about not accepting mail unless it's for local delivery, for an
> -> approved non-local site, or from an approved (your local) domain?
> 
> This was discussed a while (week or two) here. But nobody (AFAIK) did it
> until now...

I do it, as a hack.  I'd like to do it in a cleaner way.

I use a smtpserver.conf much like this one except more complex:

	*troll.no		-
	*			t

This makes the smtpserver invoke server() (in server.cf) for most
incoming SMTP, and in that routine, I look at the destination (this is
abbreviated heavily):

	[ "$key" = to ] &&
		case $(recase -l $1) in
		*@*troll.no|*@nord.priv.no|*@*gulbrandsen.priv.no)
			;;
		*@*)
			echo "554 Relay SMTP not accepted for <$1>";
			return ;;
		esac

It's an evil hack, it starts up too many routers and you can get
around it by saying 'HELO ha-ha-ha.troll.no'. But it sort of does the
job.

I would like to do it in a cleaner way, and I think I know how (I
didn't sleep much the night before last, and this popped into my
mind).

The smtp server should set a new attribute on some incoming mail,
'relayable' or 'external' or whatever.  I've some code I use for a
different server; it matches the client address against a list of
address/length; the smtpserver could have a new option and a similar
list of mail sources whose mail should be relayed, and the smtp ta a
new option to defer the message unless the destination is on a similar
list.  Any expansion done locally (aliases, lists) should set the
attribute so the smtp ta won't defer.

Defer, rather than bounce, because one doesn't like to bounce mail
when one has forgotten to add a client to the file.

Am I off in the wilds again?

--Arnt