procmail
[Top] [All Lists]

Re: rename carbon copy

2005-03-29 17:45:30
Jeremy Armitage schreef:

I'm trying to create an archive of all the messages i receive, which
is simple enough.  However, the naming convention leaves a bit to be
desired.

  # backup all messages
  :0c:
  backup

the above will store files in the backup directory, with file names
like: msg.0KB  msg.8HB  msg.EVB

This is because 'backup' is an existing directory. Change the 
recipe to

   # backup all messages
   :0c
   backup/

(colon removed, slash added) 

and you'll see a different kind of delivery: maildir-type.


An alternative:

   SYS_date = "`date -u +%Y-%m-%d`"
   # backup all messages
   :0c: # file delivery, so colon added for locking
   backup/${SYS_date}

will create a backup-file per day.
(The date can also be retrieved from the From_ line.)


To use the address from the From_ line:

   From_addr = '@'
   :0
   * ^^From +\/[^ ]+
   { From_addr = "$MATCH" }

   SYS_date = "`date -u +%y-%m-%d`"
   # backup all messages
   :0c:
   backup/${SYS_date}.${From_addr}

(untested)

-- 
Grtz, Ruud

____________________________________________________________
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>