Dear Procmail user,
I found something odd about the procmail and hope you can help.
The objective was to check the incoming with a list of recipient/sender
names in a file 'key_list';
and if the name matches, then the mail is sent to a file called 'body'
or to be forwarded once the script works.
The test shown that:
a) if no match, the output header file 'hdr" would be 0 byte, the size =
0 and
the file 'body' would not be written. The repeated test shown this is
correct.
b) if there is a match, then the hdr > 0 bytes and the file body
written.
Here is the odd thing. The first run, the hdr > 0 and the body will not
be written;
but run the program again, the body will now be written.
This is a repeatable error.
Thanks in advance.
rgds,
kfl.
.procmailrc
-----------
FOUND='/home/dadu/hdr'
BODY='/home/dadu/body'
:0
{
:0 hc
| grep To | grep -f key_list | cat > $FOUND
:0 Wic
* ? test -s $FOUND
| cat > $BODY
}
key_list
--------
kflee
dadu
penny
------------------------------------------------------------------------
------------------------------------
IT&C (HK) Ltd. www.itnc.com <http://www.itnc.com/>
PENIT (China) Ltd. www.penit.com <http://www.penit.com/> : Tel: +86
1300 887 4422
E-Mail: KFLee(_at_)ITNC(_dot_)COM SKYPE: kflee2000
2F, Block A, Seaview Garden, Xinhua Road, Shekou, Shenzhen, PROC.
------------------------------------------------------------------------
------------------------------------
____________________________________________________________
procmail mailing list Procmail homepage: http://www.procmail.org/
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail