procmail
[Top] [All Lists]

Re: Procmail filter for outgoing mail

1997-06-24 08:28:00
On Tue, 24 Jun 1997 you (era eriksson) wrote:
 > csh-prompt> proctest dummy(_at_)ddress(_dot_)to(_dot_)test < TestMailItem
^^^
(ugh)

csh is a NeXTStep default

Just another data point:

I've tried essentially the same with 3.11pre4 on an Alpha and
3.11pre7 on a Sun and I got neither to expand it. (The recipe file
contained little else than LOG="$@" and neither logged anything at
all with a command line similar to what Chris is using. And yes, I
have verbose logging.)

Hmm.  Thanks for sharing that.  Pity.  I thought it would be kind  
of neat to have the filter all in a single file, but I've given in  
now and I'm driving procmail from a shell script:

=======cut here=========

#! /bin/sh

ARGS=`echo $*`
procmail ~/.outprocmail.rc | \
/usr/lib/sendmail -oi -odb $ARGS

=======cut here=========

My .outprocmail.rc looks like this:

=======cut here=========

SHELL=/bin/sh
# for diagnostics
TMPDIR=/tmp/procmailtest
VERBOSE=yes
LOGFILE=$TMPDIR/procmail.log
DEFAULT=|

:0f
* ^To:.*Mag-Reader
| formail -I "Reply-To: chris-unix(_at_)cbidmead(_dot_)demon(_dot_)co(_dot_)uk" 
-s
{ }

# other similar :0f conditions can be added for fixing
# up replies I send out from various different mailboxes

=======cut here=========

This is simple and works well.  Alas if I substitute Tim's  
excellent stopthatmail instead of sendmail in the last line of the  
shell script, for some reason the mail item doesn't get passed, but  
I guess that a matter for me and Tim to sort out.

el bid