Spam filter on a user-by-user basis...

Spam filter on a user-by-user basis...

Post by Edward S. Marsha » Thu, 11 Sep 1997 04:00:00

This has probably come up before and I just missed it, but anyway.

I'm trying to find out if anyone has done any hacks to allow
users to filter on the basis of where the user is from, and what they
specified with "MAIL FROM:". Yes, some of this could be done with procmail;
no, I don't think that it's an ideal solution for most people.

Essentially, what I'm envisioning is a hook in check_rcpt which checks a
list of denied IP blocks for the user being delivered to (if possible), and
a list of denied "MAIL FROM:" lines. Obviously, check_mail is too early for
this, since we don't know who's being delivered to yet.

Ideally, what I'd have would be an individual pair of files for each user
(let's call them .sendmail-denied-ip and .sendmail-denied-mail). The user
would simple have a listing of IP addresses in .sendmail-denied-ip, and
a list of denied "MAIL FROM:" fuzzy matches in .sendmail-denied-mail. An
extension that would be useful would be a .sendmail-denied-hosts as well,
for filtering based on domain, or possibly merge -ip and -hosts into one

Alternatively, a global file which associates a mailbox with a set of
filtering patterns would work; the glue code to get individual users'
patterns into that would be fairly trivial to write.

Has anyone else done something like this? If not, does the above sound like
a reasonable approach to take? Suggestions welcome. :-)

                   ------------------------------------------------------------            /      XNet Information Systems, Inc.
[  Are you a spammer looking for a great opportunity to be blacklisted? Then  ]


1. Filtering On A Per-User Basis Via Aliases

I have a program I wrote for filtering inbound email on mailing list.
I just put it at the beginning of a pipeline in the
mail alias for the list:

mylist: "|/local/bin/myfilter |/usr/local/majordomo/wrapper resend -l mylist ...

This works fine because the wrapper to which the output is piped knows
how to do remailing.  However, I would also like to do this sort of thing
for selected individual _users_ on the system (FreeBSD). i.e. I want to
be able to apply the filter to a given user's inbound email before
handing it off for delivery. I'm not clear on the alias syntax I need
for this:

myuser: "|/local/bin/myfilter | ... BUT WHAT GOES HERE???

IOW, how to I remail the output of 'myfilter' so it gets delivered
to the 'myuser' account on that machine?


PGP Key:

2. Contract Opportunity: "ASP.Net Developer" in Chicago or NYC or Charlotte -- Immediate Interviews


4. How do I erase a tape with Backup-Restore util under IRIX5.3?

5. SPAM Filtering Services - Business, ISPs and Internet Users

6. SRC Code required for wave files to a ADSP2181

7. how to filter an spam mail sending to our users in sendmail v 8.9.3

8. ICQ for Pilot Coming Soon!

9. filtering/screening outgoing messages for a specific user/users

10. Per user inbound spam filtering, sendmail or procmail

11. spam filter at smtp time for offline debian users

12. Simple spam filter -- checking host and user

13. SPAM Filters for SPECIFIC users