# $Cambridge: hermes/doc/cyrus_mailstore/sieve-examples/msforward,v 1.1 2003/02/07 16:12:19 dpc22 Exp $ require "envelope"; require "fileinto"; require "vacation"; ## VACATION # relies on following auxillary files: # vacation.aliases [ :addresses ] # vacation.once [ :days approximates ] # vacation.log [can't implement this one] vacation :days 31 :subject "Auto-Response: $subject$" :addresses [ "dpc22@cam.ac.uk", "dpc22@hermes.cam.ac.uk", "David.Carter@ucs.cam.ac.uk" ] text: This message is automatically generated in response to your mail message (perhaps re-directed) to dpc99@hermes.cam.ac.uk. More or less any arbitary text, with '.' characters at the start of a line quoted in best SMTP style like this: .. No variable expanion though . ; ## SENDER: Simple match # sender # localpart dpc22 # domain cam.ac.uk # mailbox dpc22 # copy true # if envelope :is "from" "dpc22@cam.ac.uk" { fileinto "dpc22"; keep; stop; } ## SENDER: Wildcards # sender # localpart * # domain *cam.ac.uk # mailbox dpc99 # copy true # if envelope :matches "from" "dpc99@*cam.ac.uk" { fileinto "dpc99"; keep; stop; } ## RECIP: exact match on address component (same as Exim "foranyaddress") # recip # localpart fanf2 # domain cam.ac.uk # mailbox fanf2 # copy false # if address :is :all ["to", "cc"] "fanf2@cam.ac.uk" { fileinto "fanf2"; stop; } ## BLOCK: wildcard # block # localpart * # domain spam.com # if envelope :matches "from" "*@spam.com" { discard; stop; } ## SUBJECT: No wildcards # # subject # subject IMPORTANT # mailbox important # copy false # if header :contains "subject" "IMPORTANT" { fileinto "important"; stop; } # SUBJECT: Wildcards # # subject # subject hello?world # mailbox hello # copy true # if header :matches "subject" "*Hello?World*" { fileinto "hello"; keep; stop; } # REDIRECT # redirect # address dpc22@cam.ac.uk # copy true # #redirect "dpc22@cam.ac.uk"; #keep;