procmail
[Top] [All Lists]

Re: Creating directories

1999-06-16 01:59:13
John Poltorak wrote:

There is an example of a recipe which I am trying to copy in
procmailex.0. It shows how to create a $MONTHFOLDER directory
if one doesn't already exist. I'm trying to do a similar thing
with mailing lists, but I can't get it to work, or even
understand what is supposed to happen.

Can someone explain how this recipe works? :-

     MONTHFOLDER=`date +%y-%m`
Please bare in mind I am very new to procmail, and I'm running
under OS/2 some certain shell specific functions may not apply.
Dear John,
you are not allone as a newcomer, and Era and others have helped me a
lot.
My recipe is running, and I am happy, though some things must be added.

1MAILDIR=  $HOME/Mail
2MONTHFOLDER=`date +%y-%m`
3DAYFILE=`date +%y-%m-%d`
4DUMMY=`test -d $MAILDIR/interne-liste/$MONTHFOLDER || mkdir
$MAILDIR/interne-liste/$MONTHFOLDER`

1:0 c:
2* ^TOinterne-liste
3|formail -X"From" -k
${MAILDIR}/interne-liste/${MONTHFOLDER}/${DAYFILE}.txt

This recipe creates a file DAYFILE each day, in the directory
MONTHFOLDER, named 99-06-16.txt for today. Every incoming mail is added
to the file.
As many mailers break the lines, I put numbers in front of each line.

Dear Era, 
you told me to add the "w"-flag.
Where shall I put it?
I must have overread it in your FAQs.

1:0 cw:
2* ^TOinterne-liste
3|formail -X"From" -k
${MAILDIR}/interne-liste/${MONTHFOLDER}/${DAYFILE}.txt

I hope, it doesn't hurt you too much, if a newcomer answers a mail of a
newcomer.
;-)))
Thank you,
Jost

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