procmail
[Top] [All Lists]

Re: filtering mailboxes using Cron

1997-05-01 13:58:00
On Thu, 1 May 1997 19:25:22 +0100,
At the end of the month, I would like to filter work-related mail out 
of my "received" and "sent" folders.  Can I do this using procmail
and if so, how?  If somone could take the time to give a line-by-line
explanation of the example given in the man pages that would help.
I use the manpage example to take mail that's already in my incoming
mail spool and run it through my .procmailrc again after I have 
reset my forwarding recipes.  It works like a charm so far.
<... good explanation snipped ...>
Make sure that the lockfile executions at line {7} and {10} actually
work as intended.  Era pointed out to me that it doesn' always work
on all file systems.  Try invoking the lockfile -ml at the command 
line and then try to fire up your friendly mailer.  If you can't look
at your mail, the command worked.

This is not necessarily true; the issue is whether the lock will
actually prevent mail from being delivered. (It's nice if your mail
reader obeys locks but this is not of primary interest here.) 
  For reference, I only know that -- much to my surprise -- doing
lockfile -ml on my home system (MacBSD 1.2) did not prevent mail from
being written to my mail spool. [I've been meaning to submit a bug
report somewhere but I'm unsure whether this is a NetBSD or a lockfile
problem. Nobody else has reported any similar problem so I could be
inflicting panic needlessly here.]

I *imagine* you can point $ORGMAIL (line {2}) at virtually any MBOX
style mail "folder."  If you're not actually pointing at the mailspool,
I don't "think" the lockfile -ml and lockfile -mu are needed.

Well, if there's a chance that the mbox will be written to while you
fiddle with it, you need to lock it. (The lockfile syntax is different
then; -ml and -mu are specifically for locking your primary spool
file.) 

Hope this helps,

/* era */

Test transcript [from memory]:

 $ ls -l $MAIL
 -rw------- 1 era   wheel    0 date and time /var/mail/era
 $ lockfile -ml
 $ echo moo moo moo | /usr/bin/mail era
 $ ls -l $MAIL
 -rw------- 1 era   wheel  424 just updated  /var/mail/era

-- 
Defin-i-t-e-ly. Sep-a-r-a-te. Gram-m-a-r.  <http://www.iki.fi/~era/>
 * Enjoy receiving spam? Register at <http://www.iki.fi/~era/spam.html>

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