procmail
[Top] [All Lists]

Re: How to Reply to All?

2006-06-22 16:35:22
Dallman Ross wrote:
On Thu, Jun 22, 2006 at 11:57:46PM +0200, Dallman Ross wrote:
  
    REPLYCC = `formail -zx To: -zx Cc:`

But you will have a multiline result in REPLYCC now.  To get it
on one line, you could do this:

    REPLYCC = `formail -zx To: -zx Cc: | xargs`
    

Actually, it turns out this doesn't matter.  The 
recipe:

  
   :0 h
   | formail -r -I "Cc: $REPLYCC" | ...
    

Works the same with or without bothering with xargs or
another trick to get REPLYCC to be all on one line.

I did have my suspicions about that, because even if formail left the 
Cc: line folded, that is acceptable as per rfc822/2822. et al.

Thanks for warning me about the other things in my recipes... I'm still 
a little fuzzy on exactly when certain flags are required. i.e. the w 
flag. I think it's just a matter of whether the result is needed in a 
subsequent step... if so, you have to wait...

Anyway... not a procmail/formail issue now, but I have to get a comma 
between the To: values and the Cc: values in REPLYCC. I'm also a little 
fuzzy on exactly how/when to use a pipe and when not to.

i.e. you mentioned

REPLYCC = `formail -zx To: -zx Cc:`

is better than

REPLYCC=| formail -zx "To:" -zx "Cc:"
due to a potential bug...

I assume you mean REPLYCC=`formail...`   (no space before = as per your earlier 
message)
but also, I read the pipe character as being the "current message being 
processed"... makes sense.. that gets piped to stdin of formail.... (or 
whatever the first program after the | )

But what about REPLYCC=`formail ...` what does formail see on stdin in that 
case? I expect it would see end-of-file. i.e. no input...

But,if that is not that case... procmail must be taking the "current message" 
and piping it to the shell so `formail...` still sees the same message on stdin.

I also gather that 
REPLYCC=| ... must be an action line, after a : line (with or without 
conditions), while
REPLYCC=`formail...` must NOT be an action line, otherwise I end with the 
message being delivered to a mailbox called REPLYCC=...

So, as a rule of thumb.... if I have a construct like
:0 h
SOME_VAR=|something...

it is better to simply omit the : line altogether and code
SOME_VAR=`something...`

Is that right?

Thanks.... :-)



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