procmail
[Top] [All Lists]

RE: archiving outgoing mail

2008-02-22 16:36:18
LuKreme wrote Saturday, February 23, 2008 12:08 AM:

On 21-Feb-2008, at 18:57, Troy Piggins wrote:


The simplest rule to archive the outgoing mail would simply be:

:0fw
| gzip (or 7za or bzip2, whatever) >> /var/mail.archive.gz

No.  Lose the fw and add a lockfile colon.

:0:

That lock makes no sense.

Well, it does make sense.  Also has been discussed on the
list many times in the distance past.  Procmail can figure
out the ">>" and apply locking to that file.

Even if procmail couldn't do that on its own without our
help, we'd still want to invoke locking manually (by supplying
a named lockfile) to avoid archive corruption.

* ! ^TO_$LOGNAME
* ^From:.*$LOGNAME
| gzip -fc9 >> $HOME/Sent_$DATE.gz

You probably want a fw flag to when you are piping to an external  
program.

You seem to be confused about the point of the f-flag.
It is used when we are employing a "filter," i.e., a
classic function box: x gets shunted in, and x-prime comes
out the tail-end.  That's when we want an f-flag (with
the w-flag).  We're *changing* the message and keeping it
in the pipe for procmail to handle further.  That is not
the case here.

No errors to be seen -- it all works fine the way he had it:

 12:33am [~/Mail] 686[0]> cat rc

 VERBOSE = y
 DEFAULT = /dev/null
 DATE = `date +%m%d%y`

 :0:
 | gzip -fc9 >> Sent$DATE.gz


[84.169.239.245 -> panix5] {dman} [0.82]
 12:33am [~/Mail] 687[0]> procmail -m rc < $SPAMPLE
procmail: [9229] Sat Feb 23 00:33:36 2008
procmail: Assigning "DEFAULT=/dev/null"
procmail: Executing "date,+%m%d%y"
procmail: Assigning "DATE=022308"
procmail: Locking "Sent022308.gz.lock"
procmail: Executing " gzip -fc9 >> Sent$DATE.gz"
procmail: Assigning "LASTFOLDER= gzip -fc9 >> Sent$DATE.gz"
procmail: Unlocking "Sent022308.gz.lock"
From Danielsijie(_at_)wanadoo(_dot_)fr  Sat Aug  6 23:40:41 2005
 Subject: Special for You!
  Folder:  gzip -fc9 >> Sent$DATE.gz                                       1863


Dallman

____________________________________________________________
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

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