procmail
[Top] [All Lists]

Re: Simple Recipe

2001-06-11 08:49:19
At 16:32 2001-06-08 -0400, Evans, Tim wrote:
I want to extract the hostname from the subject line and save the message in
a folder named for the host:

Whem you want to extract part of something, you should consider checking out the $MATCH construct. See the manpages.

:0:
* (^SUBJECT:.*)myspecificstringofcharacters.*
HOST=`/usr/bin/echo \"${SUBJ}\" | /usr/bin/awk '{print $NF}'`
$HOST

Why not use $MATCH? You toss the need to execute formail, a shell, echo, and awk:

:0:
* ^Subject:.*myspecificstringofcharacters /\.*
$MATCH

Sweet and simple.

---
 Sean B. Straw / Professional Software Engineering

 Procmail disclaimer: <http://www.professional.org/procmail/disclaimer.html>
 Please DO NOT carbon me on list replies.  I'll get my copy from the list.

_______________________________________________
procmail mailing list
procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail

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