=== Mail Filter Methods ===================================================== --- Method Declaration------------------------------------------------------- getFilters() insertFilter(arg1: Filter) updateFilter(arg1: integer, arg2 : Filter) deleteFilter(arg1: [integer|string|Filter]) setFilters(arg1: Array of Filter) publishFilters(arg1: Array of Filter) --- Methodes Definitions ---------------------------------------------------- getFilters() Result : Array of Filter Parameters : none Description: returns an Array of all Filters Example : getFilters insertFilter(arg1) Result : NO if the command fails, otherwise YES Parameters : arg1:Filter Description: Adds a new Filter. If the arg1.filterPos is not set, the Filter is appended at last position, otherwise it is inserted at arg1.filterPos. Examples : insertFilter( { entries = ( { filterKind = "begins with"; headerField = subject; string = "SKYRiX OnlineDemo"; } ); filterPos = 3; folder = "/INBOX/Klicker"; match = or; name = onlineDemo; }) updateFilter(arg1, arg2) Result : NO if the command fails, otherwise YES Parameters : arg1 : integer (filterPos) arg2 : Filter (the filter to be updated) Description: Updates the filter arg2 (the filter is supposed to be at position arg1 in the beginning of the update process). You can simply move a filter by changing the arg2.filterPos attribute. Examples : updateFilter(3, { name = onlineDemo; filterPos = 4; // moves the filter at pos 4 ... some more attributes ... }) deleteFilter(arg1) Result : NO if the command fails, otherwise YES Parameters : arg1 : interger (filterPos) | arg1 : string (name) | arg1 : Filter (the filter itself) Description: if arg1 = interger: remove filter at position arg1 if arg1 = string : remove filter with name arg1 if arg1 = Filter : remove filter arg1 Examples : deleteFilter(1); deleteFilter("onlineDemo") deleteFilter({ name = onlineDemo; filterPos = 3; ... some more attributes ... } setFilters(arg1) Result : NO if the command fails, otherwise YES Parameters : arg1 : Array of Filter Description: Replaces all filters with arg1. Examples : setFilters(emptyArray); // removes all filters (emptyArray = ()) publishFilters(arg1) Result : NO if the command fails, otherwise YES Parameters : arg1 : None || arg1 : Array of Filter Description: if arg1 is None: installs all filters (got by getFilters()) if arg1 is an Array of Filter: installs all Filters of arg1 Examples : publishFilters() publishFilters(( { entries = ( { filterKind = "begins with"; headerField = subject; string = "SKYRiX OnlineDemo"; }, { filterKind = "is"; headerField = subject; string = "OnlineDemo"; } ); filterPos = 0; folder = "/INBOX/Klicker"; match = or; name = onlineDemo; } )) --- Datatypes --------------------------------------------------------------- hh: addFilter(name, sortKey, qualifier, action, args); // action=copyToFolder|moveToFolder|delete|forward deleteFilter(name) getFilters() updateFilter(name, ...) example of a Filter: ... qualifier = "subject like 'SKYRiX OnlineDemo*' OR subject='OnlineDemo'" { entries = ( { filterKind = "begins with"; headerField = subject; string = "SKYRiX OnlineDemo"; }, { filterKind = "is"; headerField = subject; string = "OnlineDemo"; } ); filterPos = 0; // sortPos folder = "/INBOX/Klicker"; match = or; // Qual name = onlineDemo; } --- if header ["From"] contains ["coyote"] { forward "acm@frobnitzm.edu"; } else if header "Subject" contains "$$$" { forward "postmaster@frobnitzm.edu"; } else { forward "field@frobnitzm.edu"; } --- require "fileinto"; if header :is "X-Mailinglist" "suse-linux" { fileinto "INBOX.Listen.suse-linux";} elsif header :contains "Mailing-List" "reiserfs" { fileinto "INBOX.Listen.reiserfs";} elsif address :contains :all ["to", "cc", "bcc"] "free-clim" { fileinto "INBOX.Listen.free-clim";} elsif header :contains "List-Id" "gnupg-users.gnupg.org" { fileinto "INBOX.Listen.gnupg";} elsif header :is "X-loop" "isdn4linux" { fileinto "INBOX.Listen.isdn4linux";} elsif header :contains "Mailing-list" "qmail-help@list.cr.yp.to"{ fileinto "INBOX.Listen.qmail";} elsif allof (header :contains "Sender" "owner-info-cyrus@list", address :contains :localpart ["to", "cc", "bcc"] "info-cyrus"){ fileinto "INBOX.Listen.info-cyrus";} elsif header :contains "Sender" "ntbugtraq@listserv"{ fileinto "INBOX.Listen.ntbugtraq";} elsif header :is "list-id" ""{ fileinto "INBOX.Listen.sieve";} elsif header :contains "From" "securityportal-l@listserv.securityportal.com"{ fileinto "INBOX.Newsletter.securityportal";} elsif address :contains :all ["from"] "newsletter@ebay"{ fileinto "INBOX.Newsletter.ebay";} elsif address :contains :all ["to", "cc", "bcc"] "allegro-cl@cs.berkeley.edu"{ fileinto "INBOX.Listen.allegro-cl";} elsif address :contains :all ["to", "cc", "bcc"] "plob@lisp.de"{ fileinto "INBOX.Listen.plob";} else { fileinto "INBOX"; --- ############################################## # Submitted by Tony Maro # http://www.maro.net/tony # Use and abuse this script as you will # I'm not responsible for what it does... # # Save this script in your home directory. # Install this script with the following command, # replacing "thisfile" and "yourname" with the appropriate # information: # # installsieve -i thisfile -m PLAIN -u yourname localhost # # require "fileinto"; require "reject"; # # Circle MUD mailing list list # All mail from the list has "[CIRCLE]" in the subject # Place all these in the "Circle List" folder # I could filter on the mail list senders e-mail as it's always # the same, but this way I even catch personal replies that come # directly from a user to me if header :contains "Subject" "[CIRCLE]" { fileinto "INBOX.Circle List"; } # # "shockwave" e-mail virus - just reject it # if header :contains "Subject" "A great Shockwave flash movie" { reject "Possible virus? Check your system!"; } # # Get a lot of junk from dial-up uu.net accounts # Make sure you create a Junk folder under your INBOX # I like this one because it catches them even if they # relay their crap through some international open # mail relay # if header :contains "Received" ".da.uu.net" { fileinto "INBOX.Junk"; } # # If the mail is listed as TO someone at bigfoot.com # Then just reject it because it's spam (my experience anyway) # if header :contains "To:" "@bigfoot.com" { reject "Yeah, right. Bugoff, hosier!"; } # # If the mail is not directed to me put in the junk folder # be sure to replace yourname@youraddress.com with the # appropriate information # Took me a while to figure out how to do NOT statements... :-} # if anyof ( not address :all :contains ["To", "Cc", "Bcc"] "yourname@youraddress.com" ) { fileinto "INBOX.Junk"; } # # Everything that makes it to here ends up in the INBOX ########################################################