[Esa-l]outgoing mail

herrold herrold at owlriver.com
Wed Aug 8 07:50:43 PDT 2001


> Just wondering if the posts regarding filtering outgoing mail
> are in the works or not.

I was working on this yesterday and last night, working through the
sendmail docs, and came across a presentation from the BSD folks at
the recent O'Reilly Open Source conference last month.

(Truth be told, I was also working inbound, and outbound spam and
virus reduction recipies as well.)

It appears that the 'hooks' exist in sendmail's Milter function --
all that seems to be left is tweaking the called filter program, and
.procmailrc file

(commentary below quote)

-- Russ Herrold

--------------

From: http://www.brettglass.com/spam/paper.html

sendmail Mail Filter ("Milter") API

Because drafting rules for sendmail itself is difficult, a
better option if one wishes to do much filtering in sendmail
is to use the sendmail mail filter, or "Milter," API. Filters
can be written in any language and can examine and edit
message bodies as well as headers.

sendmail communicates with the filter process via sockets,
allowing the filter to run on a different host if desired. The
filter process is persistent and can therefore watch for
patterns in message traffic.

sendmail can be instructed to pass messages through filters
via commands such as

INPUT_MAIL_FILTER(`archive', `S=local:/var/run/archivesock,
	F=R')dnl
INPUT_MAIL_FILTER(`spamcheck', `S=inet:2525 at localhost,
	F=T')dnl

in the .mc file. For documentation of the INPUT_MAIL_FILTER
macro, see /libmilter/README in the most recent sendmail
distribution.

===============================================
Comment by RPH

That first it would run through:

INPUT_MAIL_FILTER(`archive', `S=local:/var/run/archivesock,
        F=R')dnl

... seems like it could have a wrapper to feed the socket to
procmail with a custom procmailrc file -- with just a recipe,
acting as a copying filter:

:0 wc
	! outlogger

(where outlogger is a uid.)

Anti-loop logic is probably in order as well.

-- Russ



More information about the esd-l mailing list