procmail
[Top] [All Lists]

Re: formail options

1998-05-04 23:39:07
At 05:26 PM 5/4/98 -0700, Dave Robbins wrote:

FROM=`formail -rzxTo:`        

Well, why do we need an auto-reply header?  We're just trying to
get the From-space address, right?

Because there is a hierarchy to the reply, and in fact, the from-space
isn't near the top of that heirarchy.  Reply-To:, From:, Sender:, etc are
evaluated for replies (I list them in no specific order here, I'm just
dumping).

So, using this formail option allows you to ask formail to do the
evaluation and simply return what is appropriate, rather than YOU having to
do a bunch of unweildy comparisons.


    -z    Ensure a space exists between field name and  content.

Hmmm.  Well, that seem too useful for what we're doing and it sure
doesn't teach me much and since I know a dozen programming languages 
(or so I did), I must must be too dense.

"From:newuser"
vs:
"From: newuser"
vs:
"From: "
vs:
"From: newuser  "

The first example isn't proper - no space between the field and content
(though, I believe according to RFC822, this is legal - just not convenient
to the rest of the world).  The second example is how you'd want it to be,
the third example should be removed (no data in the field), and the last
example has trailing whitespace which is a waste in the mailsystem since it
doesn't DO anything - so the extra whitespace should be trimmed.

The -z option is more than likely NOT used in the recipe because it is
NEEDED, but rather because it is a GOOD IDEA.

    -x headerfield

What?  The To-colon line?  Correct me if I'm wrong but I thought 
we were trying to get the From-space line.

Formail is outputting a REPLY header, from which you are extracting the TO.
 It may help to think of it like hitting reply in your mail client and then
taking the TO: field from there.

For an example, note the From: and From addresses on *THIS* message you're
reading (From: is ME, and From is the LIST MAILER where YOU got the copy
from), and then choose REPLY in your client and note that the message isn't
replied to ME (if your client is standards conformant), but instead to the
LIST -- which isn't a function of the From, but the Reply-To:

Formail with the given options is handling this logic for you.

---
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

 Sean B. Straw / Professional Software Engineering
 Post Box 2395 / San Rafael, CA  94912-2395

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