procmail
[Top] [All Lists]

Re: Procmail is over-matching my expression

2005-02-25 13:29:07
* Ruud H.G. van Tol <rvtol(_at_)isolution(_dot_)nl> [2005-02-25 08:54]:

  MAILDIR=./

As Sean said, put an absolute path in there. And MAILDIR 
should never (for most kinds of never) end in a slash.
When testing, a value of just a dot is fine.

  DEFAULT=$MAILDIR/not_from_self

   DEFAULT = "$MAILDIR/not_from_self"

(and change MAILDIR, because DEFAULT now contains a '//')

I'm in the habit of defining paths to end in a slash whenever I code
anything, because I recall cases (in other languages) where absense of
that ending slash created problems by causing the string to be treated
as a regular file.. so I normally append the slash as a safe
practice.  

The double slash isn't a problem, because all shells I've ever used
treat multiple embedded slashes as a single slash - probably to handle
this case.  ie. so 'ls /usr////local' is the same as 'ls /usr/local'.

The name FROM_ is 'reserved' by a lot of procmail-coders 
to hold (the value from) the From_line. Allways name variables 
holding regexes in a special way.

I realize now where I got that definition from - Martin McCarthy's
Procmail Companion.  He has a cookbook and on page 209 uses that
definition:

  FROM_ = "(From[ ]|(Old-|X-)?\
  (Resent-)?(From|Reply-To|Sender):(.*\<)?)"

I took it as gospel, but you folks seem to be correct that the (.*\<)?
causes it to span multiple lines.  If FROM_ is really a reserved
variable, I'm surprised it didn't cause me problems to use it.

As always, I appreciate all your tips (and Sean's).  I always learn
more than I expect from this list.

____________________________________________________________
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