\begindata{text,538496968}
\textdsversion{12}
\template{help}
\define{global
}


\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 \helptopic{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 \helptopic{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{\helptopic{ams}

\helptopic{cui}

\helptopic{messages}

\helptopic{vu}}}i

\begindata{bp,537558784}
\enddata{bp,537558784}
\view{bpv,537558784,1565,0,0}
Copyright 1992 Carnegie Mellon University and IBM.  All rights reserved.

\smaller{\smaller{$Disclaimer: 

Permission to use, copy, modify, and distribute this software and its 

documentation for any purpose is hereby granted without fee, 

provided that the above copyright notice appear in all copies and that 

both that copyright notice, this permission notice, and the following 

disclaimer appear in supporting documentation, and that the names of 

IBM, Carnegie Mellon University, and other copyright holders, not be 

used in advertising or publicity pertaining to distribution of the software 

without specific, written prior permission.



IBM, CARNEGIE MELLON UNIVERSITY, AND THE OTHER COPYRIGHT HOLDERS 

DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING 

ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.  IN NO EVENT 

SHALL IBM, CARNEGIE MELLON UNIVERSITY, OR ANY OTHER COPYRIGHT HOLDER 

BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY 

DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, 

WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS 

ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE 

OF THIS SOFTWARE.

 $

}}\enddata{text,538496968}
