
		Internals

------------------------------------------------------------
1	Mailing list server overview
1.1	ML Server Process Overview
1.2	Historical View
1.3	Policy
1.4	Function overviews
1.5	Installation

2	Brief Overview of FML functions
2.1	Directory structure
2.2	Installer
2.3	On documents
2.4	Non-privileged user
2.5	Dynamic library loading 
2.6	configuration file (config.ph)
2.7	Access control and automatic registration
2.8	File Operations
2.9	MIME and Base64 decoding
2.10	Remote administration
2.11	.forward
2.12	Listserv/Majordomo
2.13	Communication with MTA (e.g. sendmail)
2.14	When your machine which FML runs on cannot receive mail
2.15	Security
2.16	Others

3	Version Up and Compatibility
3.1	how to version up
3.2	Enable new functions
3.3	Compatibility on config.ph
3.4	Libraries For Compatibility
3.5	Compatibility with before FML 1.6
3.6	Compatibility with FML 2.0 ("get" command)
3.7	Compatibility with hml 1.6

4	Around design policy
4.1	Do we permit any From: addresses?
4.2	Loop checks against mail loops
4.3	newsyslog(8)
4.4	Date: is the time FML delivers. 
4.5	cut out Received: fields
4.6	cut out Return-Receipt-To:

5	File Operation Functions
5.1	mget options
5.2	mget3 Routine Default
5.3	mget3 search algorithm 
5.4	Program paths
5.5	mget3 process
5.6	Warn a command syntax error ?
5.7	File size unit of "mget" sending back process
5.8	The maximum files for "mget" parameters
5.9	Mget Format: Unix From Format
5.10	Mget Format: MIME/Multipart BNF representation
5.11	Mget Format: An example of MIME/Multipart
5.12	Mget Format: RFC934
5.13	Mget Format: RFC1153 digest 
5.14	Mget Format: Customize RFC1153 format
5.15	Mget Format: lzh + ish option
5.16	Convert to SJIS (Japanese) (lzh + ish and lhz + uuencode option)

6	Fml Processes
6.1	Functions as  ML Server
6.2	How "sendmail -> fml.pl" works
6.3	Order to search library files
6.4	Priority of configuration file search
6.5	fml.pl process (first stage) 
6.6	fml process (second stage) 
6.7	fml process, lock and signal handling
6.8	Event Scheduler
6.9	Another locking algorithm

7	FML internal data structures
7.1	Naming convention of variables
7.2	Naming convention of functions
7.3	%Envelope (hash)
7.4	Initialize data structures
7.5	Directory variables
7.6	On temporary directory ($TMP_DIR)
7.7	Configuration files
7.8	Other useful variables
7.9	Listing variables list

8	FML configuration files, formats and structures
8.1	members file formats
8.2	actives file formats
8.3	Differences between $ACTIVE_LIST and $MEMBER_LIST
8.4	Plural member lists and delivery lists
8.5	$MSEDN_RC format (digest control file msend.pl uses)
8.6	Password file format
8.7	Maintenances

9	Security 
9.1	On security
9.2	Security Check Routine
9.3	DNS Spoofing
9.4	Address Spoofing
9.5	SYN Flooding
9.6	Email address and RFC822 representation
9.7	smrsh.c
9.8	access(2) 
9.9	Precedence Priority
9.10	4.4BSD vacation
9.11	File and Directory Permission Default
9.12	Directory Permissions
9.13	On sendmail 8.8 check_* rule sets
9.14	SMTP and Authentication
9.15	&system() function

10	Library Functions
10.1	daemon (libutils.pl)
10.2	Sendmail (libsmtp.pl)
10.3	SendFile (libsmtp.pl)
10.4	NeonSendFile (libsmtp.pl)
10.5	Addr2FQDN              (fml.pl)
10.6	AddressMatch           (fml.pl)
10.7	MailListMemberP        (fml.pl)
10.8	MailListActiveP        (fml.pl)
10.9	Append2                (fml.pl)
10.10	AutoRegist             (libutils.pl)
10.11	ChangeMemberList       (libfml.pl)
10.12	ChangePasswd           (libcrypt.pl)
10.13	CheckMember            (fml.pl)
10.14	CmpPasswd              (libcrypt.pl)
10.15	CmpPasswdInFile        (libcrypt.pl)
10.16	Conv2mailbox           (fml.pl)
10.17	DecodeMimeStrings      (libMIME.pl)
10.18	Flock                  (fml.pl)
10.19	Funlock                (fml.pl)
10.20	GetID                  (libfml.pl)
10.21	GetTime                (fml.pl)
10.22	Lock                   (fml.pl)
10.23	Log                    (fml.pl)
10.24	LogWEnv                (fml.pl)
10.25	Lookup (fml.pl)
10.26	MailListActiveP	(fml.pl)
10.27	MailListMemberP	(fml.pl)
10.28	Mesg                   (fml.pl)
10.29	NewSyslog              (libnewsyslog.pl)
10.30	Notify                 (fml.pl)
10.31	RunHooks               (fml.pl)
10.32	ExecNewProcess		(fml.pl)
10.33	SecureP                (fml.pl)
10.34	SendBackInOrder     (libfop.pl)
10.35	SocketInit             (libsmtp.pl)
10.36	TurnOverW0             (libnewsyslog.pl)
10.37	Unlock                 (fml.pl)
10.38	Warn                   (fml.pl)
10.39	WholeMail              (fml.pl)
10.40	eval                   (fml.pl)
10.41	ipc                    (libutils.pl)
10.42	system                 (libutils.pl)

11	Porting to other Operationg Systems
11.1	Micro$oft NT 4.0
11.2	sys/ Directory

Appendix A	Naming Convention
Appendix A.1	Function Name
Appendix B	some debug information
Appendix B.1	loading order (in distrubution mode)
------------------------------------------------------------


1	Mailing list server overview

( sorry, under construction ... )

-- The design policy for a mailing list (ML) server

	* automation for daily routine work
	* the degree of freedom for users and ML maintainers
	* provides delivery function and commands for users/maintainers
	* available options are fruitful but the configuration should
	  be explicit.
	...

1.1	ML Server Process Overview

A ML server is a filtering process. MTA (Mail Transfer Agent) on a
host receives mail and injects it to a program (fml.pl).  The
program checks the member or not, surgeries the header and passes the
mail to MTA. The ML server does not deliver mails by itself.

[Figure]

<a host>                                      <ML Server Host>

mail from a member

   |
   V
  MTA (e.g. sendmail)  ------------------>     MTA (e.g. sendmail)

                                                |  kick off the ML server
                                                V

                                            ML server (driver)

                                                |  
                                                V

                                    MTA (e.g. sendmail)  distribution process

                                             |  |  |  |  |  |
                                             V  V  V  V  V  V

                                             members of the Mailing List 

See the figure above on the delivery process. When the ML server
receives a command mail (e.g. unsubscribe this list, get past
articles), it executes given commands and replies the result to the
sender.

A ML server runs only when mail comes in. It is irregular and event
driven. If a user receives articles not real time but once three
hours, another program (msend.pl) needs to run periodically. This is
called "digest delivery". FML uses cron to execute msend.pl
periodically. See cron(8).  In default FML digest delivery depends on
OS's cron for functionality.

1.2	Historical View

FML package provides a lot of functionality of mailing list functions.
I hope it will be useful for from beginner to for people to hack
mailing lists.

For (personal) historical reason FML can emulate hml 1.6.

1.3	Policy

I think "mailing list is a tool for more private communication". In
default only members of a ML can post articles and uses commands for
the ML.

It is important for ML to make routine work more easier.  FML provides
several addresses and command interfaces. You can use interfaces you
like. For example, , FML sets up an address for posting and another
address for commands for each mailing list (default).

To provides the degree of freedom of customization, FML configuration
file has a lot of variables (like a sendmail.cf. FML prepares
listserv(majordomo) style command server interface.  If you can not
set up "a MTA receives mail and runs FML", you can use POP3 based
mailing list.

The core of mailing servers is so simple but we consider a lot of
exceptions. It must be a know-how. FML support several plat-homes on
almost all UNIX and Micro$oft Windows NT 4.0 (beta test) and provides
non UNIX culture function such as "mget" with "ish", "lha".

For security FML runs with simplest functions in default. FML provides
a lot of functions but disables them in default. You need explicit
change on config.ph to enable some functions by using "makefml"
interface or by hand.

FML provides a lot of variables. You can only configure them in
config.ph (configuration file). FML provides an interactive interface
"makefml". You can configure typical settings by "makefml".
I believe it is easy to write WWW Interface which runs "makefml" under
it (but THERE EXIST NO TIME;-).

1.4	Function overviews

FML provides addresses for post and commands.

				variables in config.ph 
	_____________________________________________________

	address for post	$MAIL_LIST	
	address for command	$CONTROL_ADDRESS

You can set $MAIL_LIST == $CONTROL_ADDRESS. But in its case, FML
requires the keyword to identify mail is for post or for commands.

The representative functions of FML are

   * addresses for post and commands 
	-- Chapter how_to_subscribe 7.1

	each access control for each address

   * 4 ways of automatic registration
	-- Chapter how_to_subscribe 5

   * unsubscribe confirmation

	confirmation for bye/unsubscribe command 

   * remote maintenance 
	-- Chapter remote_control 4

	PGP authentication, password authentication ...
	-- Chapter encryption 4

   * large degrees of freedom for header customization
	-- Chapter header_rewrite 5

   * Security: internal traffic monitor
	-- Chapter resource_control 2

	If a lot of mails are injected to ML, FML rejects more mails
	when the traffic overcomes some threshold.

   * Security: filtering
	-- Chapter filter 4.1

	Filtering for each field of a mail header

   * a lot of commands
	-- Chapter 5

	* mget, get, ...

   * digest (matome okuri)
	-- Chapter digest 2

   * SMTP (relay is available but must be of no use today?)
	-- Chapter smtp 3.1

   * Others, e.g. MIME (Japanese)
	-- Chapter Japanese 2

   * Convert articles to HTML 4.0 format files with thread.	
	-- Chapter html_convert 1.1 html_convert 1

   * archive, expire of ML articles
	-- Chapter daily 3 daily 5

   * several interfaces such as listserv or majordomo style
	-- Chapter utility_programs 3

You can add and remove functions in config.ph. Firstly please use
"makefml config" to change simple configurations.

1.5	Installation

The simplest way to install Fml system is to do in the top directory
of the fml source
# Hence a lot of variables are pre-defined.

	perl makefml 

when you make a new ML 

	perl makefml newml ML-Name

e.g. to make elena@your-domain mailing list

	perl makefml newml elena

Please see the file INSTALL for the detail.

2	Brief Overview of FML functions

Please see the file INSTALL.en for the detail on installation, how to
create mailing lists...

2.1	Directory structure

Directory's FML uses consists of two regions. One ($EXEC_DIR in
makefml) is where executables and libraries exist and another ($ML_DIR
in makefml) is one under which each ML's home directories. You can
change these variables when "makefml install".

	1 $EXEC_DIR in makefml
	  executable and libraries (e.g. /usr/local/fml)

	2 $ML_DIR (e.g. /var/spool/ml)

	2 $ML_DIR (e.g. /var/spool/ml)
          each ML's spool (/var/spool/ml/each-ml)

	   /var/spool/ml/elena/		(elena ML)
	   /var/spool/ml/mirei/		(mirei ML)
	   /var/spool/ml/Freekick/	(Freekick ML)
	   /var/spool/ml/sakura/	(sakura ML)
	   /var/spool/ml/tomoyo/	(tomoyo ML)
	   /var/spool/ml/kerochan/	(kerochan ML)
	   ...

/var/spool/ml/elena has config.ph (configuration files), log files,
spools related to "elena" ML exist only under it.  One directory is
for one ML. It is closed. We call the directory the ML's home
(directory).

2.2	Installer

"makefml" is simple CUI interface for you. It is an installer and
configure which provides typical settings. Please see INSTALL.en for
more details for fundamental settings.  This document is for more
advanced settings than INSTALL.

Almost all user defined variables are shown in FML configuration
file "config.ph". You can control FML by config.ph.

2.3	On documents

All documents of plain text version are bundled in a FML distribution
package. HTML version documents except this "op.*" documents are also
bundled in it since "op.*" are very large. 

Latest version of documents are available in

	http://www.fml.org/fml/

2.4	Non-privileged user

We recommend FML runs as a non-privileged user prepared for this
purpose. The privileged user should NOT be used as could as
possible. If you use sendmail, "include" file's owner is the process
owner of FML (fml.pl).

MTA runs fml.pl as a user process using setuid() call. The user fml.pl
switches to the owner of "include" file. MTA must run as a root under
POSIX standard basis, such as 4.4BSD basis OS's. 
FML trusts MTA can switch to a user. So :include: style is in default.

If MTA cannot do setuid(), you can use C wrapper. On 4.3BSD, you can
make C wrapper at the ML's home directory by

	(shell prompt)% make fml

fml is setuid()'ed to you (the owner ran "make"). You can have two
"fml" and "fml-ctl" executables by make. "fml" is a wrapper for the
address for post, "fml-ctl" is one for command.

On the other hand on POSIX basis OS's, only "root" process can do
setuid() call. You need to set up root-setuid()'ed C wrappers. THIS IS
VERY DANGEROUS. Please set up them with consulting administrators on
that such as the location of C wrapper ...

2.5	Dynamic library loading 

FML uses a lot of dynamic loading libraries via perl "require"
statement. It enables extensions, independent customization, separation
of maintenance. Libraries are named lib"module-name".pl such as
libsmtp.pl (SMTP library). 

In default "makefml install" installs executables and libraries to
one directory e.g. /usr/local/fml. "makefml newml elena" makes a
mailing list. The home directory is e.g. /var/spool/ml/elena. When FML
runs, /usr/local/fml/fml.pl runs by reading the configuration
/var/spool/ml/elena/config.ph and libraries /usr/local/fml/lib*pl.

2.6	configuration file (config.ph)

FML provides a lot of variables. You can only configure them in
config.ph (configuration file). FML provides an interactive interface
"makefml". You can configure representative variables with "makefml".

2.7	Access control and automatic registration

The top menu of "makefml config" shows 

   1    POLICY OF ACCESS (WHO CAN POST AND USE COMMANDS)

        [POST]
          PERMIT_POST_FROM                 members_only
          WHEN POST FROM NOT MEMBER        reject

        [COMMAND]                          
          PERMIT_COMMAND_FROM              members_only
          WHEN COMMAND FROM NOT MEMBER     reject

	.....

You can choice the following values for
    * PERMIT POST or COMMANDS FROM WHOM ?
    * IF MAIL COMES FROM NOT MEMBER, WHAT FML DOES?

The choice for "* PERMIT POST or COMMANDS FROM WHOM ?" is one of

	anyone					
	members_only	(default)

The choice of function for "* IF MAIL COMES FROM NOT MEMBER, WHAT
FML DOES?" is one of

	reject		(default)
	auto_regist
	ignore

FML checks in-coming mail is from a member or not. It is default. If
from not member, FML reject the mail and notifies it to the sender. If
from not member and automatic registrable (auto_regist is selected),
FML try to do automatic registration.

2.8	File Operations

"get", "mget" and "digest" delivery provides a lot of formats. The
following formats of mails is available.

	PLAIN TEST 
		UNIX FROM
		RFC934	
		RFC1153
		MIME/Multipart

	COMPRESSED FILE
		gzip UNIX FROM file
		tar + gzip
		uuencode

	   (used only in Japanese ?)
		lha + ish
		lha + uuencode

FML scans $SPOOL_DIR, @ARCHIVE_DIR for files of target for "mget".

"library" command enables "put" and "get" via FML whereas "library"
command permits only "number" as the file name to put.

2.9	MIME and Base64 decoding

Fundamentally FML passes MIME header fields through. FML decodes
Subject: and save it in the summary file (default). If a base64
decoder is defined, FML decodes the base64 part in mail when a HTML
article is created.

2.10	Remote administration

In default FML disables remote administration. 
If you use remote administration, please set 

	$REMOTE_ADMINISTRATION  = 1;

You can change this with "makefml config". We check whether the
command is from an administrator or not with one or mixed ones of
methods:

	From: address 
	password authentication
	PGP authentication     

In default we check a set of "From: address" and "password"
authentication. If possible, we recommend PGP authentication.

2.11	.forward

When you cannot edit /etc/aliases, you can set up an account as a
mailing list. In that case .forward is "include" file itself.
It is useful???

2.12	Listserv/Majordomo

fmlserv.pl provides listserv(majordomo) style interface such as.

	command	<ML> command options
e.g.
	get elena last:10 mp

get the latest 10 articles of elena ML with the MIME/multipart format.

2.13	Communication with MTA (e.g. sendmail)

FML communicates with MTA via SMTP (Simple Mail Transfer Protocol) to
deliver a distribution mail. The default configuration is

	$Envelope{'mci:mailer'} = 'ipc'; (default)

is 'ipc'. FML makes a connection via SMTP to MTA and sends mail to
it. If 'prog' is defined, fml.pl executes sendmail ($SENDMAIL) as a
program and injects the mail to it.

	$Envelope{'mci:mailer'} = 'prog';

The default MTA is 'localhost' MTA. Hosts defined in $HOST and @HOSTS
are also available as a MTA. FML connects via SMTP. If no host runs
MTA, use 'prog'.

2.14	When your machine which FML runs on cannot receive mail

How FML receives mail is a problem. For security some sites prohibit
MTA to run a program. If so, you can use popfml.pl. popfml.pl connects
a POP server via POP3, receives mail for a ML and injects it to
fml.pl.

2.15	Security

See 9 for more details, e.g.
	mail traffic monitor to reject mail bombs 
	filtering based on keywords in fields of a header and body

2.16	Others

Other topics:

	* flock(2), If flock(2) does not work, link(2) lock.
	* relaying. Today relaying is not used.
	* Automatic expiration, archiving
	* Newsyslog 
	* crosspost
	* Star Trek Stardate:

3	Version Up and Compatibility

3.1	how to version up

Please use "makefml" for installation. See INSTALL.en for more details.

3.2	Enable new functions

A new function is disabled in default. A new function is available
when You set up it in config.ph explicitly. See INSTALL.en. 

3.3	Compatibility on config.ph

	$CFVersion

is a version number of config.ph. The difference of $CFVersion makes
FML to evaluate compatibility codes automatically. But if you have
complicated hooks in config.ph, you may need to rewrite it.

3.4	Libraries For Compatibility

3.5	Compatibility with before FML 1.6

	*** not translated ***

3.6	Compatibility with FML 2.0 ("get" command)

	*** not translated ***

3.7	Compatibility with hml 1.6

	*** not translated ***

4	Around design policy

4.1	Do we permit any From: addresses?

In default FML does not permit mail from root, postmaster even if
$PERMIT_POST_FROM == "anyone" or $PERMIT_COMMAND_FROM == "anyone". We
think we cannot permit a post from non personal addresses such as
root, postmaster since a ML is for private communication. It is useful
to detect e.g. error mail loops. The addresses to reject is the
following pattern.

    $REJECT_ADDR  = 'root|postmaster|MAILER-DAEMON|msgs|nobody';
    $REJECT_ADDR .= '|majordomo|listserv|listproc';

When we reject the mail from $REJECT_ADDR\@*, FML forwards it to
$MAINTAINER for consults. Other than $REJECT_ADDR we think addresses
to reject is 'uudecode', 'sysdiag', .... I think $REJECT_ADDR should
be more if possible.

$REJECT_ADDR_LIST is also a list to reject.

4.2	Loop checks against mail loops

$CHECK_MESSAGE_ID is 1 in default. FML caches Message-Id: field of an
in-coming mail against mail loops. Duplicated Message-Id:'s are
invalid since Message-Id is unique in all space-time.

4.3	newsyslog(8)

FML provides a library of a subset of newsyslog(8). It rotates logs
like

	...
	rename log.0 log.1
	rename log log.0
	...

@NEWSYSLOG_FILES is a list of newsyslog(8) target which consists of
digest delivery configuration, member and active lists.
msend.pl calls newsyslog function on Sunday morning.

    @NEWSYSLOG_FILES = 
	("$MSEND_RC.bak", "$MEMBER_LIST.bak", "$ACTIVE_LIST.bak");

$NEWSYSLOG_MAX is the maximum of rotation of log files.
e.g.

	log.4 log.3 ... log.0 log 

4.4	Date: is the time FML delivers. 

Date:	is the time when fml.pl delivers an article. 	
Posted:	is the time when the original sender posted. 

The concept of ML must be two ways of thinking.

	1	just relay.
	2	ML server receives mail and sends it again. 
		not just relay.

We think FML should be type 2. You can sort articles by Date: since it
is the fml.pl delivery order. This conversion is for your eyes.

4.5	cut out Received: fields

4.6	cut out Return-Receipt-To:

To avoid replies from all ML members.

5	File Operation Functions

5.1	mget options

"mget" command has several options. See help file also.

usage:	mget range [mode] [time_unit]

   range		1-10,12,15-100
			1,2,10
			first  	 (MH linke)
			first:10 (MH linke)
			last:30  (MH linke)
			100-last (MH linke)
   mode			gz tgz ish rfc934 b rfc1153 d unpack uf(default=tgz)
   time_unit		time between sending partial files, 1/N and 2/N ...

   mode variation:	default	is tgz (== tar + gzip).

	tgz	tar + gzip
	uf	PLAINTEXT(UNIX FROM)
	gz	GZIP(UNIX FROM)
	b	RFC934 format 	PLAINTEXT(mh-burst)
	rfc934	
	ish	lha + ish 
	lhaish
	i
	li
	lu	lha + uuencode
	lhauu
	unpack	PLAINTEXT(UNIX FROM)
	uu	UUENCODE
	d	RFC1153 format 	PLAINTEXT
	rfc1153	RFC1153 format 	PLAINTEXT

5.2	mget3 Routine Default

* "mget" command
$MGET_MODE_DEFAULT can change the default file format "mget" command
sends back. The default format is "tgz" on UNIX, 'mp' on Windows NT4.

In libsendfile.pl, 

    local($mode) = $MGET_MODE_DEFAULT || 'tgz'; # default

Available options for $MGET_MODE_DEFAULT is %_fp defined in libfop.pl.
The options are one of them:

	uf
	rfc934
	rfc1153
	mp
	gz
	tgz
	lhaish
	lhauu
	uu

* library commands and "get" files in archive. 

In retrieving files of library or archive directories,

	Text		$MGET_TEXT_MODE_DEFAULT
			(default is 'mp' MIME/Multipart)

	Binary		$MGET_BIN_MODE_DEFAULT
			(default is  'uu', uuencoded file); 

    	$mode = -T $opt ? 
    	    ($MGET_TEXT_MODE_DEFAULT || 'mp'): 
    	($MGET_BIN_MODE_DEFAULT || 'uu'); 

* Subject: of "mget" return files

	$MGET_SUBJECT_TEMPLATE

defines the subject of sending back mails. If it is defined as

   result for mget _DOC_MODE_ _PART_ _ML_FN_

FML replaces each keyword in the following

	   _DOC_MODE_   <=>    [last:10 tar + gzip]
	   _PART_       <=>    (1/4)
	   _ML_FN_      <=>    $ML_FN (here is "(Elena Lolobrigita ML)") 

to result in

   Subject: result for mget [last:3 tar + gzip] (1/1) (Elena Lolobrigita ML)

You can use subject with these options. 

5.3	mget3 search algorithm 

	expand MH like syntax
		e.g. 1,last:30 -> 1,70-100

	if V2 search articles in
		e.g.
		spool
		archive/100.tar.gz 

	elsif search archive directories

	elsif V1 format (obsolete)

	else
		NO MATCH or V1 FORMAT ERROR

5.4	Program paths

File operations uses system programs e.g. tar, gzip ....  "makefml"
searches the OS for them and caches them in config.ph. It is good for
you to check them again by yourself. It is useful to define them in
common definition file "sitedef.ph", "site_init.ph".

	variable			example

	$TAR                           = "/usr/bin/tar cf -";
	$UUENCODE                      = "/usr/bin/uuencode";
	$COMPRESS                      = "/usr/bin/gzip -c";
	$ZCAT                          = "/usr/bin/zcat";
	$LHA                           = "/usr/local/bin/lha";
	$ISH                           = "/usr/local/bin/ish";

5.5	mget3 process

The last stage of "mget3" routine process is sending back requested
files. It is as follows.

   * 	mget3 creates temporary files under locked.
	The temporary files are created in $TMP_DIR.
	After unlock, sending back process runs.

The filename is

	m:"mode":"process_id"return.number(split number)

FML requires a set of (mode pid number) information to ensure
uniqueness since "mget" return processes may run in parallel.  After
temporary files creation, mget routine returns to the main routine.

   * the main routine unlocks itself

   * 	&RunStartHooks calls &mget3_SendingEntry after unlock

mget3_SendingEntry calls mget3 sending back routines with %mget_list.
In this stage plural mget3 sending back processes are runnable in
pararell.

If plural files should be sent back, FML tries to send back one mail
in $MGET_SEND_BACK_SLEEPTIME seconds. 

5.6	Warn a command syntax error ?

e.g. in config.ph

To warn a command syntax error, set

	$USE_WARNING = 1;

But syntax error warnings must be noisy:) since it is so often. 
FML does not warn it in default.

e.g. 

5.7	File size unit of "mget" sending back process

	$MAIL_LENGTH_LIMIT (default is 1000 lines)

is the unit in breaking up files. 1000 lines is about 50 K-bytes.  

5.8	The maximum files for "mget" parameters

The maximum number of files "mget" can provide. The default value is
1000.  When "mget *" matches files > 1000, FML returns the error.

	$MGET_SEND_BACK_FILES_LIMIT

5.9	Mget Format: Unix From Format

We call BSD's /var/mail/$USER style UNIX FROM format.
Example:

	From fukachan Mon Jan 26 09:11:46 1998
	Received: by hikari.fml.org (8.8.8/3.4W6+Hikari-2.1) 
		with ESMTP id JAA02846 for <uja@fml.org>; 
		Mon, 26 Jan 1998 09:11:46 +0900 (JST)
	From: fukachan@sapporo.iij.ad.jp
	Subject: uja

	... mail body ....

5.10	Mget Format: MIME/Multipart BNF representation

   boundary := 0*69<bchars> bcharsnospace

   bchars := bcharsnospace / " "

   bcharsnospace :=    DIGIT / ALPHA / "'" / "(" / ")" / "+" /"_"
                 / "," / "-" / "." / "/" / ":" / "=" / "?"

   Overall, the body of a multipart entity may be specified  as
   follows:

   multipart-body := preamble 1*encapsulation
                  close-delimiter epilogue

   encapsulation := delimiter body-part CRLF

   delimiter := "--" boundary CRLF ; taken from Content-Type field.
                                   ; There must be no space
                                   ; between "--" and boundary.

   close-delimiter := "--" boundary "--" CRLF ; Again, no space
   by "--",

   preamble := discard-text   ;  to  be  ignored upon receipt.

   epilogue := discard-text   ;  to  be  ignored upon receipt.

   discard-text := *(*text CRLF)

   body-part := <"message" as defined in RFC 822,
             with all header fields optional, and with the
             specified delimiter not occurring anywhere in
             the message body, either on a line by itself
             or as a substring anywhere.  Note that the
             semantics of a part differ from the semantics
             of a message, as described in the text.>

5.11	Mget Format: An example of MIME/Multipart

Date: Thu, 18 May 95 22:33:00 JST
From: Elena@phys.titech.ac.jp (Elena Lologrigita)
Subject: P R E S E N T
To: fukachan@phys.titech.ac.jp
MIME-Version: 1.0
Content-type: multipart/mixed;
	boundary="--Thu_18_May_95_22:32:56--"

----Thu_18_May_95_22:32:56--
Content-Type: message/rfc822

Date: Thu, 18 May 95 21:45:17 JST
From: fukachan@phys.titech.ac.jp
Subject: Ahoudori
To: Elena@phys.titech.ac.jp (Elena Lolobrigita ML)
Message-ID: <19950518.01905.Elena.Lolobrigita@Baycity.asia>

Feel so good!

--fukachan

----Thu_18_May_95_22:32:56--
Content-Type: message/rfc822

Date: Thu, 18 May 95 22:00:29 JST
From: Elena@phys.titech.ac.jp
Subject: Ashita Kick Off
To: Elena@phys.titech.ac.jp (Elena Lolobrigita ML)
Message-ID: <19950518.01906.Elena.Lolobrigita@Baycity.asia>

Amino Tetsuro's direction is excellent, who is a representative of
Japanese Animation.

----Thu_18_May_95_22:32:56----

5.12	Mget Format: RFC934

rfc934 "Proposed Standard for Message Encapsulation"

You can this format by MH burst. 

Example:
------- Forwarded Message

From: Anna
Subject: Mama told me

#32 "Ahoudori" (Freekick) is the core of Freekick.

------- Forwarded Message

From: Elena
Subject: Albatros

Ingrid must be a sister of Shun :-)

------- Forwarded Message

5.13	Mget Format: RFC1153 digest 

Example:

Date: Sat, 20 May 95 01:33:50 JST
From: Elena@phys.titech.ac.jp
Subject: Freekick
To: fukachan@phys.titech.ac.jp

GODAI BBS DIGEST	Sat, 20 May 95	Volume 95: Issue 120

Today's Topics:
	Elena's hobby is watering.

------------------------------

Date: Sat, 20 May 95 00:00:31 JST
From: "Ken'ichi Fukamachi" <fukachan>
Subject: Elena's hobby is watering.
X-Mail-Count: 01932

Elena's hobby is watering.

--fukachan 
Albatros follows wind.

------------------------------

End of GODAI BBS Digest V95 Issue #120
********************************

5.14	Mget Format: Customize RFC1153 format

$RFC1153_ISSUE		the sequence number of RFC1153 format style.
			It is independent of ML article sequence number
			($SEQUENCE_FILE 's content).

$RFC1153_SEQUENCE_FILE	the file to save $RFC1153_ISSUE
			We cannot resolve how to count 1153 sequence.
			We count the sequence as how many RFC1153
			routine is called.

$RFC1153_LISTNAME 	Title of RFC1153 style digest

$RFC1153_VOL		Volume number e.g. Volume 96

$RFC1153_CUSTOM_HOOK	Hook to run &Rfc1153Custom($mode, *conf)

&Rfc1153Custom($mode, *conf) internal:

    ########## CUSTOMIZE BELOW ##########
    $issue     = $RFC1153_ISSUE    || 1;
    $listname  = $RFC1153_LISTNAME || "UJA";
    $vol       = $RFC1153_VOL      || $year;
    $IssueSeq  = $RFC1153_SEQUENCE_FILE  || 
	"$FP_VARLOG_DIR/IssueSeq"; # file to remember count;

    &GetTime;
    &eval($RFC1153_CUSTOM_HOOK, 'RFC1153 custom:');
    $issue = &Rfc1153GetSeq($IssueSeq);

5.15	Mget Format: lzh + ish option

	mget 200-210 ish

enables "mget" to use lha and ish.

	$LHA = "/usr/share/bin/lha";
	$ISH = "/home/axion/fukachan/bin/ish";

"makefml" automatically set up them in config.ph but it is good for
you to check it again.

5.16	Convert to SJIS (Japanese) (lzh + ish and lhz + uuencode option)

When $USE_SJIS_IN_ISH = 1;, FML appends ^M in the last of each line
and ^Z in EOF. jcode.pl is required in @INC. FML does them by itself
not depending external commands.

6	Fml Processes

It is useful to customize FML if you know the fundamentals of ML
servers. In this chapter we describe fml internals.

6.1	Functions as  ML Server

	mail comes via SMTP.
		|
	MTA e.g. sendmail receives it.
	Here after we suppose MTA is sendmail. 
		|
	sendmail scans /etc/aliases and runs programs after setuid().
	sendmail runs and injects an in coming mail into the program.
		|
	sendmail -> fml.pl
	Fml.pl reads and evaluates config.ph and runs.
	It analyses the header, 
	authenticate the sender is a member or not.
	Fml distributes a ML article by passing it to MTA.
		|
	MTA delivers a passed mail to ML members.

It is enough to use "sed" for a filter and "sendmail" for delivery.
If you expect a mailing list driver works for logging, spooling and a
lot of commands to retrieve articles and so on, you need more
elaborate programs. Fml provides a lot of functions described below.

Fml provides, delivery, functions for a lot of commands, digest
delivery and so on. fml.pl is a delivery program and also provides
command functions.  Digest delivery (matome okuri) is another process. 
You must set up that cron executes msend.pl (digest delivery system)
periodically. 

6.2	How "sendmail -> fml.pl" works

How sendmail passes an in-coming mail to fml.pl? Here it is. Consider
Elena Mailing list as one example below.

Firstly sendmail scans /etc/aliases to find

	Elena: :include:/usr/local/list/Elena
	owner-Elena:fukachan

For Elena ML, sendmail executes the content of /usr/local/list/Elena.
The content of /usr/local/list/Elena is 

	"|/usr/local/fml/fml.pl /var/spool/ml/elena"

This implies that sendmail passes mail to fml.pl via PIPE (pipe(2)).
fml.pl receives mail via STDIN. fml.pl works with this input.

fml.pl recognizes the first argument /var/spool/ml/elena as HOME
directory of Elena ML. fml.pl reads /var/spool/ml/elena/config.ph and
sets up Elena ML configurations.

If you use command line options for fml.pl, please use like this.

	"|/usr/local/fml/fml.pl /var/spool/ml/elena --ctladdr "

Arbitrary order is available. fml.pl regards the first argument of
directory as ML's HOME (e.g. location of config.ph).

6.3	Order to search library files

Consider elena ML again. fml.pl is kicked off like 

	/usr/local/fml/fml.pl /var/spool/ml/elena

fml.pl extracts the directory path (/usr/local/fml) of fml.pl absolute
path. It searches OS for executable and libraries in the following
order

	1   /var/spool/ml/elena 
	2   /usr/local/fml 

If the following arguments are given,  

   "|/usr/local/fml/fml.pl /var/spool/ml/elena /usr/lib/uja /lib/aja"

fml.pl searches OS for executable and libraries like this:

	1   /var/spool/ml/elena 
	2   /var/spool/ml/etc/fml/
	3   /usr/local/fml 
	4   /usr/lib/uja
	5   /lib/uja

6.4	Priority of configuration file search

The evaluation order of configuration files is like this. 
"1" is most directive.

	1 command line options (e.g. fml.pl --ctladdr)
	2 sitedef.ph
	3 config.ph
	3 site_init.ph
	5 fml defaults

sitedef.ph and site_init.ph may be useful to be used as a common
configuration file over mailing lists e.g. to set up command search
path ,tar, gzip, ...

fml (after 2.2.1) searchs sitedef.ph and site_init.ph in the following
order:

				Example
	-----------------------------------------------
	$DIR			/var/spool/ml/elena/
	$ML_DIR/etc/fml/	/var/spool/ml/etc/fml/
	$EXEC_DIR		/usr/local/fml/
	perl standard path	@INC

It shoule exist in common directory.

	$ML_DIR/etc/fml/	/var/spool/ml/etc/fml/
	$EXEC_DIR		/usr/local/fml/

So it will be either of them. To avoid recnstructuing under
/usr/local/fml in version up, the first location in fml 2.2.1 search
path is $ML_DIR/etc/fml/.

6.5	fml.pl process (first stage) 

fml.pl scans the input mail and splits up it and save them in

	Header	$Envelope{'Header'}
	Body	$Envelope{'Body'}

In default fml.pl is not compatible with hml 1.6 (which is a mailing
list server may be used only in Japanese). The following descriptions
are of no means.

If the mode is compatible with hml 1.6, fml.pl checks the body.  Even
though fml.pl is not in the compatible mode, the check routine works
but the result is not used.

* checks the first $GUIDE_CHECK_LIMIT lines to find $GUIDE_KEYWORD.
  If found, FML sends back guide and do nothing except it.

* fml.pl scans the first $COMMAND_CHECK_LIMIT to change the mode from
distribution to command mode. The trap keyword is 
	^#(\s*\w+\s|^\#\s*\w+)
	^#$CHADDR_KEYWORD

In default

	$GUIDE_KEYWORD  = "guide";
	$CHADDR_KEYWORD = "chaddr|change-address|change";

6.6	fml process (second stage) 

After parsing, fml.pl sets up %Envelope, locks into critical region.
Under locked state, fml.pl main part works.

6.7	fml process, lock and signal handling

fml.pl uses flock(2) and alarm(3). It is standard technique on
UNIX. On Micro$oft Windows NT4 with activestate perl, flock(2) works
but alarm(3) does not work. We emulate it by Win32::Process. Under our
NT4 alarm emulation, timeout equals to "end of process".

sub Flock {

    &SetEvent($TimeOut{'flock'} || 3600, 'TimeOut') if $HAS_ALARM;
	...

    # signal handling
    $SIG{'ALRM'} = 'TimeOut';
    $SIG{'INT'}  = $SIG{'QUIT'} = 'SignalLog';

Flock timeout is defined by $TimeOut{'flock'}, default is 3600 seconds.

When timeout occurs, fml.pl notifies it to the maintainer, logs it and
exits. 

When flock(2) is not used, fml.pl uses link(2) based lock
algorithm. If timeout, fml.pl notifies it and exits. Please see
liblock.pl for more details.

6.8	Event Scheduler

fml.pl uses flock(2) and alarm(3). It is standard technique on
UNIX. Software trap by alarm(3) maintains event scheduling inside FML.
On Micro$oft Windows NT4 with activestate perl, flock(2) works but
alarm(3) does not work. We emulate it by Win32::Process. The emulation
is incomplete for the restriction of ntperl. We only enforce fml.pl
exits if timeout.

6.9	Another locking algorithm

fml.pl provides two lock algorithms, flock(2) and link(2) based lock
algorithm. In default fml.pl uses flock(2). flock(2) is used if

	$USE_FLOCK    = 1; (default 1)

link(2) based lock is used if

	$USE_FLOCK    = 0;

link(2) style lock is based on whether link(2) works or not. 
The lock file is 

	$LOCK_FILE

The default lock file is $DIR/var/run/lockfile.v7

	"$FP_VARRUN_DIR/lockfile.v7"

This lock algorithm is not fault tolerant e.g. in sudden death of OS
since the lock file is not removed. After the reboot, maintainer
should remove left lock files.  Just after reboot, remove all files
$FP_VARRUN_DIR/lockfile*. From this view, I recommends you that 
you should use the lock mechanism OS provides.

	"$FP_VARRUN_DIR/lockfile.v7"

Also in link(2) style, timeout is defined by $MAX_TIMEOUT. The mail is
saved in var/log. fml.pl notifies it to the maintainer.

FYI: flock(2)

	$LOCK_SH                       = 1;
	$LOCK_EX                       = 2;
	$LOCK_NB                       = 4;
	$LOCK_UN                       = 8;

         #include <sys/file.h>
         #define   LOCK_SH   1    /* shared lock */
         #define   LOCK_EX   2    /* exclusive lock */
         #define   LOCK_NB   4    /* don't block when locking */
         #define   LOCK_UN   8    /* unlock */
    
         int
         flock(int fd, int operation)

See e.g. A. S. Tannenbaum, "Modern Operating Systems" for exclusive locks.

7	FML internal data structures

Here we describe FML internal data structures. When you hacks FML,
this knowledge is required. However you do not need to read this
chapter if you toggle variables only on/off.

7.1	Naming convention of variables

* ^[A-Z0-9_]+$ name variable is USER DEFINED VARIABLE for customize.
It is a global variable. Fundamentally these variables are defined in
config.ph, sitedef.ph and site_init.ph.

	Example:	$MAIL_LIST

* Capitals are global not for USERS but for systems. In principle
  users should not touch them. If you hacks, it must require to handle
  these variable.

	$MailBody	$Reply_to
	%Envelope	*_cf

   %Envelope is the most important variable. We should not increase
   the number of global variables. Several variables e.g. @Fld 
   are capital but historically left not as global.

  ATTENTION: historically $debug is global for convenience.

* Lower case word is local variable. 

[Appendix]
Directory variables consists of two types

	$*_DIR 		relative path to $DIR
	$FP_*_DIR 	obsolete path

$FP_*_DIR is automatically defined based on directory variables.
In a lot cases absolute path is used.

	$FP_TMP_DIR
	$FP_VARDB_DIR
	$FP_VARLOG_DIR
	$FP_VARRUN_DIR
	$FP_VAR_DIR
    	$FP_SPOOL_DIR

7.2	Naming convention of functions

Except for a few cases, a function name is capitalized. The word after
"_" is also capitalized. It is similar to X11 style:D

* Some exceptions remains after fml 1.5.

File operation functions are defined as 

	f_function_name 	conversion interface

	Cnstr_function_name		constructor for this mode
	Destr_function_name		destructor for this mode

These are exceptional. In that age I should replace these naming
convention but still remains ;D

7.3	%Envelope (hash)

%Envelope is most important variable(hash). %Envelope contains header,
each field of the header, body as a hash table. This hash is passed in
a lot of function calls. It is similar to sendmail's struct ENVELOPE
e;

In the age of FML 1.5, perl 5 does not run. Hence we cannot use
e.g. the following style

	$Envelope->$Header->$From = "uja@domain";

It is represented by

	$Envelope{"h:From:"}  = "uja@domain";

":" is a separator. From: is a special syntax to identify this key is
a field.

Keys of %Envelope:

	KEY beginning with "h:" is a field of a header.

	h:Capital:	adjusted field data to use in delivery e.g. h:Subject:
	h:lower-case:	original field data e.g. h:subject:

	h:field:	header field 
			lower case name is original
			Capital is after changed.

	fh:field:	enforce a field to use this value

	oh:field:	enforce fml.pl to use original field value
			for this field

	GH:field:	enforce some value for field of command mail results
			and so on. used in GenerateHeader().

			reply-to: > From:

	Addr2Reply:	address to send a command result and so on

	[mode or method configurations]

	macro:x		corresponds to $x of sendmail

	mode:x		mode x is enabled.

	mci:mailer	Mail Connection Information
			mci:mailer is ipc or prog.

	[Internal Data]

	Header		original header
	Body		original mail body
	Hdr		header of sending mails out in distribute phase	

	message		message to send back to a sender
			for command results and others
	error		error message to send back to a sender

	MIME		ISO-2022-JP is detected (toggle Flag)
	UnixFrom	Unix From

	MIME		ISO-2022-JP is detected (toggle Flag)
	UnixFrom	Unix From
	Hdr2add		buffer when $SUPERFLUOUS_HEADER is set.
	nclines		number of lines for "# command" style lines
	nlines		lines of mail body
	preamble	preamble to put on mail body
	trailer		trailer to put on mail body

	tmp:x		temporary used

Example: Subject:

   $Envelope{'h:subject:'} is 
   an in-coming mail's original Subject: field value. 

   $Envelope{'h:Subject:'} is after cutting Re:'s and tags e.g. [Elena 100].

Example: In a header of distribution, used key of %Envelop is as follow:

        Field           key in %Envelope
	--------------------------------------- 
	Date: 		h:Date:
	From:		h:From:
	To: 		h:To:
	Subject: 	h:Subject:

7.4	Initialize data structures

Initialization of fml.pl is as follows:

	initialize $DIR $LIBDIR @INC and so on

	&InitConfig
	   &SetDefaults
		%Envelope
		DNS, @HdrFieldsOrder, and others

	   &LoadConfig
		$DIR/config.ph
		sitedef.ph

   	   &SetOpts
		command line options

	   COMPATIBILITY CODE

	&Parse

	&Parse
		reset %Envelope

	&GetFieldsFromHeader

	&GetFieldsFromHeader
		analyze %Envelope and set h:field: and h:Field: up.

	&FixHeaderFields

	&FixHeaderFields
		adjust h:Field:

	&CheckCurrentProc

	&CheckCurrentProc
		adjust fields, check loops, modes and so on

	After this fml.pl sets in the main routine,
	hooks are evaluated in several locations.

	Example:
		$START_HOOK
		$SMTP_OPEN_HOOK
		$FML_EXIT_HOOK

After this, the critical section begins. 

7.5	Directory variables

[Directory variable list]

		$DIR @INC(original) $LIBDIR ...

	$DIR

	$DIR
		config.ph location. ML's HOME directory.
		The argument of @INC.

	$LIBDIR	
		library paths. @LIBDIR is a list of $LIBDIR's.
		fml pushes $LIBDIR to @LIBDIR.
		fml searches @LIBDIR for executable and libraries

    	$SPOOL_DIR		$DIR/spool

    	$SPOOL_DIR		$DIR/spool
		spool of articles of ML

	[Relative path from $DIR]

	$TMP_DIR		tmp (temporary)
	$VARDB_DIR		var/db  (database, 4.4BSD like)
	$VARLOG_DIR		var/log (log, 4.4BSD like)
				$DIR/log is exceptional for backward 
				compatibility.
				($VARLOG_DIR/log is preferable)
	$VARRUN_DIR		var/run (4.4BSD like)
				pid's file and several caches
	$VAR_DIR		var (4.4BSD like)

	[Corresponding fully pathed directory variables]

	$FP_TMP_DIR		$DIR/$TMP_DIR
	$FP_VARDB_DIR		$DIR/$VARDB_DIR
	$FP_VARLOG_DIR		$DIR/$VARLOG_DIR
	$FP_VARRUN_DIR		$DIR/$VARRUN_DIR
	$FP_VAR_DIR		$DIR/$VAR_DIR
    	$FP_SPOOL_DIR		$DIR/$SPOOL_DIR

7.6	On temporary directory ($TMP_DIR)

$DIR/tmp is temporary working area. It is defined as $TMP_DIR. We
should not use the system's /tmp or /var/tmp if the file is left when
OS crashes.

7.7	Configuration files

[Member Lists]

	$MEMBER_LIST 	 	$DIR/members

	the ML member list for authentication. If a given address is
	not in this list, fml.pl does not authenticate the
	address. This is not a delivery list in non automatically
	registration mode. In automatic registration mode, this file
	is both a member and delivery list.

	$ACTIVE_LIST 		$DIR/actives

	list of distribution in non automatically registration mode.

	$REJECT_ADDR_LIST	$DIR/spamlist

	list to reject as a spammer.

[files of guides and so on]

	$OBJECTIVE_FILE	 	$DIR/objective

	objective of ML

	$GUIDE_FILE		$DIR/guide

	guide for general people (for not member)

	$HELP_FILE	 	$DIR/help

	help file of ML (for only member)

	$DENY_FILE	 	$DIR/deny

	file to send back when fml.pl rejects mail from a non member.
	This is not used in auto registration mode.

	$WELCOME_FILE	 	$DIR/guide

	file to send back in auto-registration mode when 
	a user is automatically registered. 

	$CONFIRMATION_FILE       $DIR/confirm

	confirmation file in auto-registration mode.
	Please see confirmation (how_to_subscribe 5.9).

[Logfiles]

	$LOGFILE	 	$DIR/log

	log file

	$MGET_LOGFILE    	$DIR/log

	mget log. In default $MGET_LOGFILE == $LOGFILE.

	$SMTPLOG		$VARLOG_DIR/_smtplog

	Log of SMTP (for debug).

	$SUMMARY_FILE 	 	$DIR/summary	

	summary of ML

	$SEQUENCE_FILE 	 	$DIR/seq

	ML's sequence number

	$MSEND_RC		$VARLOG_DIR/msendrc

	digest control file.

	$LOCK_FILE	 	$VARRUN_DIR/lockfile.v7

	lock file when not flock(2) lock but link(2) based.

	$LOG_MESSAGE_ID		$VARRUN_DIR/msgidcache

	Message-Id cache file to prevent loops.

	$MESSAGE_ID_CACHE_BUFSIZE

	Message-ID cache file size

	$INDEX_FILE		$DIR/index

	Fml.pl works without this file. If exists, "index" commands
	sends back this file. If not, FML scans $SPOOL_DIR,
	@ARCHIVE_DIR and sends back the summary.

7.8	Other useful variables

	$DO_NOTHING

	Special flag to declare "do nothing".

	$NULL

	dummy:D like "#define null (char *)0".

	$FML	

	process table name

	$FACE_MARK

	e.g. 	P(^^)
		Be seeing you P(^^)

	appended in the reply message, e.g. command results.

	$INCLUDE_SIM_PATH

	Please ignore this. This is used in simulation.

	$UNISTD

	Declare "Unix Standard" flag. undefined on Windows NT4

	$LOCKFILE

	lock file variable in some libraries. It may be uncontrolled
	by a user.

	%MAKE_FML

Please not touch %MAKE_FML in config.ph which variable "makefml" uses
though it is not used today.

* obsolete variables (renamed to)

   $GUIDE_REQUEST	-> $GuideRequest
   $RPG_ML_FORM_FLAG	-> $COMMAND_SYNTAX_EXTENSION

* obsolete

   $NON_PORTABILITY

7.9	Listing variables list

To dump variable used in fml.pl (by dumpvar.pl), sets 

	$DUMPVAR = 1;

FYI: fmlserv.pl uses the same technique to switch name spaces.

8	FML configuration files, formats and structures

Lists used in FML assumes shell like structures:
	a line with "#" is comment.
	skip null lines.

8.1	members file formats

Fml 2.2 REL provides the raw format to administrators but not raw
format to general users since general users should not know members
which unsubscribed the ML in the past. Please remember the following
format if you are an administrator.

The format of $MEMBER_LIST (default members) is

	#.FML
		comments put by fml
	#.endFML
	address-1
	address-2
	# address-3
	##BYE address-4
	address-5

   "# something" syntax is comment out but used for member check. 
   But it is not used for delivery.
   "##something" syntax is real comment out.

Hence fml.pl ignores "##BYE address-4" line but address-1,2,3,5 is
candidates for ML members. fml.pl compares a sender (From: line's
address) and address-1,2,3,5 for member check.

8.2	actives file formats

$ACTIVE_LIST (default actives) has a format similar to $MEMBER_LIST.

The format is 
	address		options		# comments

* available options:

	m=digest-options
	r=relay-server
	s=1 (skip)

8.3	Differences between $ACTIVE_LIST and $MEMBER_LIST

Please see above on formats. For functions see the chapter on
automatic registration (how_to_subscribe 5).  $MEMBER_LIST is used to
compare a sender (From: address) and addresses in lists to check the
sender is a member or not.  $ACTIVE_LIST is a list to distribute.
Under automatic registration (not auto_asymmetric_registration),
$MEMBER_LIST == $ACTIVE_LIST internally, fml does not read
$ACTIVE_LIST.

8.4	Plural member lists and delivery lists

You can define arrays
	@ACTIVE_LIST	plural member lists
	@MEMBER_LIST	plural delivery lists

fml automatically put $ACTIVE_LIST to @ACTIVE_LIST and uses
@ACTIVE_LIST as a distribute list. In the same way for MEMBER_LIST.

***

turn over actives/members list => daily 6.2

8.5	$MSEDN_RC format (digest control file msend.pl uses)

$MSEND_RC is used by msend.pl, the digest delivery program. The format
is

	address		the first sequence number to send in the next digest.

	msend.pl 
	* generates new user entries.
	* updates msendrc if digest is sent.
	* removes entry if the mode for a user 
	  is changed to real time delivery.

Only msend.pl control this file. 

8.6	Password file format

Password file ($PASSWD_FILE, in default $DIR/etc/passwd) format is

	address		crypted-password

FML can use MD5 password format file if you set

	$REMOTE_ADMINISTRATION_AUTH_TYPE = "md5";

This uses MD5.pm, so you must use perl 5. 

To initialize a new password, you can use "makefml passwd ML" and 
"admin initpass" command is available when remote administration.
Please see INSTALL for more details how to use makefml.

8.7	Maintenances

Let the configuration be like this 

	/usr/local/fml		executable and libraries
	/var/spool/ml/elena	elena ML home

"makefml install" installs executables and libraries to /usr/local/fml
and makes directory /var/spool/ml if it does not exist. makefml does
not touch files under /var/spool/ml/elena.  In version up, makefml
locks /var/spool/ml/elena before installing. It is just a difference
between initial installation and version up.

How should we maintenance mailing lists? You should set up all
configurations in files, config.ph, site*ph and uses hooks as could as
possible not hack original libraries. If you hack fml sources, version
up working overwrites them.  It is also useful for common settings in
ML's are /usr/local/fml/sitedef.ph or /usr/local/fml/site_init.ph.
9	Security 

9.1	On security

Fundamentally
	1	deny all
	2	permit explicitly things we believe as secure 
	3	ask ambiguous situations to a maintainer
		e.g. insecure syntax commands?

9.2	Security Check Routine

Two security policy concepts for security are typical.
	1 deny all, permit secure conditions
	2 permit all, deny known insecure conditions.

fml works under policy 1.

&SecureP function checks under the policy "1 deny all, permit secure
conditions". It restricts the fml command syntax. The rule is

    1 	ignore \w/\w , deny both ../ and .[a.]/
	permit special command syntax m=\d+.

    2   permit /^[\#\s\w\-\.\,\@\:]+$/

    3   A user can use %SECURE_REGEXP hash table.

	Example:
	$SECURE_REGEXP{'whois'} = 
	'\s*whois\s+\033\$[\@B][\041-\176]+\033\([BJ]\s*';

	%INSECURE_REGEXP to reject special patterns, 
	which you think as insecure.

    4   errors if syntax contains others.

Example: 

   summary				(permit)
   mget 1-20,30,last:20 mp 1		(permit)
   mget 10? mp 1			(denied in default)
   mget 1[012]? mp 1			(denied in default)
   chaddr fukachan@phys.titech.ac.jp fukachan@beth.phys.titech.ac.jp (permit)

   $SECURE_REGEXP{'whois'} = '\s*whois\s+\033\$[\@B][\041-\176]+\033\([BJ]\s*';

The pattern is related with UNIX shell.

Quoted from 4.4BSD:/usr/share/man/cat1/sh.0 
           Shell Patterns
    
           A pattern consists of normal characters, which match them-
           selves, and meta-characters.   The meta-characters are
           ``!'', ``*'', ``?'', and ``[''.  These  characters lose
           there special meanings if they are quoted.  When command
           or variable substitution is performed and the dollar sign
           or back quotes are not double quoted, the value of the
           variable or the output of the command is scanned for these
           characters and they are turned into meta-characters.
    
           An asterisk (``*'') matches any string of characters.   A
           question mark matches any single character. A left bracket
           (``['') introduces a character class.  The end of the
           character class is indicated by a ``]''; if the ``]'' is
           missing then the ``['' matches a ``['' rather than intro-
           ducing a character class.  A character class matches any
           of the characters between the square brackets.   A range
           of characters may be specified using a minus sign.  The
           character class may be complemented by making an exclama-
           tion point the first character of the character class.
    
           To include a ``]'' in a character class, make it the first
           character listed (after the ``!'', if any).  To include a
           minus sign, make it the first or last character listed

NOTE: 1998/11/08 permit "admin add MAR+KUN@DOMAIN " syntax

  +'ed user <addr+ext@domain> (for sendmail users):
	fix to permit this address syntax when automagic registration.
	but not fix to permit command with this addr beautifully.
	# so require more eloborate design

9.3	DNS Spoofing

If

	$LOG_CONNECTION = 1;

is defined, fml.pl logs the host address connecting to fml.pl running
server. The value is taken by getpeername(). The result is set in
$PeerAddr. You can use DNS check by this.

9.4	Address Spoofing

no answer since this spoof is in low layers.

9.5	SYN Flooding

no answer in lower layers.

9.6	Email address and RFC822 representation

For example, a famous fwtk firewall toolkit checks address
syntax. RFC822 permits a syntax but it may be insecure related to
sendmail's implementation.

RFC822 is theoretical limit of representation. The syntax does not
corresponds to usually used syntax.

9.7	smrsh.c

	"|program ..."

smrsh.c restricts executables run by sendmail. For example you can
restrict executables only in /usr/adm/sm.bin runs under this system.
In this case you should rewrite include file /usr/adm/sm.bin/fml.pl.
smrsh.c is in sendmail packages.

9.8	access(2) 

smrsh.c uses access();D but ...

--- NetBSD 1.2REL /usr/share/man/cat2/access.0

CAVEAT
     Access() is a potential security hole and should never be used.

4th Berkeley Distribution     September 15, 1996                             2

--- perl5.003/perl.c

	/* On this access check to make sure the directories are readable,
	 * there is actually a small window that the user could use to make
	 * filename point to an accessible directory.  So there is a faint
	 * chance that someone could execute a setuid script down in a
	 * non-accessible directory.  I don't know what to do about that.
	 * But I don't think it's too important.  The manual lies when
	 * it says access() is useful in setuid programs.
	 */

9.9	Precedence Priority

sendmail 8.8.5 operations manual tells:

             5.7.  P -- Precedence Definitions

                     Values for the "Precedence:" field may be defined
                using  the  P  control line.  The syntax of this field
                is:

                    Pname==num

                When the name is found in a "Precedence:"  field,  the
                message  class  is  set  to  num.  Higher numbers mean
                higher precedence.  Numbers less than  zero  have  the
                special  property  that if an error occurs during pro-
                cessing the body of the message will not be  returned;
                this  is  expected  to be used for "bulk" mail such as
                through mailing  lists.   The  default  precedence  is
                zero.  For example, our list of precedences is:

                    Pfirst-class=0
                    Pspecial-delivery=100
                    Plist=-30
                    Pbulk=-60
                    Pjunk=-100

                People  writing  mailing list exploders are encouraged
                to use "Precedence: list".  Older versions of sendmail
                (which discarded all error returns for negative prece-
                dences)  didn't  recognize  this  name,  giving  it  a
                default  precedence  of  zero.  This allows list main-
                tainers to see error returns on both old and new  ver-
                sions of sendmail.

9.10	4.4BSD vacation

     No message will be sent unless login (or an alias supplied using the -a
     option) is part of either the ``To:'' or ``Cc:'' headers of the mail.  No
     messages from ``???-REQUEST'', ``Postmaster'', ``UUCP'', ``MAILER'', or
     ``MAILER-DAEMON'' will be replied to (where these strings are case insen-
     sitive) nor is a notification sent if a ``Precedence: bulk'' or
     ``Precedence: junk'' line is included in the mail headers.  The people
     who have sent you messages are maintained as a db(3) database in the file
     .vacation.db in your home directory.

9.11	File and Directory Permission Default

umask(2) default is customizable.

	$FML_UMASK	for fml.pl
	$MSEND_UMASK	for msend.pl
	$UMASK	is used if neither $FML_UMASK nor $MSEND_UMASK is not defined.

9.12	Directory Permissions

When plural maintainers maintain mailing lists directory and they uses
fmlserv.pl also, group writable permission is required. However
sendmail denies such settings for security today in default. It is
desirable to prepare a user e.g. "fml" to maintenance mailing lists
configurations. Or you can change /etc/sendmail.cf
e.g. DontBlameSendmail.

	$USE_FML_WITH_FMLSERV

is automatically set up by fml.pl if fml.pl can find $DIR/../fmlserv
directory. If it is set, fml.pl recognizes it myself works with
fmlserv.pl. If HOME of fmlserv.pl exists not in $DIR/../fmlserv, you
need to set this variable manually in config.ph. $GID is also a
variable for fmlserv.pl.

9.13	On sendmail 8.8 check_* rule sets

Please see sendmail's book (bat book).

9.14	SMTP and Authentication

draft-myers-smtp-auth-11.txt (submitted to be Proposed Standard)
RFC2222 (SASL)

SASL: Simple Authentication and Security Layer

draft-hoffman-smtp-ssl-06.txt (SMTP over secured layer)

9.15	&system() function

Fml does not use perl's system() but the original &system(). When the
perl on OS has no fork(), we have to use perl's system(). On some
environment, a few commands cannot work well with our &system().

When some commands do not work well, try to set

	$INSECURE_SYSTEM = 1;  (default 0)

in config.ph. It may enable you to use the command.

On NT4, fml uses perl's system() since ntperl has no fork().

In any cases fml checks the syntax of arguments passwd to
system(). After checks, fml calls system().

10	Library Functions

I explain useful (I believe) library functions in this chapter.
Anyway here we go though choice depends on me.  The choice must be
random and does not cover the whole ;-D.

10.1	daemon (libutils.pl)

Let the current execution program be a daemon.

	&use('utils');
	&daemon;

Example:
	&use('utils');
	&daemon;
	work under daemon mode

&daemon detaches the current TTY and close STDIN,STDOUT,STDERR.

Example:

	$FML_EXIT_HOOK .= q#
		&use('utils');
		&daemon;
		exec("$LIBDIR/bin/cron.pl $DIR -a");
	#;

You may be required to set $NOT_USE_TIOCNOTTY? This function works well
on 4.x BSD, but I don't know how it works on other OS's.

10.2	Sendmail (libsmtp.pl)

SYNOPSIS
	&Sendmail($to, $subject, $body, @to);

	$to		recipient
	$subject	subject of mail to send
	$body		body of mail to send
	@to		recipients except $to 

10.3	SendFile (libsmtp.pl)

SYNOPSIS
	&SendFile($to, $subject, $file, $zcat, @to);

	$to		recipient
	$subject	subject of mail to send
	$file		a file to send
	$zcat		conversion flag (not used)
	@to		recipients except $to 

10.4	NeonSendFile (libsmtp.pl)

handling plural recipients and plural files to send.

SYNOPSIS
	&NeonSendFile(*to, *subject, *files);

	@to		recipients (array)
	$subject	subject of mail to send
	@files		array of files to send

10.5	Addr2FQDN              (fml.pl)

SYNOPSIS:
	&Addr2FQDN($addr);

If given $addr has no '@', we convert it to

	$addr@$FQDN

If $addr contains '@', return $addr.

10.6	AddressMatch           (fml.pl)

SYNOPSIS:
	&AddressMatching($addr1, $addr2)

compare $addr1 and $addr2, return 1 if they are the same.
return 0 if different.

10.7	MailListMemberP        (fml.pl)

SYNOPSIS:
	&MailListMemberP($addr)

search $addr in lists of member (member files are listed in
@MEMBER_LIST) and return the file name in which $addr if $addr is
found. return $NULL if fails.

10.8	MailListActiveP        (fml.pl)

SYNOPSIS:
	&MailListActiveP($addr)

search $addr in lists of active member (active member files are listed
in @ACTIVE_LIST) and return the file name in which $addr if $addr is
found.

10.9	Append2                (fml.pl)

SYNOPSIS:
	&Append2($string, $file)

appends $string to $file

10.10	AutoRegist             (libutils.pl)

SYNOPSIS:
	&AutoRegist(*Envelope);
	&AutoRegist(*Envelope, $string);

Auto Registration routine. The argument is *Envelope or *Envelope and
$string. If $string is given, the routine checks $string as an input.
If not, $Envelope{'Body'} which is mail body. 

10.11	ChangeMemberList       (libfml.pl)

Apply &DoChangeMemberList(@_) recursively up to
$ADDR_CHECK_MAX(default 10) times. It checks the given address little
by little severely. For example we check the address

	fukachan@sapporo.iij.ad.jp

up to 3 level, that is "iij.ad.jp" in default. If both
fukachan@iij.ad.jp and fukachan@sapporo.iij.ad.jp exist in member
file, we cannot determine this mail is from which person?  Hence we
require changing the address check level dynamically. Secondary FML
checks up to 4 levels, that is "sapporo.iij.ad.jp" and matches in
exacet and return TRUE.

Example: a list have two similar addresses with different levels.

	fukachan@iij.ad.jp
	fukachan@sapporo.iij.ad.jp

10.12	ChangePasswd           (libcrypt.pl)

SYNOPSIS:
	&ChangePasswd($PASSWD_FILE, $addr, $new)

Change the password for the address $addr. The new password is $new
and the password file is $PASSWD_FILE.  $new is a plain password.

10.13	CheckMember            (fml.pl)

obsolete. left for compatibility.

SYNOPSIS:
	 &CheckMember($addr, $list);

Check whether $addr appears in $list or not. 1 if found, 0 if fails.

10.14	CmpPasswd              (libcrypt.pl)

SYNOPSIS:
	&CmpPasswd($encrypt, $plain-passwd)

compare encrypted password $encrypt and input plain password
$plain-passwd.

10.15	CmpPasswdInFile        (libcrypt.pl)

SYNOPSIS:
	&CmpPasswdInFile($PASSWD_FILE, $addr, $pass)

check whether $addr with password $pass is valid in $PASWD_FILE.
If valid, $addr is authenticated.

10.16	Conv2mailbox           (fml.pl)

SYNOPSIS:
    &Conv2mailbox($from, *e)

Cut out only user@domain part from given string $from.

10.17	DecodeMimeStrings      (libMIME.pl)

SYNOPSIS:
	$s = &DecodeMimeStrings($s);

Decode MIME string to Japanese and return it.

10.18	Flock                  (fml.pl)

SYNOPSIS:
	&Flock();

flock(2) to $FP_SPOOL_DIR. 

After $Timeout{'flock'} (default 3600) under locked, we trap signal
SIGALRM and runs &Tick. In default fml.pl exits after timeout.

10.19	Funlock                (fml.pl)

unlock the lock on $FP_SPOOL_DIR. see flock(2)

10.20	GetID                  (libfml.pl)

SYNOPSIS:
	&GetID;

Return value in $SEQUENCE_FILE where the value is the last article
sequence.

10.21	GetTime                (fml.pl)

SYNOPSIS:
	&GetTime;

runs localtime(); and sets several global variables such as:

    $Now = sprintf("%02d/%02d/%02d %02d:%02d:%02d", 
		   $year % 100, $mon + 1, $mday, $hour, $min, $sec);
    $MailDate = sprintf("%s, %d %s %d %02d:%02d:%02d %s", 
			$WDay[$wday], $mday, $Month[$mon], 
			1900 + $year, $hour, $min, $sec, $TZone);

    $CurrentTime = sprintf("%04d%02d%02d%02d%02d", 
			   1900 + $year, $mon + 1, $mday, $hour, $min);

10.22	Lock                   (fml.pl)

SYNOPSIS:
	&Lock;

		&Flock;
	else 
		require liblock.pl;
		&V7Lock;

	if $USE_FLOCK 
		&Flock;
	else 
		# link(2) based lock algorithm (liblock.pl)
		require liblock.pl;
		&V7Lock;

10.23	Log                    (fml.pl)

SYNOPSIS:
	&Log($s);

Append $s string to $LOGFILE with date.

10.24	LogWEnv                (fml.pl)

SYNOPSIS:
	&LogWEnv($s, *e);

&LogWEnv($s, *e); is the same as

	&Log($s)
	$e{'message'} .= "$s\n";

Both Logs $LOGFILE and the messages &Notify uses.

10.25	Lookup (fml.pl)

SYNOPSIS:
	 &Lookup($addr, $list);

Check whether $addr appears in $list or not. 1 if found, 0 if fails.	

10.26	MailListActiveP	(fml.pl)

SYNOPSIS:
	&MailListActiveP($address);

ML member list contains $address? It return the file which contains it
or NULL if fails. 
Caution: $address is a member, so it is used in authenticaion. Whereas
this does not imply $address is a recipient in fml.

10.27	MailListMemberP	(fml.pl)

SYNOPSIS:
	&MailListMemberP($address);

$address is a recipient? This returns the file which contains it or
NULL if fails.

10.28	Mesg                   (fml.pl)

SYNOPSIS:
	&Mesg(*Envelope, $s);

&Notify sends a content $Envelope{'message'} to a user (From:
address). &Mesg() appends $s to $Envelope{'message'}.

	$Envelope{'message'} .= "$s\n";

10.29	NewSyslog              (libnewsyslog.pl)

newsyslog(8) like function.

10.30	Notify                 (fml.pl)

SYNOPSIS:
	&Notify;

Send an error, warning status report of commands mail reply.  The
content is $Envelope{'message'}.  The recipient is
$Envelope{'message:h:to'}, if not defined $Envelope{'Addr2Reply:'}.
The plural recipients is available by setting
$Envelope{'message:h:@to'}. The return mail subject is
$Envelope{'message:h:subject'}, if not defined, "fml status report
$ML_FN".

   Subject:	$Envelope{'message:h:subject'}

In the last of mail body, &Notify appends the buffer generated by a
function $PROC_GEN_INFO (default 'GenInfo') .

Also &Notify the buffer $Envelope{'error'} to ML maintainers.

In this mail, &Notify uses a good bye phrase and a face mark:D. You
define it by

	$GOOD_BYE_PHRASE	(good bye phrase)
	$FACE_MARK		(face mark)

	$GOOD_BYE_PHRASE = "\tBe seeing you!   ";

10.31	RunHooks               (fml.pl)

SYNOPSIS:
	&RunHooks;

If $FML_EXIT_HOOK is defined, runs it.

	eval $FML_EXIT_HOOK

10.32	ExecNewProcess		(fml.pl)

If $FML_EXIT_PROG is defined, runs it 

	exec $FML_EXIT_PROG;

10.33	SecureP                (fml.pl)

SYNOPSIS:
	&SecureP($request);

Check whether $request is safe or unsafe. Please use %SECURE_REGEXP
for an exceptional security check.

10.34	SendBackInOrder     (libfop.pl)

SYNOPSIS:
	&SendBackInOrder($returnfile, $total, $subj, $sleeptime, @to)

	$subj		Subject: 

	$returnfile	file to send
	$total		the number of split files
	$subj		subject
	$sleeptime	send once each $sleeptime
	@to		recipients

10.35	SocketInit             (libsmtp.pl)

SYNOPSIS:
	&SocketInit;

Initialize socket functions.

10.36	TurnOverW0             (libnewsyslog.pl)

SYNOPSIS:
	&NewSyslog'TurnOverW0($LOG_MESSAGE_ID);#';

Runs newsyslog. Example: runs newsyslog over $LOG_MESSAGE_ID.

10.37	Unlock                 (fml.pl)

Unlcok.

10.38	Warn                   (fml.pl)

SYNOPSIS:
	&Warn($subject, $body);

&Warn is the same as

	&Sendmail($MAINTAINER, $subject, $body);

Mails to $MAINTAINER. 

10.39	WholeMail              (fml.pl)

SYNOPSIS:	
	&WholeMail;

Return the whole mail with 3 SPACE CHARACTERS indent.  The indent
prevents strange MTA or MUA converting the mail body.  No conversion
is important for debug. I want to receive raw mail for debug!

If $MIME_CONVERT_WHOLEMAIL is set, we try MIME decoding of Japanese of
the mail body.

10.40	eval                   (fml.pl)

SYNOPSIS:
	&eval($eval_string)

Evaluate $eval_string.

10.41	ipc                    (libutils.pl)

SYNOPSIS:
	&ipc(*ipc, *r);

=
Interface of InterProcess Communication based on Berkeley Socket mechanism.

	$ipc{'host'}	host
	$ipc{'serve'}	port
	$ipc{'tcp'}	TCP/IP
	$ipc{'pat'}	struct sockaddr
	@ipc		input strings (array)
	$r		return value

10.42	system                 (libutils.pl)

SYNOPSIS:
	&system($s, $out, $in, $read, $write)

Executes $s. OUT FILE is $out, IN is $in. OUT FILE HANDLE is $write,
IN is $read.

If $s matches

    /[\$\&\*\(\)\{\}\[\]\'\\\"\;\\\\\|\?\<\>\~\`]/

&system does not run for security.

11	Porting to other Operationg Systems

11.1	Micro$oft NT 4.0

	$HAS_GETPWUID
	$HAS_GETPWGID
	$HAS_ALARM

are disabled when fml.pl on NT4. Also 

	$COMPAT_WIN32 = 1;

in some libraries.

11.2	sys/ Directory

    if ($COMPAT_ARCH)  { require "arch/${COMPAT_ARCH}/depend.pl";}

sys/OPERATING_SYSTEM/ directories are locations of architecture
dependent libraries or configuration files.

Appendix A	Naming Convention

Appendix A.1	Function Name

Capital by default. There are exceptional cases.

* function overload

use()
eval()
system()
daemon()

* mget3_*(): file operations

proc/libsendfile.pl:108:sub mget3 
proc/libsendfile.pl:334:sub mget3_SendingEntry
proc/libsendfile.pl:393:sub mget3_unlink
proc/libsendfile.pl:440:sub mget3_Init
proc/libsendfile.pl:472:sub mget3_Reset
proc/libsendfile.pl:483:sub mget3_Getopt
proc/libsendfile.pl:516:sub mget3_Search
proc/libsendfile.pl:587:sub mget3_SearchInArchive
proc/libsendfile.pl:687:sub mget3_MHExpand
proc/libsendfile.pl:704:sub mget3_V2search
proc/libsendfile.pl:738:sub mget3_V1search

fml_local, independent from fml itself.

libexec/fml_local.pl:689:sub sendback
libexec/fml_local.pl:725:sub getmyspool_nopasswd
libexec/fml_local.pl:740:sub getmyspool
libexec/fml_local.pl:799:sub getmyspool2
libexec/fml_local.pl:829:sub forward
libexec/fml_local.pl:874:sub discard{ 1;}
libexec/fml_local.pl:880:sub getback { &sendback(@_);}
libexec/fml_local.pl:884:sub getmyspool_pw { &getmyspool(@_);}

Appendix B	some debug information
Appendix B.1	loading order (in distrubution mode)

316:        require 'libloadconfig.pl'; &__LoadConfiguration('__KERN__');
57:         require 'default_config.ph';
73:             require("$DIR/config.ph");
318:        require 'libsmtp.pl';               # a library using smtp
474:        if ($COMPAT_ARCH)  { require "sys/$COMPAT_ARCH/depend.pl";}
476:        if ($DUMPVAR) { require 'dumpvar.pl'; &dumpvar('main');}
477:        if ($debug)   { require 'libdebug.pl';}

880:            require("module/$LANGUAGE/liblangdep.pl");
39:         require 'jcode.pl'; # not needed but try again
1363:       require 'libdist.pl';
768:        if ($CF_DEF && $RELAY_HACK) { require 'librelayhack.pl'; &RelayHack;}


		INDEX

/usr/bin/newsyslog                         ...   4.3 
access(2)                                  ...   9.8 
$ACTIVE_LIST                               ...   7.7 
@ACTIVE_LIST                               ...   8.4 
Addr2FQDN                                  ...   10.5 
AddressMatch                               ...   10.6 
Address Spoofing                           ...   9.4 
Append2                                    ...   10.9 
AutoRegist                                 ...   10.10 
'Body'                                     ...   6.5 
$CFVersion                                 ...   3.3 
$CHADDR_KEYWORD                            ...   6.5 
ChangeMemberList                           ...   10.11 
ChangePasswd                               ...   10.12 
$CHECK_MESSAGE_ID                          ...   4.2 
CheckMember                                ...   10.13 
ClearEvent                                 ...   6.8 
CmpPasswd                                  ...   10.14 
CmpPasswdInFile                            ...   10.15 
$COMMAND_CHECK_LIMIT                       ...   6.5 
$COMPAT_ARCH                               ...   11.2 
$COMPAT_FML20                              ...   3.6 
$COMPAT_WIN32                              ...   11.1 
$COMPRESS                                  ...   5.4 
$CONFIRMATION_FILE                         ...   7.7 
Conv2mailbox                               ...   10.16 
daemon()                                   ...   10.1 
DecodeMimeStrings                          ...   10.17 
$DEFAULT_MGET_SUBJECT (config.ph CFv2)     ...   5.2 
$DENY_FILE                                 ...   7.7 
$DIR                                       ...   6.3 
$DIR/etc/passwd                            ...   8.6 
DNS Spoofing                               ...   9.3 
$DO_NOTHING                                ...   7.8 
$DUMPVAR                                   ...   7.9 
dumpvar.pl                                 ...   7.9 
%Envelope                                  ...   7.3 
eval                                       ...   10.40 
ExecNewProcess                             ...   10.32 
$FACE_MARK                                 ...   7.8 10.30 
Flock                                      ...   10.18 
'flock'                                    ...   6.7 
flock(2)                                   ...   6.9 
$FLOCK_TIMEOUT(Obsolete)                   ...   6.7 
$FML	                                      ...   7.8 
$FML_EXIT_HOOK                             ...   5.5 
fml process                                ...   6 
$FP_SPOOL_DIR                              ...   7.1 
$FP_TMP_DIR                                ...   7.1 
$FP_VAR_DIR                                ...   7.1 
$FP_VARDB_DIR                              ...   7.1 
$FP_VARLOG_DIR                             ...   7.1 
$FP_VARRUN_DIR                             ...   7.1 
$FP_VARRUN_DIR/lockfile.v7                 ...   6.9 
Funlock                                    ...   10.19 
GetID                                      ...   10.20 
GetTime                                    ...   10.21 
$GID                                       ...   9.12 
$GOOD_BYE_PHRASE                           ...   10.30 
$GUIDE_CHECK_LIMIT                         ...   6.5 
$GUIDE_FILE                                ...   7.7 
$GUIDE_KEYWORD                             ...   6.5 
$GUIDE_REQUEST                             ...   7.8 
$HAS_ALARM                                 ...   11.1 
$HAS_GETPWGID                              ...   11.1 
$HAS_GETPWUID                              ...   11.1 
'Header'                                   ...   6.5 
$HELP_FILE                                 ...   7.7 
How to maintain the installed fml source   ...   8.7 
$INCLUDE_SIM_PATH                          ...   7.8 
$INDEX_FILE                                ...   7.7 
%INSECURE_REGEXP                           ...   9.2 
$INSECURE_SYSTEM                           ...   9.15 
InSecureP                                  ...   9.2 
ipc                                        ...   10.41 
$ISH                                       ...   5.4 5.15 
ish                                        ...   5.15 5.16 
$LHA                                       ...   5.4 5.15 
$LIBDIR                                    ...   6.3 
libnewsyslog.pl                            ...   4.3 
librfc1153.pl                              ...   5.14 
Lock                                       ...   10.22 
$LOCK_EX                                   ...   6.9 
$LOCK_FILE                                 ...   7.7 
$LOCK_NB                                   ...   6.9 
$LOCK_SH                                   ...   6.9 
$LOCK_UN                                   ...   6.9 
Log                                        ...   10.23 
$LOG_CONNECTION                            ...   9.3 
$LOG_MESSAGE_ID                            ...   7.7 
$LOGFILE                                   ...   7.7 
LogWEnv                                    ...   10.24 
lzh                                        ...   5.15 5.16 
$MAIL_LENGTH_LIMIT                         ...   5.7 
MailListActiveP                            ...   10.8 
MailListMemberP                            ...   10.7 
maintenance                                ...   8.7 
%MAKE_FML                                  ...   7.8 
$MAX_TIMEOUT                               ...   6.7 
@MEMBER_LIST                               ...   8.4 
$MEMBER_LIST                               ...   7.7 
Mesg                                       ...   10.28 
$MESSAGE_ID_CACHE_BUFSIZE                  ...   7.7 
mget                                       ...   5 
mget3                                      ...   5.3 
&mget3_SendingEntry                        ...   5.5 
%mget_list                                 ...   5.5 
$MGET_LOGFILE                              ...   7.7 
$MGET_MODE_DEFAULT                         ...   5.2 
$MGET_SEND_BACK_FILES_LIMIT                ...   5.8 
$MGET_SEND_BACK_SLEEPTIME                  ...   5.5 
$MGET_SUBJECT_TEMPLATE                     ...   5.2 
Micro$oft NT 4.0                           ...   11.1 
$MIME_CONVERT_WHOLEMAIL                    ...   10.39 
$MSEND_RC                                  ...   7.7 
%MSendOpt                                  ...   5.2 
NeonSendFile                               ...   10.4 
NewSyslog                                  ...   10.29 
&NewSyslog                                 ...   4.3 
newsyslog(8)                               ...   4.3 
@NEWSYSLOG_FILES                           ...   4.3 
$NEWSYSLOG_MAX                             ...   4.3 
$NOT_SHOW_DOCMODE (config.ph CFv2)         ...   5.2 
Notify                                     ...   10.30 
$NULL                                      ...   7.8 
$OBJECTIVE_FILE                            ...   7.7 
$PASSWD_FILE                               ...   8.6 
$PeerAddr                                  ...   9.3 
Precedence                                 ...   9.9 
$REJECT_ADDR                               ...   4.1 
$REJECT_ADDR_LIST                          ...   7.7 
RFC1153                                    ...   5.13 
&Rfc1153Custom                             ...   5.14 
RFC822                                     ...   9.6 
RFC934                                     ...   5.12 
$RPG_ML_FORM_FLAG                          ...   7.8 
RunHooks                                   ...   10.31 
%SECURE_REGEXP                             ...   9.2 
SecureP                                    ...   9.2 10.33 
SecureP Extension: %SECURE_REGEXP          ...   9.2 
SendBackInOrder                            ...   10.34 
SendFile                                   ...   10.3 
Sendmail                                   ...   10.2 
$SEQUENCE_FILE                             ...   7.7 
SetEvent                                   ...   6.8 
setsid()                                   ...   10.1 
$Sigarlm                                   ...   6.7 
site_init.ph                               ...   6.4 
sitedef.ph                                 ...   6.4 
SJIS (lha + ish / lha + uuencode)          ...   5.16 
$SLEEPTIME                                 ...   5.5 
smrsh.c                                    ...   9.7 
$SMTPLOG                                   ...   7.7 
SocketInit                                 ...   10.35 
struct envelope e;                         ...   7.3 
$SUMMARY_FILE                              ...   7.7 
SYN Flooding                               ...   9.5 
system                                     ...   10.42 
$TAR                                       ...   5.4 
Tick                                       ...   6.8 
$TMP_DIR                                   ...   7.6 
TurnOverW0                                 ...   10.36 
Unlock                                     ...   10.37 
$USE_FLOCK                                 ...   6.9 
$USE_FML_WITH_FMLSERV                      ...   9.12 
$USE_WARNING                               ...   5.6 
$UUENCODE                                  ...   5.4 
uuencode                                   ...   5.16 
vacation                                   ...   9.10 
$VARLOG_DIR/_smtplog                       ...   7.7 
version up                                 ...   8.7 
Warn                                       ...   10.38 
$WELCOME_FILE                              ...   7.7 
WholeMail                                  ...   10.39 
$ZCAT                                      ...   5.4 
