procmail
[Top] [All Lists]

Re: Saving automated outbound mail

2004-11-03 14:21:51
My script does have one defect that I'd like to resolve.  I have not
discovered a way to capture the automated outbound message after
sendmail finishes composing the headers.

Compose the msg as much as you can yourself, esp the Date: header. I use

DATE="`env LC_ALL=C date +'%a, %d %b %Y %T %z'`"
:0
* DATE ?? .*\/%z$
{ DATE="`env LC_ALL=C gnudate +'%a, %d %b %Y %T %z'`" }
:0 A
* DATE ?? ^$
{ DATE="`env LC_ALL=C date +'%a, %d %b %Y %T +0000'`" }

in a date.rc which returns the date in $DATE. Keep it in a separate file
in case your date binary changes. GNU's your friend, everything else
sucks hamsters with straws.

store a copy of the outbound message locally, but this does not
include the From_ field, so my MUA rejects it and won't open the
mbox.

Simple fix, I do this:

## Create a "From "
:0 fhw
| formail -b

## Save copy of outgoing
:0 c:
outgoingbackup

## Send msg out
:0
| $SENDMAIL $SENDMAILFLAGS -t

Sendmail quite happily ignores the From_. If you find that a problem,
rearrange the recipes and nest the formail into the savecopy.

Alternatively, you could add a bcc: to the outgoing mail, then use your
own procmail again :) to save the mail you're sent to some folder...

Volker

-- 
Volker Kuhlmann                 is possibly list0570 with the domain in header
http://volker.dnsalias.net/             Please do not CC list postings to me.

____________________________________________________________
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