<?xml version="1.0" encoding="iso-8859-1"?>
<sieve xmlns="urn:ietf:params:xml:ns:sieve">
  <comment>
    Example Sieve Filter
    Declare any optional features or extensions used by the script
  </comment>

  <control name="require">
    <str>fileinto</str>
  </control>

  <comment>
    Handle messages from known mailing lists
    Move messages from IETF filter discussion list to filter mailbox
  </comment>
  <control name="if">
    <test name="header">
      <tag>is</tag>
      <str>Sender</str>
      <str>owner-ietf-mta-filters@imc.org</str>
    </test>
    <action name="fileinto">
      <str>filter</str>
    </action>
    <postamble>
      <comment>move to "filter" mailbox</comment>
    </postamble>
  </control>

  <comment>
    Keep all messages to or from people in my company
  </comment>
  <control name="elsif">
    <test name="address">
      <tag>domain</tag>
      <tag>is</tag>
      <list>
        <str>From</str>
        <str>To</str>
      </list>
      <str>example.com</str>
    </test>
    <action name="keep"/>
  </control>

  <comment>
    Try and catch unsolicited email.  If a message is not to me,
    or it contains a subject known to be spam, file it away.
  </comment>
  <control name="elsif">
    <test name="anyof">
      <test name="not">
        <test name="address">
          <tag>all</tag>
          <tag>contains</tag>
          <list>
            <str>To</str>
            <str>Cc</str>
            <str>Bcc</str>
          </list>
          <str>me@example.com</str>
        </test>
      </test>
      <test name="header">
        <tag>matches</tag>
        <str>subject</str>
        <list>
          <str>*make*money*fast*</str>
          <str>*university*dipl*mas*</str>
        </list>
      </test>
    </test>
    <action name="fileinto">
      <str>spam</str>
    </action>
  </control>
  <control name="else">
    <preamble>
      <comment>
        Move all other (non-company) mail to "personal"
        mailbox.
      </comment>
    </preamble>
    <action name="fileinto">
      <str>personal</str>
    </action>
  </control>

</sieve>
