RMAIL
=====

RMAIL is one of the most important programs in the Hermes distribution.
All mails, both incoming and locally generated, pass through RMAIL on
their way to their respective recipients. As need be, RMAIL will deliver
mail locally and/or route it to one of the neighbouring sites (both can
happen to a single mail message).

RMAIL is meant to be called from the DOQUEUE script, but it can be
called interactively. It scans the MAILQ folder for mail files and
processes them.

RMAIL can understand bang addressed (relay!host!user), internet addresses
(user@host.domain), % addressed (user%host@relay). I can route domains
that are only partially known. Mixed addresses like foo!user@bar will be
interpreted as internet addressed with a funny local part rather than as
a bang address with a funny right side, i e it foo!user@bar goes to bar,
then to foo!user. RMAIL tries to avoid mixed addressed, if possible.

All local addresses are case-insensitive. A couple of local addresses
are always mapped to whatever user is named the postmaster in CONFIG.SYS:
"MAILER-DAEMON", "news", "postmaster", "usenet", and "uucp". This means
that no user with one of these names can ever get any mail unless
she is named as the postmaster in the CONFIG.SYS file.

RMAIL reads routing information from the MDBS file if it is present,
otherwise the PATHS file is used. The cost field (option -c to PATHALIA)
is silently ignored.

For non-local mail, RMAIL generated input files for BATCHMAI in the
spool directory of the appropriate site. BATCHMAI must be used to
complete the mail spooling.

RMAIL will honour Return-Receipt-To: and X-Acknowledge-To: header lines
for locally delivered mail.

RMAIL will append local mail to the user's mailbox file, creating it
if necessary. The mailbox file has the same name as the user and is
located in the MAILDIR folder.

If RMAIL encounters addressed it cannot handle (unknown local users;
unknown sites and no RELAY defined in CONFIG.SYS; unparsable addresses),
it generates an error mail to the sender with a carbon copy to the
local postmaster (again, as defined in CONFIG.SYS).

If RMAIL tells you that a mailbox file is locked, and you know for sure 
that no other program that has it open is running, reset the "read-only" 
attribute of that file.
