procmail
[Top] [All Lists]

Re: A recipe does not work for one list only

2005-04-20 05:02:42
David W. Tamkin:
Ruud:

An alternative would be
  formail -s < mailbox-file | procmail

That would have just the same result as
  procmail < mailbox-file
It has to be
  formail -s procmail < mailbox-file
or it's no improvement.

Yes, don't know what I was thinking then.

From man formail:

-s has to be the last option specified, the first argument
following  it  is  expected to be the name of a program, any other
arguments will be passed along to it.  If you  omit  the  program,
then  formail  will  simply  concatenate the split mails on stdout
again.


The +1 parameter is handy to skip the bogus message.


Let me try to coin up some nice usages of -s in return, 
such as how to split up an archive into files that are 
named after the Message-ID.

(1)
  <mbox formail -s procmail ./msgid-show.rc

#msgid-show.rc
  DEFAULT = '/dev/null'
  :0
  * ! Message-ID:.*<\/[^>]+
  { MATCH = '.junk' }
  LOG = "$MATCH
"

(2)
  mkdir temp
  <mbox formail -s procmail ./msgid-file.rc

#msgid-file.rc
  DEFAULT = 'temp/.junk'
  :0
  * Message-ID:.*<\/[^>]+
  temp/$MATCH


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