procmail
[Top] [All Lists]

setting and testing variables

2001-04-24 03:20:16
I thought I had this straight, but now
am confused again after reading the docs
and several helpful sample rc files.
Hope someone here can help.

I want to set a variable "VALUE" to a value
of GOOD or BAD, depending on the results of
a test. In subsequent recipies I want to test
the value of the variable "VALUE".

Here is the part of my rc file.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
VALUE = ""

:0
* ^From:.*myrealbox.com
{ VALUE=GOOD }

:0 E
* ^(From|Cc|To):.*infobeat\.com
{ VALUE=GOOD }

:0
* $VALUE ?? ^^^^
{
   :0 H
   * ^Message-Id: <[^(_at_)]+>
   { VALUE=BAD }
}

:0
* ! $VALUE ?? GOOD
*  ^Subject:.*S E X
{ VALUE=BAD }

=-=-=-=-=-=-=-=-=-=-=-=-=

When testing for the value of VALUE,
should the test line be

*$ $VALUE ?? GOOD
and
*$ ! $VALUE ?? GOOD

My news server is disfunctional so if you would, please
inlude my return address in the reply.

Thanks loads.
-- 

Keep Well

=-=-=-=-=
 Marshal
=-=-=-=-=

On Thu, 19 Apr 2001, David W. Tamkin wrote:

-->Date: Thu, 19 Apr 2001 22:50:37 -0500 (CDT)
-->From: David W. Tamkin <dattier(_at_)ripco(_dot_)com>
-->To: Procmail Mailing List <procmail-users(_at_)procmail(_dot_)org>
-->Subject: prepending text to the subject
-->
-->Scott Severance asked,
-->
-->| Is there a way to append text to the beginning of the subject line of every
-->| incoming message then bounce it to another address? I going to be
-->| traveling and the Internet connection cost will be prohibitive if I don't
-->| use a shared-mail address :-( . But, My name needs to be it the start of
-->| the subject line so people will know the message is for me. Anyone have any
-->| ideas?
-->
-->That's probably not the best approach; surely you'll have POP3 or IMAP or
-->HTTP access where you're visiting and you can forward mail for your usual
-->address to another that is accessible by POP3 or IMAP or by webmail.  You can
-->set up an account for yourself on a free server and not have to mix your mail
-->in with anyone else's.  You might even be able to use ssh or telnet to log
-->into your usual account and not have to forward your mail at all.
-->
-->Besides, if you prepend "[Scott]" or something like that to every subject
-->line, all the responses you send will have subjects like "Re: [Scott] real
-->subject goes here" unless you remember to change every one of them; if you
-->must forward mail to somebody else's address, maybe that person can run
-->procmail to pick out your mail, remove the tag from the subject, and file it
-->in a separate folder from his/her own mail.  Then you won't have to remember
-->to change the subjects on your responses.  If you can do that, then there's
-->no need to alter the subject line at all: procmail on your mail address can
-->call formail to add a header reading something like "X-for-Scott: yes" to
-->every piece that it forwards, and procmail on your host's account can spot
-->that line and use it to file the message into a folder for you.
-->
-->So I really feel that what you have in mind is far from the best way to do
-->the job, but to answer your question literally instead of analyzing the
-->problem,
-->
--> :0fwh # if the incoming piece has a non-blank subject
--> * ^Subject:[        ]*\/[^  ].*
--> | formail -I "Subject: [Scott] $MATCH"
--> :0Efwh # in case the incoming piece has no subject or a blank or empty one
--> | formail -I "Subject: [Scott] (no incoming subject)"
-->
--> :0
--> ! address(_at_)of(_dot_)your(_dot_)host
-->
-->The first pair of brackets on the second line enclose space and tab; the
-->second pair enclose caret, space, and tab.
-->
-->_______________________________________________
-->procmail mailing list
-->procmail(_at_)lists(_dot_)RWTH-Aachen(_dot_)DE
-->http://MailMan.RWTH-Aachen.DE/mailman/listinfo/procmail
-->

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