Subject: Re: formail -X and -A together

From: [email-masked] (David W. Tamkin)
Date: Tue, 28 Jun 1994 23:07:56 -0500 (CDT)

Teddy Mantoro asked,

| May I explain again my problem. I want to creat mail.log that contain 
| only "From:" , "To:" and "Cc:" only. I don't want to collect any body 
| message.

Here's what I do.  First, assign the LOGFILE variable in your .procmailrc
so that procmail logs its errors and results to a file.  (For example,
LOGFILE = $HOME/mail.log as you said.)  Second, don't make any changes to
the LOGABSTRACT variable, and for each incoming letter procmail will record
its From_ line, its Subject: line, the last thing done with it, and its
length in $LOGFILE when procmail is done with it.  (Or since you don't
want those fields but only From:, To:, and Cc:, perhaps you should set
LOGABSTRACT = no.)

Third, I have an assignment early in .procmailrc that prints a blank line
plus bunch of other headers I want to see into $LOGFILE:

LOG = "
`formail -XTo: -XCc: -XFrom: -XDate: -XReply-To: -XResent-To: -XResent-Cc: \
         -XApparently-To: -XResent-From: -XResent-Date: -XResent-Reply-To: \
         -XApparently-Resent-To: -XX-Envelope-To:`
"

You could do with just this much of it:

LOG = "
`formail -XTo: -XCc: -XFrom:`
"

The extra newline before the formail command is there to generate a blank
line in my log.  The extra newline after the formail command is there to
produce a trailing newline so that the logabstract doesn't start on the
same line.  Writing something to $LOGFILE by assigning it to LOG acts like
echo -n.

| I want to see .procmailrc in the computer, but I can not find it in my 
| home directory. I think in somewhere else. What should I do?

Your .procmailrc certainly should be in your home directory.  Are you
remembering the -a flag for ls to show files whose names begin with a
period?

David W. Tamkin  P. O. Box 3284  Skokie IL  60076-6284
[email-masked]   MCI Mail: 426-1818   +1 312 714 5610