procmail
[Top] [All Lists]

Re: How to Reply to All?

2006-06-22 15:20:17
On Thu, Jun 22, 2006 at 02:00:38PM -0700, Don Russell wrote:

I'm trying to modify a small recipe to reply to all, instead of
only the sender.

The formail -r flag does the trick to reply to the sender, but
excludes anybody on the To: or Cc: lists and so on. I don't see
any modifier, or additional flag to "reply to all" but thought I
could fake it like this...

:0 h
REPLYCC =| formail -tcx "To:" -tcx "Cc:"

Well, that line doesn't work.

The problem is, that syntax doesn't work with a space between
the var and the equals sign.

You can test this by logging the value of $REPLYCC afterward.

    LOG = "$REPLYCC"

comes up empty with your above recipe.  If I take the action
line and remove the space before the equals sign, however,
it works.

I should add that the -t switch is meaningless here.  You are
extracting specific headers, and you're not doing "r" here anyway.
The -c switch also doesn't help here, I don't think.  So forget it.
I will make a further note below about fixing the line breakx, though.

One thing to be aware of is that there is a nasty bug in many
versions of procmail to do with this syntax, in any case.
It tends to destroy memory unpredictably.  It won't work at
all on some builds.  Unless your procmail is patched, you
should avoid it and use the alternate syntax:

    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`


:0 fwh
| (formail -r -I "Cc: ${REPLYCC}") | ${SENDMAIL} ...


Again, your syntax is "soupy" here.  You don't want a filtering
recipe.  You're not changing the message for feeding back into
the stream.

You also don't need the parentheses, but that's unimportant.

If I use

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

it works fine.

I will note that you didn't use the -t switch on the
"formail -r", though, and I suspect you probably wanted to.
E.g., try both versions on the message of yours to the procmail
list.  Here, from teh command line:


   11:53pm [~/Mail] 919[64]> formail -rt < don
  To: don(_at_)drussell(_dot_)dnsalias(_dot_)com
  Subject: Re: How to Reply to All?
  References: <449B04F6(_dot_)1070102(_at_)drussell(_dot_)dnsalias(_dot_)com>
  In-Reply-To: <449B04F6(_dot_)1070102(_at_)drussell(_dot_)dnsalias(_dot_)com>
  
  
   11:53pm [~/Mail] 920[0]> formail -r < don 
  To: procmail-bounces(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
  Subject: Re: How to Reply to All?
  References: <449B04F6(_dot_)1070102(_at_)drussell(_dot_)dnsalias(_dot_)com>
  In-Reply-To: <449B04F6(_dot_)1070102(_at_)drussell(_dot_)dnsalias(_dot_)com>
  

See the "To:" header difference?

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>