MESH

Section: User Commands (1)
Updated: Release 2.0
Index Return to Main Contents
 

NAME

mesh - parse a MIME message and invoke an appropriate service  

SYNOPSIS

mesh    [-s service] [-l loglevel] [file-name ...]

 

DESCRIPTION

The mesh program parses email messages in MIME (RFC1341) format and invokes local programs on the messages' contents. These programs, henceforth known as "services" are written in an interpreted programming language called "tcl" (thanks to John Ousterhout at Berkeley), though the tcl scripts may call local executables. New services may be written and wired-in through a configuration file.

Ordinarily, mesh looks at the first whitespace-separated field in a message's Subject line to determine the appropriate service. Mesh indexes this field to the appropriate service source file and entry point through a table that appears in the configuration file.

 

CONFIGURATION

The configuration file is itself a tcl script that is loaded right before indexes a service. The configuration consists (mostly) of lines starting with the command-name "define-service", followed by three arguments: 1) the "external-name" (what goes in the Subject line), 2) the "internal-name" (the tcl procedure that performs the service), and 3) the name of the file containing the service source (in particular, this file should define a tcl proc with the internal-name).

The configuration file may also have lines starting with the command "define-pattern". This supports service indexing by means other than the Subject line. The first argument is the external-name of the service to be invoked (which should be defined by a define-service line), and the second argument is a tcl expression that is evaluated on the incoming message. If the expression evaluates to non-zero, then the first argument will override any service name appearing in the Subject line, and/or any service names in patterns defined previously.

 

SERVICE INVOCATION

Mesh invokes the tcl proc given by the internal-name, passing it three arguments: a list of the fields appearing after the first field on the Subject line (the "switches"), a keyword-value structure describing key header lines from the input message (the "envelope"), and a keyword-value structure describing the body of the message (the "inputs"). The latter structure is recursive for multipart messages. Please see the hacking documentation in the ServiceMail distribution for more detail on these arguments and other aspects of programming custom services.

 

INSTALLATION

Please see the installation documentation in the distribution. Note that mesh can be installed two ways: in the .forward file of a special account, or in the system alias file.

 

OPTIONS

When called with no options or arguments, mesh expects to receive an RFC 822 format message on its standard input, which it parses and describes to a TCL procedure indexed by the first word on the Subject line. The following options can alter that expectation:
-s <service>
This option tells mesh to take the next argument as the external-name of the desired service, instead of from the Subject line.
-l <loglevel>
This option specifies the logging level to use when posting log entries via syslog(3). File Name Arguments These arguments are processed, in order, as separate MIME messages. They are not necessarily processed as separate ServiceMail requests, in the case where some files are MIME "message/partial"s.

 

ENVIRONMENT

MESHINIT
This environment variable tells mesh the name of the file that contains the TCL initialization code needed for mesh.
MESHCONFIG
This environment variable tells mesh the name of the file that contains service configuration information.

 

FILES

${DISTDIR}/src/mesh/init.tcl the TCL initialization code
${SRCDIR}/src/mesh/config.tcl the table that defines available services
${DISTDIR}/INSTALL installation documentation
${DISTDIR}/doc/mesh/hacking.doc service programming documentation
${DISTDIR}/doc/mesh/hacking.doc service programming documentation

 

SEE ALSO

metamail(1), splitmail(1), sendmail(8), aliases(5)

 

BUGS

 

COPYRIGHT

Copyright (c) 1992-93 Enterprise Integration Technologies (EIT) Corporation

Permission to use, copy, modify, and distribute this material for any purpose and without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies, and that the name of EIT not be used in advertising or publicity pertaining to this material without the specific, prior written permission of an authorized representative of Bellcore. EIT MAKES NO REPRESENTATIONS ABOUT THE ACCURACY OR SUITABILITY OF THIS MATERIAL FOR ANY PURPOSE. IT IS PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.  

AUTHORS

Jay C. Weber (weber@eitech.com)
Eric K. Rescorla (ekr@eitech.com)


 

Index

NAME
SYNOPSIS
DESCRIPTION
CONFIGURATION
SERVICE INVOCATION
INSTALLATION
OPTIONS
ENVIRONMENT
FILES
SEE ALSO
BUGS
COPYRIGHT
AUTHORS

This document was created by man2html, using the manual pages.
Time: 06:42:33 GMT, May 19, 2025