procmail
[Top] [All Lists]

Re: How do I match from a tedt file?

2002-08-12 21:25:20
In addition, if indeed which does use the parent's path (most do), it will
find fgrep.  Well, procmail is that parent, so it too would have found
fgrep.  So you have done absolutely nothing but use valuable cycles.

Luke

On Mon, 12 Aug 2002, Philip Guenther wrote:

"Dr. David Kirkby" <davek(_at_)medphys(_dot_)ucl(_dot_)ac(_dot_)uk> writes:
Mike Jackson wrote:
FGREP=`which fgrep`
...

Mike: using full paths for programs is premature optimization.  The time
taken to find fgrep in PATH is trivial compared to the time taken by
fgrep itself.  Secondly, 'which' is a user-presentation tool and may
output something other than a full path; some versions don't even use
the PATH value they got from their parent.  If you want to run fgrep,
just type "fgrep".  Really, it's the best choice.


:0E
* ? (echo "$FROM" | $FGREP -i -f $HOME/ok)
{
        LOG="OK "
        :0
        $MAILDIR/ok
}

The parens aren't needed and you probably want to put a newline at the
end of the logged text:
      :0 E
      * ? ( echo "$FROM"  | fgrep -i -f $HOME/ok
      {
              LOG = "OK
"
              :0
              $MAILDIR/ok
      }


That almost worked. The only two problems are:

1) It keeps giving the message 'wordlist too large' whenever the list of 
names
in the file exceeds 315 or so. Putting WORDLIST= 8000, 16000 or 200000 does 
not
seem to change this behaviour at all. This seems to be a procmail problem, as
fgrep has no problems with a file of this length.

"wordlist too large" is not an error that procmail generates.  Ergo,
it's not a procmail problem.  I would bet it's an fgrep limitation; try
      strings `which fgrep` | grep wordlist

Oh, and do that on the machine where your mail is received, if that's
not your normal machine.

<pause>

I just checked a Solaris 2.7 box and its fgrep will generate that error
message.

Solutions include breaking up the word list into multiple files and
invocations of fgrep (blech) or installing GNU grep on the mail server.



2) It does match on people with longer email addresses, than those in
white.list.  Hence if fred(_at_)sun(_dot_)com is in my white.list, so 
fredsmith(_at_)sun(_dot_)com
would be accepted too. This is not such a hassle.

I think you mean that if fred(_at_)sun(_dot_)com is in your white.list, then
anotherfred(_at_)sun(_dot_)com will also be accepted because it also contains
"fred(_at_)sun(_dot_)com".  The solution for that is to give fgrep the -x 
flag,
so that it has to (effectively) match the entire input.


Philip Guenther
_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail


_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail