procmail
[Top] [All Lists]

Re: receipe question for .procmailrc

2000-11-23 00:02:01
anand v <objectmulti(_at_)hotmail(_dot_)com> writes:
I have this .procmailrc file. I have RedHat 6.1
and it works fine

=====================================
PATH=$HOME/bin:/usr/bin:/bin:/usr/local/bin:/home/httpd/cgi-bin/bin

If you want to add /home/httpd/cgi-bin/bin to the path, just append it:

        PATH = $PATH:/home/httpd/cgi-bin/bin

This way, if the default path is changed you won't need to change your
.procmailrc.

...
DEFAULT=/usr/spool/mail/$LOGNAME

Hmm, isn't that already the default value for your procmail binary?


:hb
^From:(_dot_)*user1(_at_)hotmail(_dot_)com
|mailexec

Ick, the old style recipe format.  It's been more than seven years
since the new format was added.  As a result, many people on this list
probably don't even recognize the above as a valid recipe.  Also, since
the default is to act as if both the h and b flags were given (i.e., to
feed the entire message to the action) most people prefer to leave them
off.  I would suggest writing the above recipe as:

        :0
        * ^From (_dot_)*user1(_at_)hotmail(_dot_)com
        |mailexec

...
How could I change this .procmailrc so that I want to handle
multiple emails like this

:hb
^From:(_dot_)*user1(_at_)hotmail(_dot_)com
|mailexec

:hb
^From:(_dot_)*user2(_at_)hotmail(_dot_)com
|mailexec
...
inother words

I want to do this

if it is from user1
{
 set some ENV variables
 invoke mailexec script
}

if it is from user2
{
 set some ENV vairables
 invoke mailexec script
}

Do you want to set an environment variable or not?  The example recipes
you show don't, but perhaps you just were sure how to show it.  If not,
and the separate recipe would work, albeit ungracefully, then the
suggestion from Andrew Edelstein <andrew(_at_)pure-chaos(_dot_)com> to use the
recipe:
        :0
        * ^From:.*(user1|user2|user3)@hotmail.com
        |mailexec

is correct.  Otherwise you'll need to clarify what variables you want
to set and what they should contain.


Philip Guenther
_______________________________________________
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>