\begindata{text, 268621024}
\textdsversion{12}
\template{help}


\chapter{Headmagic: filtering messages

}
\section{What headmagic is


}\leftindent{This Andrew Message System feature allows you to specify that any 
message that contains a certain header field will be filtered through a 
certain filter program.  


It works for all AMS interfaces which work on machines that support filter 
processes; in particular, on any machine where the libraries have 
ENABLEFILTERING defined. At present, therefore, this works on all applications 
running on UNIX machines.}


\section{How to use headmagic}


\leftindent{Create a file in your home directory called ".headmagic".  This 
file will be read line-by-line with each message as it is read from your 
Mailbox for customization information.  Each line should have the general 
format:


Header: filter template


where the filter template is a fully qualified program name followed by a 
sprintf string for building the program's first argument.  If a message 
contains a header specified in ~/.headmagic, its entire message body will then 
be run through the corresponding filter.  For example, you could put the 
following line in ~/.headmagic:


Mumble: /afs/andrew/usr/jbRo/bin/consoleecho Got a mumble header: %s. > 
/dev/console


Then, (assuming you can run jbRo's "consoleecho" program) when you get a piece 
of mail that has the header "Mumble: fratz", the following will get printed on 
your console:  "Got a mumble header: fratz."}


\section{Interface customization}


\leftindent{The library provides a special feature where you can easily add 
interface-only customization functions.  This is intended to support magical 
uses of headers by advanced interfaces such as Messages.  If your .headmagic 
line has NO colon in it, it will be interpreted as a header that is being 
customized by the user interface, and will be passed off directly to the 
customization routines provided by the user interface.  If the user interface 
has not provided customization routines, the library will report that "this 
interface cannot specially handle the 'foobar' header."


This feature is not currently used by any supported AMS program; it is 
intended to support some specific research projects that are using AMS as a 
platform.}

\leftindent{
}\section{Program Author}


\leftindent{Nathaniel Borenstein}

\leftindent{
}\section{Related tools}  


Select (highlight) one of the italicized names and choose "Show Help on 
Selected Word" from the pop-up menu to see the help file for:


\leftindent{\italic{ams

cui

messages

vui\
}}\enddata{text,268621024}
