procmail
[Top] [All Lists]

Re: Content?

1997-01-09 13:19:59
      Is there a way to check for specific variable in the body of a 
designated mail message? The effect I'm looking for is something along
the lines of: 

      mail from person x goes into mailbox y
      however, if the body of the message, has variables c and q, the mail
also goes into mailbox z

      My only solution thus far has been to try to send the mail message 
through a script to match variables, but I've been yet to be able to make 
it work. Anyone been able to make something like this work already?

Sarah,

Procmail conditions can scan either the body, the header or both, at
your control.

Here is a recipe which closely reflects the conditions and variables you
named above.   All you need to do is to replace the variables values.

    c='some text'               # these "variables" control filtering
    q='some other keyword'      # this one too
    x='someuser(_at_)somewhere(_dot_)com'       # from whom mail should be 
filed into 'y'
    y=mail_from_x               # folder to use for mail from $x
    z=mail_with_vars            # folder to use for mail with $c or $q

    :0 Bc:      # If the mail has both $c and $q, then file to $z
    * $ $c
    * $ $q
    $z

    :0:         # if mail from $x, then file to $y
    * $ ^((Resent-)?(From|Sender):(.*[^a-zA-Z0-9_.-])?|From )$x\>
    $y

___________________________________________________________
Alan Stebbens <aks(_at_)sgi(_dot_)com>      http://reality.sgi.com/aks

<Prev in Thread] Current Thread [Next in Thread>
  • Content?, Sarah Worley
    • Re: Content?, Alan K. Stebbens <=