procmail
[Top] [All Lists]

Re: Simple Mailing List

1997-07-11 13:16:00
On Fri, 11 Jul 1997 13:26:04 -0400 (EDT),
"Alan V. Shackelford" <alan_s(_at_)shaknet(_dot_)clark(_dot_)net> wrote:
Era was kind enough to recommend the following rc entry to remail messages
to members of a list:
  :0
  * ^Subject:.*something unique here
  ! `cat file-of-recipients`
. I get the following error message when I post to the list:
   "Excess input quenched from 'cat' "

Most likely the shell you use has problems with what it regards as
"overlong" command lines. (I'm only guessing, though; I've never had
the misfortune to use a machine which didn't permit at least 64k of
command line and even so I generally avoid backticks when I can.) 
You could revert to simply slurping in the input into the headers:

    :0
    * ^Subject:.*something unique here
    {
        :0fhw
        | sed -e '/^#/d' -e '/^$/d' -e 's/^/Bcc: /' file-of-recipients ; \
            formail -I"From " -I"To: my little mailing list" -ICc: -IBcc:

        :0
        ! -t
    }

This permits you to have comments in the addressee file as well. 
(The sed script discards any lines which start with a hash mark.) 
Some things about this script are a bit unidiomatic -- it will add the
BCC headers +before+ the original headers, and kill off the From_
line, and any To: and Cc: (you should set To: to something marginally
useful) but otherwise tries to preserve original headers the way they
are. (It would perhaps be better to simply make your own headers from
scratch and just grab the Subject: from the piece you are forwarding.)

You should make sure your mailer program will discard the BCC:s
properly before sending off the message. Sendmail does this, other
MTAs might not.

Another alternative is to use something like xargs(1) to stuff as much
as will fit onto a single command line, then repeate with a new
command line until standard input is consumed, but then you'd have to
have the addresses on standard input and therefore store the message
itself in a temporary file or something. 

/* era */

-- 
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r.  <http://www.iki.fi/~era/>
 * Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>

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