procmail
[Top] [All Lists]

Re: save message on autoreply

1996-05-04 13:06:36
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.

| $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.

| :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):

  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

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