Standard definitions for mail

UpCommands
Sitemap
 
Spamblock
Vacation

This page describes the mail input object, mail related standard predicates and the mail related rulesets currently distributed with Fmail.

The standard rule sets distributed with Fmail are Vacation and Spamblock.

For the future I will have a look at the personal.tcl bot by Marshall Rose and see what I can add here too.

Mail predicates
Subcmd Description
hasHeader
h

Returns true if the mail has the header element <h>.

header
keylist relation patternlist

<keylist> has to contain the names of one or more headers, <patternlist> the patterns they have to match. Depending on the context (anyof or allof, see ::fmail::op) either all or one match is required to make the predicate true. Without context 'allof' is used as default.

The allowed <relation>s and their semantics are:

Relations
Key Value
==, equal, eq

The patterns are interpreted as simple strings. A pattern matches if the value associated to the header is equal to the string. The comparison is case-sensitive.

!=, <>, #, ne

The patterns are interpreted as simple strings. A pattern matches if the header value is not equal to the string. The comparison is case-sensitive.

*, match

The patterns are interpreted as glob pattern. A pattern matches if the header value matches according to the glob rules. The match is case-sensitive.

!*, nmatch

The patterns are interpreted as glob pattern. A pattern matches if the header value does not match according to the glob rules.The match is case-sensitive.

~, regex

The patterns are interpreted as regexp pattern. A pattern matches if the header value matches according to the regex rules. The match is case-insensitive.

!~, nregex

The patterns are interpreted as regexp pattern. A pattern matches if the header value does not match according to the regexp rules.The match is case-insensitive.

body
relation patternlist

The body of the mail is matched against the patterns in <patternlist>. Depending on the context (anyof or allof, see ::fmail::op) either all or one match is required to make the predicate true. Without context 'allof' is used as default.

The allowed <relation>s and their semantics are the same as for header.

size
relation patternlist

The size of the mail body is matched against the patterns in <patternlist>. Depending on the context (anyof or allof, see ::fmail::op) either all or one match is required to make the predicate true. Without context 'allof' is used as default.

The allowed <relation>s are a superset of the ones allowed for header and body. The 'glob' and 'regexp' operators retain their semantics here, but (non-)equality is tested numerically and not based on string comparison.

The additional <relation>s are:

Relations
Key Value
>, gt

Matches if the size of the mail body is greater than specified in the pattern.

>=, ge

Matches if the size of the mail body is greater than specified in the pattern or equal.

<, lt

Matches if the size of the mail body is less than specified in the pattern.

<=, le

Matches if the size of the mail body is less than specified in the pattern or equal.

The numerical comparisons allow not only simple numbers as patterns, but the suffices k, kb and kbyte too, to denote kilobytes. For mega- and gigabyte we have m and g and the equivalent long forms. The suffix can be part of the number or separated from it, but only by whitespace. As the name 'suffix' implies, it has to follow the number.

Mail actions
Subcmd Description
store2mh-folder
mbox

Special action storing the input object into the specified MH folder. <mbox> contains the name of the target folder.

Implemented in terms of pipeto.


The mail input object is just an object oriented way of accessing a mail handle as used by Tcl MIME. All commands defined by Tcl MIME are provided as methods of the object.

Mail object
Subcmd Description
::fmail::mail
type data

This command either takes a string or a channel, interprets it as MIME compliant mail and then returns the name of a command to access and manipulate the mail in an object oriented manner. The functionality used here comes from Tcl MIME.

<type> is either 'string' or 'channel'.

In the case of 'string' <data> will be interpreted as string containing the mail.

Else <data> has to contain the handle of a channel which is then read from the current access point to EOF and the gathered string is interpreted as the mail to access.


© Andreas Kupries
Last update at Thu Nov 11 21:48:40 MET 1999