| 1 | [Much of this documentation is cloned from `doc/advanced.txt` in the `owl` repository] |
| 2 | |
| 3 | BarnOwl supports an expressive filter language that can be used to |
| 4 | describe sets of messages. This language is used both for coloring |
| 5 | messages and for selectively viewing subsets of your messages. |
| 6 | |
| 7 | The following command will create a filter called 'mail' that maches |
| 8 | any messages sent to the zephyr class 'mail': |
| 9 | |
| 10 | {{{ filter mail class ^mail$ }}} |
| 11 | |
| 12 | The first argument after the filter command specifies the name of the |
| 13 | filter to be created. The text after that indicates that matching |
| 14 | messages must have the zephyr class "mail". For help understanding |
| 15 | the `^` and `$` characters, consult a reference on POSIX regular |
| 16 | expressions, such as `man 7 regex` or an |
| 17 | [http://www.opengroup.org/onlinepubs/009695399/basedefs/xbd_chap09.html online version]. |
| 18 | Note that all pattern matching in Barnowl is case-insensitive. |
| 19 | |
| 20 | The message fields that can be used in a filter command include: |
| 21 | |
| 22 | sender:: |
| 23 | message sender |
| 24 | recipient:: |
| 25 | message recipient |
| 26 | class:: |
| 27 | zephyr class name |
| 28 | instance:: |
| 29 | zephyr instance name |
| 30 | opcode:: |
| 31 | zephyr opcode |
| 32 | realm:: |
| 33 | zephyr realm |
| 34 | body:: |
| 35 | message body |
| 36 | type:: |
| 37 | message type ('zephyr', 'aim', 'admin', ...) |
| 38 | direction:: |
| 39 | either 'in' 'out' or 'none'\n" |
| 40 | login:: |
| 41 | either 'login' 'logout' or 'none'\n" |
| 42 | |
| 43 | The `info` command (bound to `i` by default) includes a list of “Owl |
| 44 | Message Attributes”; Any attribute listed in this area can also be |
| 45 | matched on by a filter. |
| 46 | |
| 47 | A filter can refer to other filters using the `filter` command: |
| 48 | |
| 49 | {{{ filter somefilt filter foo or filter bar}}} |
| 50 | |
| 51 | Would match anything in either the `foo` or `bar` filters. Recursive |
| 52 | filters are explicitly disallowed. |
| 53 | |
| 54 | You can also use the operators 'and' 'or' and 'not' as well as the |
| 55 | values 'true' and 'false'. Parentheses can be used to group |
| 56 | expressions, though there must be spaces present before and after all |
| 57 | parenthesis. For example: |
| 58 | |
| 59 | {{{ filter myfilt ( class ^foo$ ) or ( class ^quux$ and instance ^bar$ )}}} |
| 60 | |
| 61 | If you define a filter using a filter name that already exists, it |
| 62 | will overwrite the existing filter. This can be a useful way to |
| 63 | override the built-in filters. |
| 64 | |
| 65 | == Built-in special filters == |
| 66 | |
| 67 | all:: |
| 68 | Matches all messages |
| 69 | none:: |
| 70 | Matches no messages |
| 71 | personal:: |
| 72 | “personal” messages, messages sent privately to you. |
| 73 | login:: |
| 74 | Login/Logout notifications |
| 75 | auto:: |
| 76 | Messages generated by automated programs |
| 77 | out:: |
| 78 | Messages sent from you to another user |
| 79 | aim:: |
| 80 | AIM messages |
| 81 | zephyr:: |
| 82 | Zephyr messages |
| 83 | trash:: |
| 84 | "Trash" messages |
| 85 | ping:: |
| 86 | Zephyr pings |
| 87 | reply-lockout Messages for which the reply commands should not work |
| 88 | |
| 89 | |
| 90 | The `trash` filter is used for the `delete trash` command (bound to |
| 91 | `T`). That command will mark as deleted (but not expunge) all messages |
| 92 | in the `trash` filter. By default, this filter matches messages |
| 93 | on `-c mail`, admin messages, pings, and login notifications. |
| 94 | |
| 95 | The `reply-lockout` filter can be used to prevent you from |
| 96 | accidentally replying to classes you do not want to ever send to. By |
| 97 | default it includes class `mail` and class `noc`, both of which are |
| 98 | used for automatic notifications but which users generally never send |
| 99 | to themselves. |