procmail
[Top] [All Lists]

Re: ^TO ?? ^FROM

2001-06-27 15:11:24
Gerardo Herzig asked the following:
Hi. I trying to compare both special variables, ^TO and ^FROM
Can i use something like this:

From = ^FROM
To = ^TO
:0:
* $From ?? $To
myFolder

Here this idea in not working. Why?

You need to study the procmail documentation some more, especially the
procmailrc man page. ^TO is a macro that contains a complex regular
expression for matching various e-mail headers that indicate to whom an
e-mail is addressed. There is no macro named ^FROM, though there is
^FROM_DAEMON and ^FROM_MAILER. Anyway, these macros are not variables and
cannot be used in the manner in which you are attempting to use them.

In any event, here is a recipe which probably does what you want:

# E-mails where the To: and From: headers match are probably spam.

TO_VALUE        # Insure TO_VALUE is unset.
FROM_VALUE      # Insure FROM_VALUE is unset.

:0
* ^To:[         ]*\/[^  ].*
{ TO_VALUE = $MATCH }

:0
* ^From:[       ]*\/[^  ].*
{ FROM_VALUE = $MATCH }

:0:
* TO_VALUE ?? .
* FROM_VALUE ?? .
* $ FROM_VALUE ?? ^^$\TO_VALUE^^
mbox.scratch

Hope this helps,
Ed
_______________________________________________
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>