Update mail server filtering with sieve

By gill, 22 August, 2015

Get the filter rules

Steps to update the sieve filter rules.

  • Logon to the server
  • Run sieveshell $ sieveshell --user=gill fairlane
  • List the rules currently in place: > list
  • Export the rule definition to a file: > get filter_from_list text_file.txt
    > quit
  • Edit the file (after quitting sieveshell): $ vi text_file
  • Import the definitions > put text_file filter_from_list
  • Activate the rules > activate filter1
  • Quit sieveshell
    Now you can try server-side filtering.

    Modifying the rules (getting the address books)
    To get the address book information to make the filter rules.
  • In Thunderbird, select Tools > Address book
  • Open the address book to export
  • Select Tools > Export
  • Choose Comma Separated from the type menu (lower right) and enter a file name (such as address.csv). Click Save.
  • Close the address book
  • On the server, convert the CSV file to a list of addresses: awk -F, 'NR > 1 {printf(" \"%s\",\n",$5)}' address.csv | sort > address.txt
  • Use the address.txt file to create the sieve rules.
  • Private
    No