procmail
[Top] [All Lists]

Re: Changing Mail Headers for messages sent to the list (Re:

1997-01-07 09:25:57
At 11:21 PM 1/6/97 -0500, Timothy J Luoma <luomat(_at_)nerc(_dot_)com> wrote:
Responding To: dmuth+3563401061997220539771583412868268(_at_)ot(_dot_)com  
(Doug Muth)
Original Date: Mon, 6 Jan 1997 22:08:13 -0500 (EST)
Message-ID:    
<199701070308(_dot_)WAA00410(_at_)dmuth(_dot_)ppp(_dot_)ot(_dot_)net>

Actually, I was thinking along the lines of using something to
replace sendmail, parse the outgoing mail, and pass it along to
sendmail. But, since sendmail is too damn complex, I'm not even
going to THINK about attempting it. :-/

Well, try this:

#!/bin/sh

cat - | sed 's/Subject\:\ Re\:\ \[Procmail\]\ /Subject\:\ /g' | \
/usr/lib/sendmail "$@"

exit 0

Instead of invoking 'sendmail' when you send a message, use this.

It will get the "Subject: Re: [Procmail] " line and change it to  
"Subject: "

Except, the "Re:" should be left in there.  Why are you escaping
all the : and space characters in the sed program?  And why is
$@ in double quotes; won't that turn all the switches and
arguments into one argument to sendmail, containing spaces?

BTW, a while back one of the unix newsgroups was giving "awards"
for unneeded uses of "cat."  Your "cat - | sed" qualifies.  :-)

I'm guessing it should look like this:

#!/bin/sh
sed 's/^Subject: Re: \[Procmail\]/Subject: Re:/' | /usr/lib/sendmail $@
exit 0

(we won't need the "g" modifier either since we should find it
at most once).

Cheers,
Stan

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