This tutorial is a CookBook of Copy-n-Paste Filter Recipes to help FutureQuest® Site Owners set up some of the more commonly requested one-liner shell script filters. Some of the included examples show how to delete, forward, or redirect an incoming email, based on a variety of test conditions.
Note: Although the copy-n-paste approach here is designed to make it somewhat simpler, setting up custom filters of this type is considered an advanced feature. For more information on the built-in filtering services offered by FutureQuest®, visit the "Email Filters - An Overview" tutorial. The built-in filters are designed to be simple to use in that they require no script at all. For those who require even more advanced filtering options visit the "Custom Filters: Advanced Email Scripting" tutorial.
forward emailaddy@example.com
forward emailaddy@example.com email2@example.net
if 822field from | grep -iq "match@example.com"; then forward forward@example.com; fi
condredirect forward@example.com testprogram
condredirect forward@example.com iftocc match@example.com
condredirect forward@example.com sh -c '822field from | grep -iq match@example.com'
dvd cell phone viagra low rates increase your hits mortgage
condredirect forward@example.com sh -c '822field subject | grep -qiFf "/big/dom/xdomain/badsubj.txt"'
if test program; then exit 99; fi
if 822field from | grep -iq "sender@example.com"; then exit 99; fi
salesperson@example.net example.org trouble@example.com @mail.baddomain.tld
if 822field from | grep -qiFf "/big/dom/xdomain/badfrom.txt"; then exit 99; fi
if ! iftocc me@domain.tld me@example.com me@hotmail.com; then exit 99; fi
sh -c '822field fieldname | grep -qi matchword'
sh -c '822field fieldname | grep -qiFf "/big/dom/xdomain/matchfile.txt"'
Example usage:/usr/local/fqdeliver/tests/msg-size 1000000
Example usage:/usr/local/fqdeliver/tests/no-ext mpg gif
More details on each of the above commands can be found by viewing the "man pages" in an SSH session. For example, to view the man page for iftocc, type the following at the command prompt: [username@FQuest-Server]$ man iftocc