procmail
[Top] [All Lists]

simple procmail receipts

1997-08-21 01:44:01
Hi,

I am using procmail v3.11pre4 1995/10/29 on SunOS 5.4 (Solaris) and I am
having problem with setting up a receipe filtering rule to do the following
simple task despite checking with man pages and various links on the net
(eg: http://www.acm.uiuc.edu.workshops/procmail/filter2.html).

Task:
For all incoming mails with the word "label" in the Subject line, forward a
copy to another e-mail account and append the body (b flag) of the message to
a file.

My .procmail looks like the following:

### START OF .PROCMAIL ###
VERBOSE=on
LABELSDIR=$HOME/labels
LABELSTXT=$LABELSDIR/labels.txt
DUMMY=`test -d $LABELSDIR || mkdir $LABELSDIR`
DUMMY=`test -f $LABELSTXT || touch $LABELSTXT`
 
:0 :
* ^Subject:.*label.*
! mwon(_at_)lithium
 
:0 b:
| cat >> ${LABELSTXT}
### END OF .PROCMAIL ###

Note that the above is a dumb and simple version and I have also tried the
following:

:0
* ^Subject:.*label.*
{
    :0
    ! mwon(_at_)lithium

    :0 b:
    | cat >> ${LABELSTXT}
}

and the following:

:0
* ^Subject:.*label.*
! mwon(_at_)lithium

:0 b:
| cat >> ${LABELSTXT}

The problems with all the above is that only *one* (1) of the actions is
actually executed, ie the one that appears first! In the above setting, only a
copy of that mail gets forwarded to mwon(_at_)lithium but *not* saved as 
${LABELSTXT}
. If I reverse the order of the actions in all the above, I got the files saved
but mwon(_at_)lithium does not receive a copy of that mail!!!

I have read through the man pages and some URL tutorials over and over but just
couldn't figure out what is wrong.

Would you be able to help please ?

Thanks in advance.

mc(_dot_)wong(_at_)fujitsu(_dot_)com(_dot_)au

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