procmail
[Top] [All Lists]

Re: Two procmail/formail questions

1997-10-15 23:57:36
On Wed, 15 Oct 1997 20:10:46 -0600 (MDT), Dan Hersam
<coins(_at_)cs(_dot_)byu(_dot_)edu> wrote:
I have a mailling list set up, but I have two problems with it.  One, I
can't get the From: line to be the address of the mailling list rather

What have you tried, and how didn't it work? Assuming you are
generating headers of the message to send with formail, just add 
-I "From: coins(_at_)cs(_dot_)byu(_dot_)edu" to that formail statement. 

than from me, and second, I'm curious if there's a way to parse out my
signature when it sends mail to all the recipients.  Any help would be

You don't follow the convention to start the sig with
newline-dash-dash-space-newline -- perhaps you should consider
adopting that? Writing a sed script to trim off .signatures is
basically not very hard, the only complication is that you have to
watch out for multiple occurrences of the signature separator.

Here's an alternative approach, if you have tac(1) and a tail(1) that
understands the +n argument -- strip the last four lines from +all+
mail (-:

    :0fwb
    | tac | tail +5 | tac

Any script that has to do something to the +last+ n lines of a message
is tricky to write with standard line-oriented tools because they
usually are based on the assumption that you want to do everything in
one pass, from start to end. The tac(1) trick can obviously be useful
for simplifying your sed scripts, too:

    :0fwb
    | tac | sed '1,/^-- $/d' | tac

Anyhow, it is not obvious to me that it would not be better if you had
a mail reader that allowed you to insert the .signature only when you
actually want it. (I have Emacs set up so that I get the .sig in the
message buffer along with the other text, so I can edit it out or
modify it if I like.)

/* era */

(Sorta like this, y'know. Yeah, if I was a good citizen, I'd have the
separator above the name, not below it, I guess.)

-- 
 Paparazzi of the Net: No matter what you do to protect your privacy,
  they'll add your address with a mailto: link on their web page.

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