MMAIL
=====

MMAIL is an auxiliary program that is, as a rule, only called from
other programs (e g, the file server, the reflector, and GUS as well)
to put mails and news articles into the MQUEUE. MMAIL will convert all
special characters from the ST character set to ISO 8859/1 (but see
option -7). MMAIL is not meant to be called directly, but the mode of
operation is discussed here nonetheless for the benefit of third-party
software developers. MMAIL prints a usage summary if called without
arguments.

The mysterious syntax has (you guessed it) historical reasons. MMAIL
was first written a long time ago, when the Mercury news reader was
supporting a reply option (using a subset of this syntax), but the
program to understand this syntax was missing. So I wrote the first
version of MMAIL. The syntax has been extended many times sice then,
but it has never been fundamentally changed --- why bother?

MMAIL recognises a number of options:

-6
	Activates base-64 content type encoding. Use it sparingly, as
	few people will be able to read your mail!

-7
	"7 bit": Assumes the data file consists only of 7-bit characters
	(this is not verified!), and suppresses ST-to-ISO conversion.
	Faster.

-e <editor>
	Names the editor program. Supersedes the system-wide default editor
	as given in CONFIG.SYS. This is meaningless if -n is given.

-f <user>
	Special use only! <user> will be used as the sender's name in the
	envelope ("From " line), hopefully diverting error mails from the
	real sender (whose name appears in the "From:" line).

-k
	"Keep": Control and data files (see below) will not be erased
	after completion. Unless this option is given, MMAIL will erase both
	the control and the data file after completion!

-n
	"Non-interactive": Do not start the editor, and do not ask questions.
	This also suppresses warning messages. This option is meant to
	be used by programs that post or mail automatically, like reflectors
	or file servers, in contrast to interactive programs.

-q
	Selects quoted-printable content type encoding.

-r <control file>
	This option is only needed if the control file is not the last
	argument on the command line.

-s
	"(no) Signature": Suppresses recognition of signature files (see
	below).

THE CONTROL FILE

The control file describes a news or mail message. It is a simple text
file that consists of lines. Each line is processed individually, the
ordering of lines is (as a rule) of no importance. Each line consists
of two parts: A one-character line id, and a value. If there is white
space after the line id character, it is considered part of the value
(this might not be exactly what you want). Each line id may be present
only once in any one control file. Line ids are listed below. Most of
them specify the contents for header fields.

	1
		Names the data file. The data file contains the mail or news
		message to be sent (body only). If -n is not given, the editor
		will be called to allow the user to edit this file. If -n is
		not given, no line of this type need be present.

	2
		Subject: header.

	3
		Recipient or list of newsgroups. See line id 4.

	4
		Distribution. If such a line is present in the control file,
		even if it is empty (i e, a line consiting only of the character
		"4"), MMAIL assumes a news article. If no such line is present,
		MMAIL assumes a mail message.

	5
		Keywords: header. (Optional.)

	6
		Summary: header. (Optional.)

	7
		Followup-To: header. (News only, optional.)

	8
		References: header. (News only, optional.)

	9
		Reply-To: header. (Optional.)

	a
		Cc: header. (Mail only, optional.) Recipients listed in the Cc:
		header will receive the mail, so don't list them in the recipients
		line (line 3).

	b
		To: header. (Mail only, optional.) The default is to copy the
		contents of line 3 to the To: header. If you give a different
		address (or list of addresses) in line b, the mail message will
		still be sent to those addresses listed in lines 3 and a.

	c
		X-Software: header. (Optional.)

	d
		Return-Receipt-To: header. (Mail only, optional.)

	e
		Errors-To: header. (Mail only, optional.)

	f
		In-Reply-To: header. (Mail only, optional.)

	g
		Content-Type: header. (Optional, default will be generated.)
		
	h:
		Control: header. (News only, optional)
		
Just another quick note about lines 3, a, and b: Line b is used by the
file server to include the orignal address in the header while performing
private routing and storing the result in line 3. Addresses listed in
line a will receive the mail regardless of what is in lines 3 and b.

If you edit the control file lines (edit header command in interactive
mode), remember to edit line 3 if you edit line a and vice versa!

ALIASES

MMAIL can understand aliases. Two files are searched for resolution of
address aliases: the user-specific file $HOME/alias (if any), and the
system-wide alias file as specified in CONFIG.SYS (if any). Alias files
are composed of lines consisting of the name of the alias, white space,
and a list of addresses this alias expands to.

SIGNATURES

MMAIL is also the program to append signature files. First, the user's
system file directories is searched for a file named SIGNATUR. If no such
file is found, the files SIGNATUR.MAI (for mail) or SIGNATUR.NET (for news)
are used. Thus, you can have different signature files for mail and news,
but you don't have to. The user's system file directories are a directory
called HERMES in the user's home directory and the user's home directory
itself.

ADDITIONAL HEADER LINES

MMAIL can automatically add header lines to your mail and news messages.
If there is a file called HEADER (or HEADER.MAI, or HEADER.NET, see
under SIGNATURES), it will be appended to the header that MMAIL generates.
Take care, few validity checks are done on the contents of that file!
Do not use 8-bit characters! You can, however, use CRLF line breaks,
they will be converted.

DEAD LETTERS AND ARTICLES

If you cancel a letter or article from within MMAIL, a copy of your
edited text is saved in your home directory as DEAD.LET or DEAD.ART,
respectively.
