procmail
[Top] [All Lists]

Re: Need help with filter & forward

1999-02-17 19:43:24
On Wed, 17 Feb 1999, J Keller wrote:

Hi -- I have two mail accounts. Normally, I just
use a .forward file to forward all my work mail
to both my work address and my home address.
This is a simple, one-line file:

\me, me(_at_)home(_dot_)com


Now that I've subscribed to a busy mailing list,
I'm trying to use procmail to filter that list so it
doesn't get copied to my home account.

See below for my recipes so far (which don't work).
I've tried lots of versions of this, but can't quite
get it.  Any help would be greatly appreciated.
Thanks...


:0    # forward mail from this list-server to myself
* ^Cc.*advanced-java.*
* !^X-Loop: me(_at_)work(_dot_)com
| formail -A "X-Loop: me(_at_)work(_dot_)com" | \
  $SENDMAIL me(_at_)work(_dot_)com

:0 c  # forward all other mail to myself, and copy it
* !^X-Loop: me(_at_)work(_dot_)com
| formail -A "X-Loop: me(_at_)work(_dot_)com" | \
  $SENDMAIL me(_at_)work(_dot_)com

:0    # forward the copy to my AOL account
! me(_at_)home(_dot_)com

First, remove the .forward file as it'll just send copies of
everything to both addresses before procmail ever gets its
chance to do anything.

The recipes would be a lot easier (for me) if you used the
actual path to the inbox at the work account.  To find that
(if you don't already), type this at the prompt:

dir $MAIL

Then, use that path in place of having to add the X-Loop and
remailing things back to yourself:


:0c # Send all non-mailing list mail to home address
 !^Cc.*advanced-java
 ! me(_at_)home\com

:0 # Everything else dumps into your work mailbox
path_to_your_work_mailbox

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