procmail
[Top] [All Lists]

Re: Procmail suggestion for ! recipe action

1995-12-18 20:58:35
I agree with this reasoning, but it sure would be nice if it was
easier to add Resent-* headers.  Right now you have to replace a
single '!' with something along the lines of
   | formail -b \
      -i"Resent-To: xxx" \
   | $(SENDMAIL) -t -oi xxx
I got so tired of doing that (and you probably want to add several
more headers as well, such as a 4-digit Resent-Date: and Errors-To:)
that I put it all into a shell script.

Huh?  How hard is it to do this:

    :0fh
    | formail -b -i"Resent-To: xxx"

    :0
    ! xxx

What you described above will work, but there is an elegance in brevity.

Also, how "tiring" can this be anyway?

If you mean "tiring" because you must type these "Resent-to"'s many,
many times, and you dislike typing a lot, then write a
{shell,Perl,whatever) to help you create recipes.

Or, write an adjunct procmail recipe, which you include with an
INCLUDERC assignment.  Something like this:

    ADDR=foo INCLUDERC=resent.rc
    ADDR=bar INCLUDERC=resent.rc
    ADDR=baz INCLUDERC=resent.rc

    DELIVERED=yes
    HOST=_all_done_

and in resent.rc substitute $ADDR appropriately, and, to send the mail,
be sure to use the "c" flag on the deliving recipe.

On the other hand, if you have a fixed number of cases, I'll be that you
could have typed in the recipes in less time than you spent typing these
mail discussions.  Now, I'll bet that these email discussions are
"tiring", also? :^)

If you mean "tiring" because it isn't as concise as an APL program, then
I have not much sympathy, even though I *like* APL (someone once called
it a "wrote-only language").

There is a limit to how useful conciseness is.  A program is also a form
of communication to other people, or even oneself at a later time, and
extreme conciseness becomes obfuscatory over time.  Kind of like
hieroglyphics.

So procmail itself isn't the right tool; doing it in formail is
straight-forward, although somewhat cumbersome.  Is there a better
alternative than my "resend-message" script?

Cumbersome?  Gee, what would be less cumbersome?  You have to type the
header at *some* point.

If you don't like typing the word "formail", then create a variable
called "F=formail", then you can write recipes like:

    :0fh
    |$F -i'Resent-To: xxx'

    :0
    !

That's about as concise as you can get without becoming like APL (even
then, it could be said that there's way to much hidden context in
procmail recipes).

Just playing devil's advocate.

Alan