procmail
[Top] [All Lists]

How do I use the -m option?

1996-01-24 15:18:32
Hi folks,

I'm having trouble using the -m flag with procmail.  I'm trying to
follow the EXAMPLES section of the procmail.1 man page.

My goal is to keep a copy of every piece of email sent or received on
my system (as part of a research project).  I want to send every
message to procmail, which will send a copy to an archive file and
forward the message to the intended recipient.  (If anyone knows a
better way to do this, I'm open to suggestions!)

So I set up procmail as a deliver agent in my sendmail.cf like this:

Mprocmail,      P=/usr2/local/bin/procmail, F=mSDFMhun, S=11, R=21, A=procmail 
-m $h $f $u

And I have a rule set which is called from ruleset 0 to deliver to
procmail.  I add a ".procmail" to the end of the domain to mark it as
having already been filtered by procmail:

S40
R$*<@$*.procmail>       $(_at_)$1<@$2>          Already filtered, map back 
R$*<@$*>                                $#procmail $@/etc/procmailrcs/some.rc 
$:$1<@$2.procmail>

Here is my /etc/procmailrcs/some.rc file:

:0 c                            # Make a nice copy of everything
/var/log/mailuse/allmail

:0                              # pass along all mail
! -oi -f "$@"

When I use this setup, I get a copy of the email in my archive file
just fine, but I get an error from sendmail that looks like sendmail
was called with no user names.  I'm suspicious of the "$@" construct in
my rc; am I using it right?  What is actually getting passed to the
"$@"?  Would it be the delivery agent "triple" ($h $f $u)?

BTW, procmail is a great package!  I especially like the complete and
amusing man pages.

--
Dave Burchell         | Nebraska Network for Children and Families
Computer Specialist   | Center on Children, Families, and the Law
burchell(_at_)nncf(_dot_)unl(_dot_)edu | 402-472-3479 | 
burchell(_at_)acm(_dot_)org | 402-475-0089
    "They say I'm lazy but it takes all my time."  -- Joe Walsh

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