On Sun, Dec 12, 2004 at 02:49:07PM -0800, Professional Software
Engineering wrote:
At 22:53 2004-12-12 +0100, Dallman Ross wrote:
Comments?
'S fine. (Or use vsnag and set VS_SPAMMY in the myvars file to put
the ones of these that don't have nasty attachments in your spam folder.)
:-)
What logic are you using in VSnag to identify the local host? Or is it
manual config, as I have in my script?
Well, first, the host domain is parsed from $HOST in procmail
using a bit of code that attempts to strip (does a pretty good job at
stripping) down things like
somehost.somedomain.[a-z]{2,3}[^.]
somehost.somedomain.co.uk
and so on to what I call the "stub" ("somedomain").
It works well, but there naturally could be some odd cases
where it wouldn't work right, in which case the user is
encouraged to override with a manual entry in the myvars file.
Btw, one can run the point-n-shoot shell script that comes with the
vsnag package to see what vsnag would do were it installed (with a
default myvars file, though one can also customize the file and try
that with the script as well). One can, further, grep the output for
specific things.
6:14pm [~/Mail] 622[0]> vsnag.point-n-shoot.sh SPAMPLE | egrep '
(MYDOMAIN.*|HOST):'
* HOST: panix5.panix.com
* MYDOMAIN_IP: ()166\.84\.1\.([01]?[0-9]?[0-9]|2[0-4][0-9]|25[0-5])
* MYDOMAINSTUB: panix
(The partial output shown gets printed by a diagnostics INCLUDERC file
that one can also run standalone.)
The local IP address is an educated guess done all in procmail based
on how most mail servers are configured. That is more likely to
be a wrong guess than is the "stub"; but, again, the user is
encouraged to try it out and put an entry (can be a regex) manually
in the myvars file if we couldn't guess right on our own. The
last octet is stripped away on purpose and replaced with a regex,
because many systems run local networks with the mail server on one
node and the shell host on a different one. If the guessed-at
MYDOMAIN_IP is wrong for a given system, the answer is to just
put the desired value(s) in myvars. I could of course shell out
and check with Unix commands, but I don't want to run any shells
in vsnag in the usual case.
The vsnag code also considers private IP address space and
localhost when it looks -- not dissimilar to what I noticed in
your script.
--
dman
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail