procmail
[Top] [All Lists]

RE: Help with multi-line matching.

2007-06-07 13:54:54
LuKreme wrote Thursday, June 07, 2007 10:23 PM:


On 7-Jun-2007, at 08:20, Ray Van Dolson wrote:

On Thu, Jun 07, 2007 at 10:00:37AM +0200, Ruud H.G. van Tol wrote:

${MAILDIR}.fedora-devel-list/

No need to use MAILDIR there, but if you do, then put
a slash after it.  (So don't put a slash at the end of
$MAILDIR itself.)

Not sure I follow.  I use the slash so procmail will deliver the 
message to a Maildir/ style folder instead of mbox.

he means do

${MAILDIR}/.fedora-devel-list/

or

.fedora-devel-list/

and define MAILDIR like

MAILDIR=/home/user/Mail

and NOT

MAILDIR=/home/user/Mail/

Yes.  And he's implying that the first one isn't necessary
anyway:

        ${MAILDIR}/.fedora-devel-list/

will essentially always be equivalent to

        .fedora-devel-list/

but with the detraction that the one with $MAILDIR in it
obscures that fact.  As he stated, setting MAILDIR in
procmail (which has nothing to do with the maildir+
server functionality; it's an unhappy coincidence of naming,
and procmail had it first!) also changes the working directory
to that location.

Here are analogous shell statements that show the redundancy
in functionality:

   prompt% pwd
   /users/home/foo

   prompt% cd bar
   prompt% sort file > /users/home/foo/bar/sorted-file

See, we're already *in* foo.  So why type the full path
back to the same relative location?  It would have worked
just as well to type, in the last statement:

   prompt% sort file > sorted-file


Another example:

   prompt% pwd
   /users/home/foo

   prompt cd bar
   prompt% find /users/home/foo/bar -type f -print

Well, again, duh.  It's equivalent to typing just

   prompt% find . -type f -print

so in most cases that's the easier, cleaner, clearer, and better
way to do it.

I can think of a couple of exceptions, but they are mostly
constructed in order to be exceptions.  They won't apply to
what the OP is doing.

Okay, so you want to know what one exception might be?
Suppose he uses the shell to chdir instead of setting MAILDIR.

  :0 hi w
  | ( chdir bar; cp oldmsg "$MAILDIR"/oldmsg.copy )

Well, now the working dir is not the same as MAILDIR.
But almost nobody's going to do something that way, and for
those who might, they know what they're doing wrt relative
and absolute paths anyway.  I.e., this won't bite them.

For the rest of us, it's better not to confuse oneself
needlessly with a statement of a var that adds no new
functionality to our action.

Dallman
____________________________________________________________
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

<Prev in Thread] Current Thread [Next in Thread>