RFC 743
FTP extension: XRSQ/XRCP
FTP extension: XRSQ/XRCP β¨
Title block tea: this is RFC 743 (also NIC 42758) from the Network Working Group π. It was written by K. Harrenstien of SRI-KL and dated 30 December 1977. The header stamp reads KLH, 30-Dec-77 08:39, 42759. This copy doesn't list a category or status, and it doesn't say what it obsoletes or updates, so there's nothing to report there π€·ββοΈ
okay so this RFC is about an FTP extension for ITS FTP servers (the ones on MIT-(AI/ML/MC/DMS)) π¬ It lets you mail the text of one message to several recipients all at once. That's way more efficient than sending the same text over and over for every extra recipient at a site π
Within this extension, there are two basic ways to send one text to several recipients π¦ In the first, you name all the recipients first and then send the text. In the second, it's flipped: text first, then recipients. Both ways are needed because neither one is best for every system, which gets explained later. To pick a scheme you use XRSQ, to name recipients after picking you use XRCP, and to provide the text the usual MAIL or MLFL commands apply π
Scheme Selection: XRSQ π
XRSQ is how a user program checks whether XRSQ/XRCP is implemented, picks a scheme, resets its state, and even does a little bit of rudimentary negotiation π Its format is like the TYPE command:
XRSQ [<SP> <scheme>] <CRLF>
<scheme> = a single character. The following are defined:
R Recipients first. If not implemented, T must be.
T Text first. If this is not implemented, R must be.
? Request for preference. Must always be implemented.
No argument means a "selection" of none of the schemes (the
default).
And here are the replies:
Replies:
200 OK, we'll use specified scheme.
215 <scheme> This is the scheme I prefer.
501 I understand XRSQ but can't use that scheme.
5xx Command unrecognized or unimplemented.
See Appendix A for more about the choice of reply codes.
Three things about XRSQ need pointing out π First, a bare XRSQ with no argument has to always come back with a 200 and put you back to having no scheme selected. Any other reply means XRSQ, and therefore XRCP, isn't understood or can't be done correctly π
Second, using "?" as the <scheme> asks the FTP server for a 215 reply where the server names its "preferred" scheme β¨ The format is simple:
215 <SP> <scheme> [<SP> <arbitrary text>] <CRLF>
Any other reply (like a 4xx or 5xx) means XRSQ and XRCP aren't implemented, because "?" has to always be implemented if XRSQ is π
Third, XRSQ always has the side effect of resetting all schemes to their initial state π§ That reset happens no matter what the reply is (200, 215, or 501). The actual reset steps get explained when we talk about how each scheme works.
Message Text Specification: MAIL/MLFL π
No matter which scheme (if any) is selected, a MAIL or MLFL with a non-null argument behaves exactly as it did before. This extension doesn't touch them π«Ά BUT those normal MAIL/MLFL commands do have the same side effect as XRSQ: they "reset" the current scheme to its initial state. Lowkey sneaky π€«
It only matters which scheme is in use when the argument is null (like MAIL<CRLF> or MLFL<CRLF>). Instead of throwing an error (which most servers do right now), the server will accept message text for this "null" specification π What it does with that text depends on the scheme in effect, and that's covered in "Scheme Mechanics".
Recipient specification: XRCP π¨
To specify recipient names and get an acknowledgement (or a refusal) for each name, there's a new command:
XRCP <SP> <Recipient name> <CRLF>
Reply for no scheme:
507 No scheme specified yet; use XRSQ.
Replies for scheme T are identical to those for MAIL/MLFL.
Replies for scheme R (recipients first):
200 OK, name stored.
440 Recipient table full, this name not stored.
450 Recipient name rejected. (Permanent!)
520 Recipient name rejected.
4xx Temporary error, try this name again later.
5xx Permanent error, report to sender.
See Appendix A for more about the choice of reply codes.
Using this command is an error if no scheme has been selected yet π ββοΈ You have to give an XRSQ <scheme> before XRCP is usable.
Scheme mechanics: XRSQ R (Recipients first) π
In the recipients-first scheme, XRCP is used to name recipients, and the FTP server stores them in a list or table π Usually, each XRCP gets either a 200 for accepted, or a 4xx/5xx for rejected. A 450 and all the 5xx codes are permanent rejections (like "user not known") that should be reported to the human sender π¬ A 4xx in general means a temporary error that might be fixed later β³ None of the 4xx/5xx replies mess with the XRCPs before or after them, EXCEPT for 440, which means no more XRCPs will succeed unless a message gets sent to the recipients already stored, or a reset is done π
Sending the message text to the stored recipients is done by giving a MAIL or MLFL with no argument, so just MAIL<CRLF> or MLFL<CRLF> π« Transmitting the text works exactly like a normal MAIL/MLFL. A positive acknowledgement at the end of transmission means the message was sent to ALL the recipients remembered with XRCP. A failure code means it should be treated as having failed for ALL of those specified recipients, no matter what the actual error code is π Whether the reply is success or failure, all stored recipient names get flushed and forgotten. In other words, things go back to their initial state π§Ή This purge of the recipient list must also happen as the "reset" side effect of any use of XRSQ.
A 440 reply to an XRCP can be handled by using a MAIL/MLFL to send the message to the currently stored recipients, then sending more XRCPs and another MAIL/MLFL, as many times as needed π For example, if a server only had room for 10 names, a 50-recipient message would get sent 5 times, to 10 different recipients each time π
If a user tries to specify message text (MAIL/MLFL with no argument) before any successful XRCPs have been given, it should be treated exactly like a "normal" MAIL/MLFL with a null recipient π Most servers will return an error of some kind, such as "450 Null recipient".
See Appendix B for an example using XRSQ R.
Scheme mechanics: XRSQ T (Text first) π
In the text-first scheme, a MAIL/MLFL with no argument is used to specify the message text, and the server stores it away π¦ The XRCPs that come after are then treated as if they were MAIL/MLFL commands, EXCEPT none of the text transfer manipulations get done. The stored message text is sent to the specified recipient, and the reply code is the same one an actual MAIL/MLFL would invoke. (Note ANY 2xx code indicates success. π)
The stored message text isn't forgotten until the next MAIL/MLFL or XRSQ, and that one will either replace it with new text or flush it entirely ποΈ Any use of XRSQ resets this scheme by flushing the stored text. So does any MAIL/MLFL with a non-null argument.
If an XRCP shows up before any message text has been stored, the user is basically trying to send a null message π« Some servers might allow that, and others would return an error code.
See Appendix C for an example using XRSQ T.
Why two schemes anyway? π€
Because neither one is optimal for every system πββοΈ XRSQ R allows more of a "bulk" mailing, since everything gets saved up and then mailed at the same time. This is super useful for systems like ITS, where the FTP server doesn't write mail itself and instead hands it off to a central mailer demon of great power π₯ The more information (like recipients) attached to a single hand-off, the more efficiently the mail can be delivered π
XRSQ T is different. It's geared toward FTP servers that want to deliver mail directly, one by one, incrementally π¦ That way they can return an individual success/failure reply code for each recipient given, which might depend on variable file system factors like exceeding disk allocation, mailbox access conflicts, and so forth π΅βπ« If they tried to copy XRSQ R's bulk mailing, they'd have to make sure a success reply to the MAIL/MLFL really meant it had been delivered to ALL recipients specified, not just some of them π
- okay bestie, this is literally an extension of FTP π
, so we have to be ready for sites that don't recognize
XRSQorXRCPat all π.XRSQandXRSQ ?are explicitly built as tests to see whether either scheme is implemented.XRCPisn't, and an "unimplemented" failure could get mixed up with "No scheme selected yet" or even "Recipient unknown" π. Be safe, be sure, useXRSQ! π«Ά - there's no way to say in a positive reply to
XRSQ ?that the server's preferred scheme is the default state (none of the multi-recipient schemes) π₯Ί. The logic is that if that were the case, implementingXRSQ/XRCPwould be pointless, so the answer would just be negative π . - the reason MAIL/MLFL is limited to null arguments in this extension is ambiguity π. Say
XRSQ Ris in effect, someXRCPs have been given, and then you sendMAIL FOO<CRLF>. There'd be no way to tell whether a failure reply was for mailbox "FOO" or a global failure for all the recipients specified π. Same deal withXRSQ T: was the text stored and the mailbox failed, or vice versa, or both? π€― - "Resets" are done by all
XRSQs and "normal" MAIL/MLFLs to avoid confusion and overly complicated implementation π§Ή.XRSQimplies a change or uncertainty of status, and the later commands would otherwise need some independent mechanism to avoid clobbering the data bases (e.g. the message text storage area) used by the T/R schemes. Once a scheme is selected, though, it stays "in effect," just likeTYPE AorBYTE 8π. The recommended way to do a reset without changing the current selection isXRSQ ?. Remember that plainXRSQreverts to the no-scheme state β¨. - it is permissible to intersperse other FTP commands among the
XRSQ/XRCP/MAIL sequences π¦.
On FTP reply codes πΈ
okay so the reply codes are a whole mess π©. There have been three possible "official" sets of codes you could draw on, and it's not clear which one any given site is using: (1) Old FTP, (2) New FTP, (3) Revised New FTP. I mostly ignored all of them and went with RFC 691, "One More Try on the FTP", by Brian Harvey π. My reasoning is super simple: I know of no site that implements "new FTP," and RFC 691 folds much of the "new FTP" reply code logic into the framework of "old FTP" π§. The only sharp conflict is handled by letting 450 keep its "old" meaning, which is equivalent to 520 - permanent failure β. Also, when you're testing whether a site understands an FTP command, a reply of 5xx (specifically, 500) will generally indicate, for all sets of codes, that the command is unrecognized π.
By the way, I recommend RFC 691 as required reading for FTP implementors π. Maybe if enough people get together, this mess can be straightened out π.
Example of XRSQ R (Recipients first) π
first the user has to establish that the server actually implements XRSQ π:
U: XRSQ
S: 200 OK, no scheme selected.
An XRSQ with a null argument always returns a 200 if implemented, selecting the "scheme" of null, i.e. none of them. If XRSQ were not implemented, a code of 4xx or 5xx would be returned.
U: XRSQ R
S: 200 OK, using that scheme
All's well, so now the recipients can be specified π.
U: XRCP Foo
S: 200 OK
U: XRCP Raboof
S: 520 Who's that? No such user here.
U: XRCP bar
S: 200 OK
Well, two out of three ain't bad π. Note that the demise of "Raboof" has no effect on the storage of "Foo" or "bar". Now to furnish the message text, by giving a MAIL or MLFL with no argument:
U: MAIL
S: 350 Type mail, ended by <CRLF>.<CRLF>
U: Blah blah blah blah....etc etc etc
U: .
S: 256 Mail sent.
The text has now been sent to both "Foo" and "bar" π«Ά
Example of XRSQ T (Text first) π§
Using the same message as the previous example:
U: XRSQ ?
S: 215 T Text first, please.
XRSQ is indeed implemented, and the server says that it prefers "T," but that needn't stop the user from trying something else π:
U: XRSQ R
S: 501 Sorry, I really can't do that.
Oh well. It's possible that it could have understood "R" also, but in general it's best to use the "preferred" scheme, since the server knows which is most efficient for its particular site π§ . Anyway:
U: XRSQ T
S: 200 OK, using that scheme.
Scheme "T" is now selected, and the text must be sent:
U: MAIL
S: 350 Type mail, ended by <CRLF>.<CRLF>
U: Blah blah blah blah....etc etc etc
U: .
S: 256 Mail stored.
Now recipients can be specified:
U: XRCP Foo
S: 256 Stored mail sent.
U: XRCP Raboof
S: 520 Who's that? No such user here.
U: XRCP bar
S: 256 Stored mail sent.
Again, the text has now been sent to both "Foo" and "bar", and still remains stored. A new message can be sent with another MAIL/XRCP... sequence, but the fastidious or paranoid could chose to do:
U: XRSQ ?
S: 215 T Text first, please.
Which resets things without altering the scheme in effect β¨π
π¦ where this page comes from
- ietf: rfc743 1977-12
- π girlified by claude-haiku-5-5 on : a language model's rewrite of the original, under its terms