procmail
[Top] [All Lists]

Re: Include message-id in log

2001-10-28 21:02:55
On Sun, 28 Oct 2001, Harry Putnam wrote:

Bart Schaefer <schaefer(_at_)zanshin(_dot_)com> writes:

I tried your suggestion:

:0 c
{
 :0
 backup/.
}

It cause several things to be double printed like this:
procmail: Assigning "EXITCODE=0"
procmail: Executing "formail,-XMessage-Id:"
procmail: Executing "formail,-XMessage-Id:"
Message-Id: 
<200110290051(_dot_)f9T0p5915862(_at_)reader(_dot_)local(_dot_)lan>
Message-Id: 
<200110290051(_dot_)f9T0p5915862(_at_)reader(_dot_)local(_dot_)lan>

Yes.  You can get rid of all the lines that start with "procmail:" by
commenting out the the "VERBOSE=yes" line.  You should really only need
VERBOSE for debugging.

so you might have to employ an additional lock file to assure that the
output looks like what you want.  Someone will certainly correct me on
this if I'm wrong.

Not sure where to put it.  Probably doing it wrong to boot. 
Trying:

 :0: c

Ah, no.  That means that the lock file is named "c".  The second colon has
to come AFTER the flags, as in

:0 c:

But that's not what you want here anyway; you'd need a global lock with
the LOCKFILE variable.  Probably, though, it would be easier just to turn
off logging of the backup copy:

:0 c
{
 LOGFILE        # No logfile, stop logging in forked copy
 :0
 backup/.
}

As for where one entry ends and the next begins: The line with the `date`
output will always be the first one resulting from any message delivery.
You probably should be using

LOG="`date`
"

I do have something similar shown in my original post I think

Yes; I was suggesting that you change it.

   LOG=`date +"%b %d %T %w"`

The trailing newline is stripped off command substitutions in backticks,
so that LOG assignment does not write a newline to the log.  Using the
outer set of double quotes like so

LOG="`date +'%b %d %T %w'`
"

forces a newline back onto the log entry.

But it seems it doesn't get printed in a regular dependable way
either.

I don't know why that would be the case, so you might want to describe the 
situation in more detail.

Can I make the backup recipe log to a different log somehow, yet let
all the others log to a single log.?

See above; you can assign a different value to LOGFILE inside the { } to
log that result elsewhere -- just be sure to use the "c" flag outside the
braces or you'll redirect logging of the whole rest of the procmailrc.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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