D. J. Bernstein
OFMIP: Old-Fashioned Mail Injection Protocol
What is OFMIP?
OFMIP, the Old-Fashioned Mail Injection Protocol,
is the de facto standard mail-injection protocol.
There is no de jure standard describing OFMIP.
OFMIP looks very much like SMTP.
Beware that OFMIP clients are often incorrectly labelled as SMTP clients.
What's the difference between OFMIP and SMTP?
An OFMIP server transforms each envelope address and each message text
received from the client,
according to rules defined by the server.
a typical OFMIP server will insert a Message-ID field
into any message that does not have one.
What changes are made by typical OFMIP servers?
Here are some common OFMIP transformations:
Many servers support more sophisticated transformations.
Add FQDNs to envelope addresses.
the OFMIP server at heaven.af.mil
might accept ``RCPT TO:<angels>''
and transform that address into email@example.com.
Note that an empty envelope address (``MAIL FROM:<>'') is left unchanged.
Convert local names to FQDNs.
For example, an OFMIP server
might accept ``RCPT TO:<postmaster@sun>''
and transform that address into firstname.lastname@example.org.
Some servers base their transformations on DNS lookups or local tables;
others use purely syntactic rules.
Rewrite address lists in the header.
For example, an OFMIP server might insert a comma into ``To: joe fred''
and then add FQDNs the same way as for envelope addresses.
Common address-list fields include From, Sender, To, Cc, and Reply-To.
Remove Bcc fields in the header.
RFC 822 requires that each message include a To, Cc, or Bcc field;
some OFMIP servers will add ``Cc: recipient list not shown: ;''
if the message has neither To nor Cc.
Add a Date field if the message does not have one.
RFC 822 requires that each message include a Date field.
Convert bare LFs into CR LF.
How is OFMIP used?
Many sites use OFMIP servers, instead of SMTP servers,
to receive incoming mail on port 25.
This is dangerous.
A typical OFMIP server's transformations
are appropriate for outgoing mail but not for incoming mail.
Other sites provide SMTP servers to receive incoming mail,
and provide separate OFMIP servers for the benefit of authorized clients.
Some sites run OFMIP on TCP port 26.
It is safe to use port 25 on a host that does not receive incoming mail.
An OFMIP client lets the user supply the name or IP address of an OFMIP server.
Some clients, unfortunately, always connect to port 25.
Many clients support the syntax mail.af.mil:26 for port 26 on mail.af.mil.
What about port 587?
TCP port 587 has been set aside for the SUBMIT protocol,
which is very similar to OFMIP.
Unfortunately, the SUBMIT specification has several fundamental flaws
that make compliance practically impossible.
I advise against all use of port 587.