procmail
[Top] [All Lists]

Re: Send list to incoming folder

1997-12-08 08:26:25
On 08 Dec 1997 16:16:58 +0200,
<jari(_dot_)aalto(_at_)poboxes(_dot_)com> wrote:
Sun 97-12-07 david hunt <dh(_at_)west(_dot_)net> list.procmail
| For other examples my current .procmailrc and .forward files can be viewed
| at:   http://www.west.net/~dh/homedir/pmdir/
David, you have interesting recipe in your .procmailrc.
Would you care to explain how the sorting works, i'm now sure
I undertood the idea.

(You mean "not sure"?)

I think the comments describe this pretty well. If I'm allowed to
paraphrase: 

TMP=$HOME/tmp$$
:0 chiw:$DEFAULT$LOCKEXT
* (^From foo(_at_)bar  [[a-z0-9]+)              
* ^Command: sortmail$
| cp $DEFAULT $TMP \
&& cp /dev/null $DEFAULT \         
|| echo 'Oops! Your mail may be in $DEFAULT and\or $TMP'

When you receive a locally generated message with Command: sortmail
(which apparently one of David's local scripts generates), move your
$DEFAULT to a temp file. (The echo should use double quotes so that
$TMP gets expanded, and probably redirect echo to standard error with
&2.)

:0 aw:$TMP$LOCKEXT
| rm -f $DUPCACHE\
&& cat $TMP|$FORMAIL +0 -I"X-Sortmail: $$" -s $PROCMAIL \             
&& rm $TMP \     
||echo 'Oops! All of your mail may still be in $TMP'

Then remove the dupe cache, split the temp mailbox (Useless Use of Cat
Award) and feed each message in it through Procmail. (Strictly
speaking, this recipe should have an i flag, too. Possibly, both of
these recipes should share the same regional lock file.)

Net result: The messages in $DEFAULT get split and run through
Procmail ("sorted" -- perhaps this somewhat misleading term should be
abandoned?)

# which is aliased to "sortmail". The cmnd causes formail to generate a 
# short mail which it hands to procmail. This recipe is triggered by that 
# mail, losing the triggering mail, and running the commands in the 
# action of the recipe. Reason for the perverse method is that I don't 
# have permission to lock my mailbox, but procmail does.

If I were David, I would really, really try to persuade my admin to
reinstall Procmail and/or fix the permissions on the spool directory
so that this wouldn't be necessary.

/* era */

-- 
 Paparazzi of the Net: No matter what you do to protect your privacy,
  they'll hunt you down and spam you. <http://www.iki.fi/~era/spam/>