rohrpost

A commandline mail client to change the world as we see it.
git clone git://r-36.net/rohrpost
Log | Files | Refs | README | LICENSE

sieve.example (898B)


      1 #
      2 # See [0] for more info.
      3 #
      4 # [0] http://wiki.dovecot.org/LDA/Sieve
      5 #
      6 
      7 require "fileinto";
      8 
      9 #
     10 # Spam
     11 #
     12 if anyof (
     13 	header :contains "X-Spam-Flag" "YES",
     14 	header :contains "Subject" "*****SPAM*****"
     15 ) {
     16 	discard;
     17 	stop;
     18 }
     19 
     20 #
     21 # Important e-mails. 
     22 #
     23 if anyof (
     24 	header :contains "List-Id" "example.list.university.com",
     25 	header :contains "Return-Path" "crappy.list@example.com",
     26 	header :contains ["To", "Cc", "Bcc"] "@university.com",
     27 	address :all :contains ["To", "Cc", "Bcc"] "me@students.university.com"
     28 ) {
     29 	fileinto "studies";
     30 	stop;
     31 }
     32 
     33 #
     34 # A mailinglist.
     35 #
     36 if header :contains "List-Id" "more.important.example.com" {
     37 	fileinto "important-mailinglist";
     38 	stop;
     39 }
     40 
     41 #
     42 # Main filter
     43 # 
     44 if anyof ( 
     45 	address :all :is ["To", "Cc", "Bcc"] "me@me.com",
     46 	address :all :contains ["To", "Cc", "Bcc"] "no-spam@me.com"
     47 ) {
     48 	fileinto "me-com";
     49 	stop;
     50 }
     51