Excluding Certain Recipients

Christopher Hicks chicks at CHICKS.NET
Mon Jan 7 17:46:30 GMT 2002


This has devolved almost beyond the point of being useful.  I'm probably
going to write something to do what I want within the next few months and
put the patch out there if somebody else doesn't beat me to it.  If
anybody is interesting in participating in building something like this,
plesae let me know directly.

On Mon, 7 Jan 2002, Nick Phillips wrote:
> On Mon, Jan 07, 2002 at 10:56:21AM -0500, Christopher Hicks wrote:
> > On Mon, 7 Jan 2002, Nick Phillips wrote:
> > > On Sun, Jan 06, 2002 at 03:44:11PM -0500, Christopher Hicks wrote:
> > > > I think there's an opportunity here for a more general feature.
> > > This could get ridiculously complex, couldn't it?
> > No. I think it would be much simpler.
> You're mistaken. Honest. Trust me [cheesey smile]...

Err, no.

> > $RecipCfg = {
> >         bob at domain.com => {
> >                 Scan => 'No',
> >         },
> >         tom at domain.com => {
> >                 Spam => 'Delete',
> >         },
> >         kim at domain.com => {
> >                 # gets lots of virus, lets be insanely thorough
> >                 SpamScanners => [innoculate,fprot,sophos],
> >         },
> > };
>
> Users don't write perl.

The point was to show the concept.  Making a user-readable config file
could be even simpler.

> > How would you express that in sendmail.cf?
>
> I don't use sendmail. OK, so that's a cheat's answer, but I'd put something
> like this:
>
> if ("${if exists {/home/$sender_address_local_part/.nospam} {1}{0}}" is "1")
>   and $h_X-MailScanner-Spam: contains "spamassassin"
> then
>   fail text "This looks like spam to me..."
> endif
>
> in my Exim system filter.

That isn't even a cheat answer, it's a non-answer.

> > > Wouldn't it be better to use some kind of filter in the MTA config
> > > after it's passed through mailscanner?
> >
> > Better?  Not noticably.
>
> Better: the complexity is kept in one place (the MTA), which has had
> years of practice to get it right. MTAs have historically been
> insecure because they are complex. Speaking for myself, I don't want
> mailscanner to get more complex than it has to be, because that *will*
> introduce bugs.

Ah, but the complexity isn't kept in one place, it's kept in many.  Many
of us run a variety of MTA's.  I run sendmail for user-level stuff and
backup MX's, and qmail for ezmlm.  All three contexts make mailscanner
relevant and all of them may need to be customized based on the recipient.
Maintaining what is essentially the customization of mailscanner within
mailscanner makes much more sense than making a gazillion different MTA's
do it.

> Better: one less thing for an admin to learn; an admin will almost
> certainly have to learn how to do things like delivery dependent on
> header matching with their MTA/MDA combination anyway, so why make
> them learn how to do it with mailscanner too?

Because the issue exists beyond that.  Everything mailscanner does can't
be simplified to a header-based filter.  You're trying to use a saw when
you need a hammer.

> Better: less bloat.

Precisely what I'm looking for.

> >  Easier?  Certainly not.  I like sendmail, but I
> > wouldn't want to have to force it to do this sort of thing.  For one
> > thing, I like the same sendmail.cf being usable for the incoming and
> > outgoing queues.  That wouldn't work if it the outgoing queue had to
> > enable various filters.  But even more importantly, given the choice
> > between making sendmail filter or adding the functionality into
> > mailscanner myself, I'd much rather write perl.  And that way, once I
> > add mailscanner to my qmail boxes I don't have to worry about dorking with
> > qmail to get it to do what I want either.
>
> Easier: one less thing to learn, as above.

I know perl, sendmail, and qmail.  But I know perl a heck of a lot better
and it integrates with everything else we're using and going to use for
the forseeable future.

> Easier: yes you could still use the same sendmail config.

You haven't shown how to do the issues in question in sendmail and it is
quite easy to conceive of situations where it can't be done by the MTA at
all.

> Easier: no perl coding to do.

Take 100 admins who can code perl as well as Randal and sendmail as well
as Eric Allman and most would prefer to code in perl!  I suspect Eric
would fall in that category himself.

> Easier: you only have to maintain filtering in one place.

(A) This isn't simply filtering.  (B) Maintaining it in one place (within
mailscanner) is the whole point.

> Easier: easier to configure mailscanner "correctly" (so as not to let
> bad things happen when/where they shouldn't).

If you don't add user-specific configs, nothing changes.  It's like pine.
The feature isn't there unless you choose to go turn it on.  No harm done.

> Seriously, if sendmail (or procmail) scares you to the point that you
> don't like the idea of making it filter based on a header, you
> shouldn't be using it - find something you can understand and make
> behave as desired.

sendmail doesn't scare me.  I do understand it.  I like it even.  I've
played with the sendmail.cf calculator and all.  But sendmail is poor at a
variety of things and ghastly at others.  sendmail makes a very poor tool
with which to configure mailscanner, for instance.

> > > I'd rather not see too much duplicated complexity between mailscanner
> > > and MTAs - especially with MTAs' histories of getting it wrong.
> >
> > Broke MTA's would seem to make doing it right once much more sensible. :)
>
> To butcher several quotes:
> "Those that do not learn from history are condemned to repeat it, badly"
>
> Complexity == bad.

Precisely.  Trying to configure mailscanner via the MTA is complex and
will only get more complex as people try to do more interesting things.

> Every time we make it possible to misconfigure mailscanner in such a
> way as to do Bad Things, we condemn some poor sod to lose mail/get
> viruses/whatever in exactly that way. Murphy's Law.

If a recipient doesn't have anything specifically configured for them,
they get the defaults.  There's little harm done.

--
</chris>

Neither sweat, nor blood, nor frustration, or lousy manuals
nor missing parts, or wrong parts shall keep me from my task.



More information about the MailScanner mailing list