RFC 2442
The Batch SMTP Media Type
The Batch SMTP Media Type โจ
okay bestie, this is RFC 2442 ๐ฎ and it's all about how to wrap up an SMTP conversation inside a MIME package. Here's the title block tea โ:
- Network Working Group, RFC number 2442
- Authors: N. Freed (Innosoft), D. Newman (Innosoft), J. Belissent (Sun Microsystems), M. Hoy (Mainbrace)
- Category: Informational
- Date: November 1998
- Obsoletes / Updates: the title block doesn't list either one ๐
it's Informational, so it's giving "here's some helpful info" and NOT an Internet standard. the status section spells it out ๐ซถ
Status of this Memo
this memo gives info to the Internet community ๐ธ it does not specify an Internet standard of any kind, and distribution of it is unlimited.
Copyright Notice
Copyright (C) The Internet Society (1998). All Rights Reserved. ๐
Abstract
okay so this doc defines a MIME content type that's perfect for tunneling an ESMTP [RFC-821, RFC-1869] transaction through any MIME-capable transport ๐ฆ and it's giving main character energy because it can be used for a few things:
- extending end-to-end MIME-based security services (e.g., [RFC-1847]) so they cover the message envelope info as well as the message content ๐
- making it possible to use specific SMTP extensions, like NOTARY [RFC-1891], over unextended SMTP transport infrastructure โจ
- enabling the transfer of multiple separate messages in a single transactional unit ๐
Requirements Notation
this doc sometimes uses words in capital letters ๐ when the terms "MUST", "MUST NOT", "SHOULD", "SHOULD NOT", and "MAY" show up capitalized, they're flagging particular requirements of this spec. the meanings of "MUST", "SHOULD", and "MAY" get discussed in [RFC-1123], and "MUST NOT" and "SHOULD NOT" are logical extensions of that same usage ๐ง
The Application/batch-SMTP Content Type
the "application/batch-SMTP" MIME content type is a container for the client side of an SMTP or ESMTP transaction ๐ฆ like traditional SMTP, the contents are line oriented, and CRLF line terminators MUST be used ๐
the "application/batch-SMTP" type is defined like this:
Media type name: application
Media subtype name: batch-SMTP
Required parameters: none
Optional parameters: required-extensions
Encoding considerations:
8bit material may appear, so quoted-printable or base64
encoding may be necessary on transports that do not
support 8bit. While the content of this type is
line-oriented and uses conventional CR/LF terminators,
lines longer than 7bit and 8bit encodings allow (998
octets) may appear, hence quoted-printable or
base64 encoding may be necessary even in conjunction
with 8bit transports.
Security considerations:
Discussed in the Security Considerations Section.
How application/batch-SMTP is used
here's the vibe check on how the type is meant to flow ๐
application/batch-SMTP object
+----------------+
| |
+-----------+ v +----------+ v +-----------+
| batch | | MIME- | | batch |
=> | SMTP | => | capable | => | SMTP | =>
| generator | |transport | | processor |
^ +-----------+ +----------+ +-----------+ ^
| |
+-- conventional SMTP/RFC822 message transaction --+
so a regular SMTP message transaction gets turned into an application/batch-SMTP object by the batch SMTP generator ๐ช then that object rides over some kind of MIME-capable transport. once it reaches the destination, a batch SMTP processor takes it and converts it back into a conventional SMTP message transaction ๐ฆ
Generation of application/batch-SMTP material
application/batch-SMTP material is generated by a specially modified SMTP client that's operating without a matching SMTP server ๐ซ the client just assumes a successful response to every command it sends, and the result is the collected output from the SMTP client โจ
Honoring SMTP restrictions
most batch SMTP processors will be built by modifying and extending existing SMTP servers ๐ ๏ธ so all of the restrictions on SMTP constructs imposed by RFC 821, RFC 1123, and RFC 1869 MUST be observed ๐ especially the limits on command and data line lengths, the number of recipients, and so on. those still exist and still apply to batch SMTP, no cap ๐ โโ๏ธ
Use of SMTP Extensions
since there's no SMTP server present, the client has to be ready to make certain assumptions about which SMTP extensions can be used ๐ง the generator MAY assume that ESMTP [RFC-1869] facilities are available, so it's totally fine to use the EHLO command plus extra parameters on MAIL FROM and RCPT TO. if EHLO is used, it MAY assume that the 8bitMIME [RFC-1652], SIZE [RFC-1870], and NOTARY [RFC-1891] extensions are available. and yes, NOTARY SHOULD be used ๐ฅ
a generator MAY create private bilateral agreements that specify the availability of additional SMTP extensions ๐ค but additional SMTP extensions MUST NOT be used without such an agreement. and perhaps more importantly, a conformant generation of application/batch-SMTP objects MUST be able to produce objects restricted to the extensions listed above ๐
the "required-extensions" content type parameter MAY be used to communicate a list of the extensions that were actually used, written as a comma-separated list of EHLO responses ๐ if it's absent, it defaults to the list "8bitMIME,SIZE,NOTARY". and any use of additional or different extensions by private bilateral agreement MUST be noted in the "required-extensions" parameter ๐
reminder: lots of SMTP extensions just don't make sense for batch SMTP ๐ for example, the pipelining extension [RFC-2197] makes no sense without a network connection.
Handling Multiple Messages
generators SHOULD attempt to minimize the number of messages placed in a single application/batch-SMTP object ๐ ideally there's one application/batch-SMTP object per message. BUT some uses (like mail bagging) may exist purely to take advantage of the multiple-messages-in-one-container capability of batch SMTP, so requiring one message per container just isn't possible ๐
DISCUSSION: SMTP lets you transfer a series of messages over a single connection, and that extends naturally to batch SMTP ๐ธ the issues are a little different though. imagine a batch SMTP processor gets an application/batch-SMTP object with two messages, but it can't process the second one because of a storage allocation failure ๐ญ and the failure doesn't just block the second message, it also blocks recording that the first message was already processed. then reprocessing the application/batch-SMTP could duplicate the first message. yikes ๐
this isn't materially different from the well-known SMTP synchronization problems that in practice often lead to duplicated messages. since that behavior is inherent in SMTP to begin with, it's not incumbent on application/batch-SMTP to fully solve it. still, it seems prudent for application/batch-SMTP to try not to make matters even worse ๐ซถ
Transport of application/batch-SMTP objects
application/batch-SMTP objects may be carried by any transport that can preserve their MIME labelling, e.g., HTTP or SMTP ๐
transports MUST stay aware of how special application/batch-SMTP is ๐ an application/batch-SMTP object contains one or more "frozen" SMTP message transactions. those transactions usually come with assumptions about quality of service, like: messages will either be delivered successfully or a nondelivery notification will come back, a nondelivery notification will come back if delivery can't happen in a timely fashion, and so on ๐ฅบ it's vital that wrapping these objects for other kinds of transport doesn't interfere with those capabilities ๐
Processing of application/batch-SMTP material
processing application/batch-SMTP material is WAY more complex than generating it ๐ค as you'd expect, a modified SMTP/ESMTP processor gets used. but since it can't send information back to the client, it has to handle all of the error conditions that come up by itself. so a batch SMTP processor takes on the responsibilities of a traditional SMTP server AND part of the responsibilities of a traditional SMTP client ๐
so a conforming processor has a checklist ๐
- a conforming processor MUST check MIME content type information to insure that the material it's been given is labelled as application/batch-SMTP and doesn't specify any extensions the processor doesn't support in the "required-extensions" parameter ๐
- application/batch-SMTP objects that use an unsupported extension SHOULD be forwarded to the local postmaster for manual inspection and handling ๐จ
- MUST accept any syntactically valid EHLO or HELO command ๐ฌ
- MUST accept any syntactically valid MAIL FROM command ๐
- a conforming processor MAY, if it so desires, note that some part of a given MAIL FROM command is unacceptable, and use that info to later generate non-delivery notifications for any or all recipients ๐ โโ๏ธ
- MUST accept any syntactically valid RCPT TO command ๐ฌ
- a conforming processor SHOULD note that some part of a given RCPT TO command is unacceptable, and then use that to generate a non-delivery notification for that recipient instead of actually delivering the message ๐ซก
- MUST accept any of the additional parameters defined by the 8bitMIME, SIZE, and NOTARY SMTP extensions on the MAIL FROM and RCPT TO commands โจ
- MUST accept the DATA command even when no valid recipients are present ๐
- 8bit MIME messages MUST be accepted ๐
- MUST accept the RSET command and handle multiple messages in a single application/batch-SMTP object ๐งบ
- processors MUST process each message in an application/batch-SMTP object once, and SHOULD take whatever steps are necessary to avoid processing a message more than once ๐ for example, if processing of an application/batch-SMTP object containing multiple messages gets interrupted at an intermediate point, it should subsequently be restarted at the end of the last message that was completely processed ๐ชง
- SHOULD forward any syntactically invalid application/batch-SMTP message to the local postmaster for manual inspection and handling ๐ง
Security Considerations ๐
Okay bestie, this section is SERIOUS ๐ญ. Application/batch-SMTP is a tunneling mechanism, and tunneling mechanisms are prone to abuse because they can give someone a way to sneak past existing security restrictions. For example, an application/batch-SMTP tunnel running over an existing SMTP transport might let someone get around the relay restrictions that exist to stop spam from being redistributed. Not cute. ๐
Tunnels are sneaky little things, so the people running them need to be careful about who gets to use them. ๐ต๏ธโโ๏ธ
Application/batch-SMTP processors SHOULD implement access restrictions designed to limit access to the processor to authorized generators only. (Note that this facility may be provided automatically if application/batch-SMTP is being used to secure message envelope information.) ๐ซถ
Acknowledgements ๐
Okay so the general concept of batch SMTP has been around for ages ๐ฆ. One particular type was defined by Alan Crosswell and used on BITNET to get around BITNET's native 8 character limit on user and host names. The catch is that this version had the server send the status code responses back to the client, which meant the client had to match up those responses with the original SMTP dialogue after the fact. That was a lot of work for the client. ๐ฉ
Unfortunately, this approach didn't work well in practice. BITNET eventually switched to the same basic form of batch SMTP that's defined here. The thing is, to the best of the present authors' knowledge, that definition was never written down in a formal specification. Also, this definition is different in that it takes SMTP extensions into account. โจ
Einar Stefferud had already been thinking about the problem of carrying extended SMTP messages over unextended SMTP transports. He proposed that some form of "double enveloping" technology be developed to solve it. The mechanism presented here basically implements the kind of solution he proposed. Iconic behaviour from a legend ๐.
References ๐
[RFC-821] Postel, J., "Simple Mail Transfer Protocol", STD 10, RFC 821, August 1982. ๐
[RFC-822] Crocker, D., "Standard for the Format of ARPA Internet Text Messages", STD 11, RFC 822 August 1982. ๐
[RFC-1123] Braden, B., "Requirements for Internet Hosts -- Application and Support", STD 3, RFC 1123, October 1989. ๐ธ
[RFC-1652] Klensin, J., Freed, N., Rose, M., Stefferud, E. and D. Crocker, "SMTP Service Extension for 8bit-MIMEtransport", RFC 1652, July 1994. ๐
[RFC-1847] Galvin, J., Murphy, S., Crocker, S. and N. Freed, "Security Multiparts for MIME: Multipart/Signed and Multipart/Encrypted", RFC 1847, October 1995. ๐
[RFC-1869] Klensin, J., Freed, N., Rose, M., Stefferud, E. and D. Crocker, "SMTP Service Extensions", STD 10, RFC 1869, November 1995. ๐ฆ
[RFC-1870] Klensin, J., Freed, N., Moore, K., "SMTP Service Extension for Message Size Declaration", STD 10, RFC 1870, November, 1995. ๐
[RFC-2045] Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part One: Format of Internet Message Bodies", RFC 2045, December 1996. ๐งฉ
[RFC-2046] Freed, N. and N. Borenstein, "Multipurpose Internet Mail Extensions (MIME) Part Two: Media Types", RFC 2046, December 1996. ๐งฉ
[RFC-2197] Freed, N. and A. Cargille, "SMTP Service Extension for Command Pipelining", RFC 2197, September 1997. โก
Authors' Addresses ๐
Ned Freed
Innosoft International, Inc.
1050 Lakes Drive
West Covina, CA 91790
USA
Phone: +1 626 919 3600
Fax: +1 626 919 3614
EMail: ned.freed@innosoft.com
Dan Newman
Innosoft International, Inc.
1050 Lakes Drive
West Covina, CA 91790
USA
Phone: +1 626 919 3600
Fax: +1 626 919 3614
EMail: dan.newman@innosoft.com
Mark Hoy
Mainbrace Corporation
1136 West Evelyn Avenue
Sunnyvale, CA 94086
tel: +1 408 774 5265
fax: +1 408 774 5290
email: mark.hoy@mainbrace.com
Jacques Bellisent
SunSoft
Phone: +1 650 786 3630
EMail: jacques.belissent@eng.sun.com
Full Copyright Statement ๐
Copyright (C) The Internet Society (1998). All Rights Reserved.
This document and translations of it may be copied and furnished to others, and derivative works that comment on or otherwise explain it or assist in its implementation may be prepared, copied, published and distributed, in whole or in part, without restriction of any kind, provided that the above copyright notice and this paragraph are included on all such copies and derivative works. However, this document itself may not be modified in any way, such as by removing the copyright notice or references to the Internet Society or other Internet organizations, except as needed for the purpose of developing Internet standards in which case the procedures for copyrights defined in the Internet Standards process must be followed, or as required to translate it into languages other than English.
The limited permissions granted above are perpetual and will not be revoked by the Internet Society or its successors or assigns.
This document and the information contained herein is provided on an "AS IS" basis and THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. ๐
๐ฆ where this page comes from
- ietf: rfc2442 1998-11
- ๐ girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms