Need help with variables in PMMail 2000 filters

Ken Diehl pmmail@dmiyu.org
Mon, 06 Nov 2000 10:44:51 -0400


On Fri, 03 Nov 2000 11:57:15 -0500, Michael Baum wrote:

>I sincerely hope this isn't an FAQ, but in any event I need help with using variable 
>expressions in a filter for PMMail 2000. 
>
>The goal is to write a filter that intercepts incoming email from a select group of 
>addresses -- members of my familty, actually -- and route it to a particular folder. To 
>do this, I created a filter, specified it as "complex" and (trying my best to follow the 
>documentation) used the following expression:
>
>H.Fromid = "$ab.Family$"
>
>As I read it, this should extract the email address from the "From:" field in the 
>message header and compare it to all email addresses stored in the Address Book 
>"Family", returning true if it encounters a match, and then proceed to Take 
>Appropriate Action.
>
>It don't work. Does anyone notice what I've done wrong? (Except, possibly, trusting 
>Help files?)

We had a discusssion about this very thing about 2 months ago.  I was
having the same problem and eventually got it to work.  I'll include
the in this email the notes that were most helpful but essentially it's
not the filter but what you are trying to match that is the problem. 
Same applies to the $ag or $ab tag.  IIRC I ended up finding old email
and using the "add sender to ..." menu item to create groups and books
to be sure I would match was I was receiving.  Play with a little and
you'll see what works.

-------------------------------------------------------------
On Fri, 18 Aug 2000 13:26:20 -0300 (ADT), Trevor Smith wrote:

>Your syntax would be bad, if this feature worked. Using quotation
>marks around $ag.Materials$ will cause PMMail to search for those
>exact characters in the From: address.
>
>However, even without the quotation marks, this does not work (as I
>think you must have discovered already). I get a syntax error every
>time I use any variation of $ag.name$ or just ag.name on the right
>side of an expression -- CONTRARY TO WHAT THE ONLINE HELP SAYS.
>
>Can anyone confirm this? Is this an OS/2 only problem? I think it's
>just broken.
>

I can't tell you if it is an OS/2 only problem, but it works, after a
fashion in Win NT.  If the field being tested matches what is in the
address book exactly it will work.  If you changed the alias in the
book it doesn't register as a hit.  

To put it more clearly, if "Trevor Smith <trevor@haligonian.com>" is in
the header and I've changed the address book entry to have an alias of
TS with the name and email address the same it won't work.  If I leave
the alias alone when I have PMMail create the address book entry it
will work.  I can't remember if this worked the same way under OS/2,
but I think it did.

	Mike Yetto

----------------------------------------------------------------

On Fri, 18 Aug 2000 21:32:07 -0400, Steve Marvin wrote:

>I use a filter for my family (who are all in a group called myfamily) the
>filter is:
>
>h.fromid="$ag.myfamily$"
>
>It opens the mail and plays a wav, hasn't ever missed that I can remember,
>I just tested it again by adding my own email to the group and turning on
>manual - then ran it in a folder that contains a mix including some from
>me. It opened every one from me and skipped all the others.

OOPS! My earlier comments were entirely wrong. Sorry!

As you point out, this action does work (just finally got it to work
here) and the quotes *are* necessary (though that syntax does not
make sense to me and is potentially ambiguous).

In the original filter suggested by Ken, we were using h.from instead
of h.fromid but either will work, depending on what you're looking
for. The only thing that is important is that string in your group
list (name, alias, email address) MUST match exactly with whatever
field you specify on the left.

If the From: line of an incoming message reads:

"Trevor Smith" <trevor@haligonian.com>

and if a group called "friends" has trevor@haligonian.com entered in
its list then this would match:

h.fromid = "$ag.friends$"

because fromid matches exactly the string in the group. But this
would not:

h.from = "$ag.friends$"

because from (the entire header line) does not match exactly since
only the email address is entered in the group.




Ken Diehl, PhD, PE
Director of Engineering Programs
211 Deloach Hall
University of North Carolina at Wilmington
601 South College Road
Wilmington, NC 28403
Voice:  (910) 962-4079
FAX:    (910) 962-4193