procmail
[Top] [All Lists]

Re: Question of a procmail newbie

1999-11-22 11:01:06
Try this:

# legend
# B - search the body of the message
# b - feed body to the pipe
# c - continue with promail script
# \/ - put whatever is behind this sign into the MATCH variable
# | - '|' pipe, output message to unix shell
:0Bc
* ^Category: \/.+
CATEGORY = $MATCH

:0Bc
* ^Subcategory: \/.+
SUBCAT = $MATCH

:0Bc
* ^File: \/.+
FILE = $MATCH

:0b:
| cat >$CATEGORY/$SUBCAT/$FILE


On Mon, 22 Nov 1999, Michael I. Bykov wrote:


I have a problem:


I recieve e-mails with the body like this:

Category: abc
Subcategory: def
File: ghi


I'd like to put the body of this e-mail to the file:

abc/def/ghi

In this case I should do "mkdir -p abc/def" at first.


How could I write a .procmailrc file for this?

Please, answer me directly to my e-mail, not to mailing list.


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