SIFT-TCL(1) SIFT-TCL(1) NNAAMMEE sift-tcl - Execute Sift-Tcl file to sort e-mail messages SSYYNNOOPPSSIISS ssiifftt--ttccll [ _s_i_f_t_-_t_c_l_-_f_i_l_e ] DDEESSCCRRIIPPTTIIOONN _S_i_f_t_-_t_c_l is an extended Tcl interpreter for sifting (sort- ing, searching, routing) Internet e-mail. It is part of _S_i_f_t_-_K_i_t and includes extensions for parsing message head- ers and e-mail addresses, the ability to send messages, and the ability to append mail to folders. _S_i_f_t_-_K_i_t also includes _s_i_f_t_-_m_a_i_l_, a graphic user interface, so non- expert users can easily set up the sifter as desired. SSEETTUUPP To use _S_i_f_t_-_t_c_l in the usual fashion it must be executed when each new message arrives. To set this up, create a file called ..ffoorrwwaarrdd in your home directory containing a line of the form: "|/usr/local/bin/sift-tcl" Before you do this you should confirm that _s_i_f_t_-_t_c_l has been installed on your system in //uussrr//llooccaall//bbiinn.. If it's not there, put the path to _s_i_f_t_-_t_c_l in your ..ffoorrwwaarrdd file instead. You can sometimes find it by giving the command wwhhiicchh ssiifftt--ttccll.. You should also be sure that the path you use is absolute (it begins with a "/"). After you've cre- ated the ..ffoorrwwaarrdd file send yourself a mail message to make sure mail is going through. If something has gone wrong with the set up sifting might not work, or worse all your mail will be returned to the sender. _S_i_f_t_-_t_c_l has a number of safety features to make sure that mail is deliv- ered to your inbox even if errors occur. Once it is installed, you can set up individual sifters for sifting tasks such as filtering mail messages from mailing lists by using _s_i_f_t_-_m_a_i_l_. RREEFFEERREENNCCEE _S_i_f_t_-_t_c_l starts up by reading the standard input for a single Internet e-mail message. Then it reads the file ~~//..ssiifftt--ttccll and executes the extended Tcl program in the file. The program makes calls to examine parts of the mes- sage and may take several different actions on the mes- sage. It can file the messages in a mail folder, it may send a message in response to the incoming message, or it may file the message into the users inbox. If any errors occur the message is filed in the inbox, and if that isn't possible it exits with an error code to signal to the 25 June 1995 1 SIFT-TCL(1) SIFT-TCL(1) delivery system that it could not deliver the message. It also writes an entry to .siftlog to log the result. One argument can be given to name an different file than ~~//..ssiifftt--ttccll for the Tcl program. SSIIFFTT--TTCCLL The extended TCL here is called Sift-Tcl and is patterned after Safe-Tcl. It makes use of the _c_-_c_l_i_e_n_t library for reading and writing mail folders. Following is a breif description of the extensions. SSiiffttTTccll__ggeetthheeaaddeerr _f_i_e_l_d Returns the requested field from the current mail message or an empty string if the field does not exist. The string returned will include all contin- uation lines of the header. SSiiffttTTccll__ggeettaaddddrrss _s_t_r_i_n_g Parses the string for e-mail addresses and returns the result as a list. The result is a list even if only one is returned. SSiiffttTTccll__ggeettaaddddrrpprroopp _a_d_d_r_e_s_s _p_r_o_p_e_r_t_y This returns the request property from the given address. The properties follow: pprrooppeerr -- Official 822 rendering: Full Name ffrriieennddllyy -- Returns the full name or the address if no full name aaddddrreessss -- The user name and host: user@do.ma.in ddoommaaiinn -- The domain part of the address mmyybbooxx -- Returns "1" if address is the recipients, otherwise "0" pphhrraassee -- The full name or phrase part SSiiffttTTccll__mmaaiill__aappppeenndd _f_o_l_d_e_r Appends the current mail message to the given folder. The folder is created if it doesn't exist. The folder name syntax determines the type of the folder. If the folder name begins with ~ or / then the type is the standard UNIX mail format used by Elm and Pine. If the name begins with "#mh/" the 25 June 1995 2 SIFT-TCL(1) SIFT-TCL(1) format will be MH. If the name begins with "#carmel#" then the Carmel format will be used. Last, the folder can specify an IMAP server and mail folder path on the server. If IMAP is used, rimap authentication must be used as _s_i_f_t_-_t_c_l will not prompt for a user name and password. This nam- ing scheme comes from _c_-_c_l_i_e_n_t mail file access library. SSiiffttTTccll__mmaakkeebbooddyy _c_o_n_t_e_n_t_-_t_y_p_e _?_-_i_d _s_t_r_i_n_g_? _?_-_p_a_r_a_m_e_t_e_r _s_t_r_i_n_g_? _?_-_d_e_s_c_r_i_p_t_i_o_n _s_t_r_i_n_g_? _v_a_l_u_e _?_e_n_c_o_d_i_n_g_? This constructs a single MIME entity or body. The entity can be sent with SSiiffttTTccll__sseennddmmeessssaaggee or used as a component of a multipart message constructed by calling SSiiffttTTccll__mmaakkeebbooddyy again. If the content- type argument is empty then "text/plain" is used. The _-_i_d argument specifies the Content-ID header and will be generated automatically if not speci- fied. The _-_d_e_s_c_r_i_p_t_i_o_n argument can be used to specify the Content-Description field. A MIME parameter string for parameters specific to the type of body/entity being created can be given with the _-_p_a_r_a_m_e_t_e_r argument. Last the content encoding can be specified (e.g. "base64"). The actual encod- ing of the body is not done here and must be done before hand. ( SSiiffttTTccll__eennccooddee will be included in a future version for this.) SSiiffttTTccll__mmaakkeebbooddyy _m_u_l_t_i_p_a_r_t_-_c_o_n_t_e_n_t_-_t_y_p_e _?_-_i_d _s_t_r_i_n_g_? _?_-_p_a_r_a_m_e_t_e_r _s_t_r_i_n_g_? _?_-_d_e_s_c_r_i_p_t_i_o_n _s_t_r_i_n_g_? _b_o_d_y _._._. This format is used to construct a multipart MIME entity out of a set of other MIME entities (which may be multipart entities too). The multipart- content-type must begin "multipart/" SSiiffttTTccll__sseennddmmeessssaaggee _-_t_o _<_a_d_d_r_l_i_s_t_> _-_s_u_b_j_e_c_t _<_s_t_r_i_n_g_> _-_b_o_d_y _<_b_o_d_y_> _?_-_c_c _<_a_d_d_r_l_i_s_t_>_? _?_-_a_u_x_h_e_a_d_e_r _<_n_a_m_e_> _<_v_a_l_u_e_>_? This sends a message. The three arguments _-_t_o_, _-_b_o_d_y and _-_s_u_b_j_e_c_t are required. The _-_t_o and _-_c_c fields are lists of address to which the message is to be sent. The _-_b_o_d_y option gives the body of the message and includes the text, attachments and other sub-parts. It is usually generated with SSiiffttTTccll__mmaakkeebbooddyy.. The _-_a_u_x_h_e_a_d_e_r allows any addi- tional headers to be created. These might include Reply-to: Resent-to: and X-loop: SSiiffttTTccll__YYeeaarr Returns the current year. e.g. 1995. SSiiffttTTccll__MMoonntthh Returns the current month with January being 1. 25 June 1995 3 SIFT-TCL(1) SIFT-TCL(1) SSiiffttTTccll__DDaayy Returns the current day of the month. FFIILLEESS $$HHOOMMEE//..ffoorrwwaarrdd Specifies actions for local mail delivery agent $$HHOOMMEE//..ssiifftt--ttccll Sift-Tcl code to execute for sifting $$HHOOMMEE//..ssiiffttlloogg Logs all mail processed by _s_i_f_t_-_t_c_l SSEEEE AALLSSOO sseennddmmaaiill(8) ssmmaaiill(8) ssiifftt--mmaaiill(1) AAUUTTHHOORR Copyright (c) 1995 by Laurence Lundblade 25 June 1995 4