On Sat, 4 May 1996, David W. Tamkin wrote:
Mark Shadley asked,
| This rule sends auto-replies. It works ok, but what can I do to make it
| mail a copy of the original message to ~/Mail/Shadcat ?
You don't want it to "mail" a copy there; you want it to *save* a copy there.
Thanks.
| $MAILDIR=$HOME/Mail
That should be "MAILDIR=$HOME/Mail" without a "$" at the beginning. You use
the dollar sign to interpolate the value of a variable (as with "$HOME"), not
to define one.
Oops, that was a typo.
| :0
| * !^Subject:.*Re:
| * ^Subject:.*get-pgp-key
| | (formail -r ; cat $HOME/.pgpheader $HOME/.pgpkey) | $SENDMAIL -oi -t
| Would ">>Shadcat" at the end of the last line do it?
No. That would write the standard output of the program named in $SENDMAIL
(which usually will be no output at all) to $MAILDIR/Shadcat.
This is what you need (and I'd also recommend checking for
!^FROM_DAEMON and adding some loop detection, but those are both
outside your original question):
I had that in it, but it wasn't working... Just tried it again, I was
testing it from root login, I hadn't looked close enough at the
description of ^FROM_DAEMON.
MAILDIR=$HOME/Mail
:0c: # save a copy to $MAILDIR/Shadcat
* !^Subject:.*Re:
* ^Subject:.*get-pgp-key
Shadcat
:0A # and if it meets those same conditions, send out the files
| (formail -r ; cat $HOME/.pgpheader $HOME/.pgpkey) | $SENDMAIL -oi -t
Thank you, this works great.
Mark
--
Mark Shadley -- http://www.catcher.com/users/shadcat/
Send blank email to shadcat(_at_)catcher(_dot_)com with subject "get-pgp-key"
for automagic public key retrieval.