mirror of
https://github.com/PDP-10/its.git
synced 2026-03-22 09:03:20 +00:00
reading/sending facilities. BABYLM provides mail sending. BABYL is a much improved library over RMAIL.
1991 lines
80 KiB
Plaintext
Executable File
1991 lines
80 KiB
Plaintext
Executable File
!* -*-TECO-*-
|
||
This file has enough of Babyl to generate a library that can be autoloaded
|
||
to send mail (e.g. via C-X M) quickly (and not take up much library space).
|
||
Note that BABYL proper (the mail reader) must be generated from BABYL > and
|
||
BABYLM > -- it is NOT true that BABYL > has enough to read but not send
|
||
mail, since they both share some utility routines and those are in here.
|
||
|
||
Modification history:
|
||
|
||
8/24/87 167 SRA Merge XX & OZ versions. Fix incredibly silly
|
||
special casing of MIT-OZ (nobody else in the world has
|
||
these problems? Right, guys) to use a variable
|
||
instead; if you have to kludge things, do it in the
|
||
system init file.
|
||
11/15/86 SRA [XX version 165] In-Reply-To uses Message-ID.
|
||
1/10/87 JAR [OZ version 166] Remove space in RCPT:(FOO @BAR).
|
||
This changes COMSAT's handling of %'s to something
|
||
that JAR thinks is better.
|
||
7/17/86 165 Foner Suppress OZ.AI.MIT.EDU from appearing during
|
||
header reformation, if we are on MIT-OZ.
|
||
There's no right way to do this yet (since nobody's
|
||
domain software works right), so we'll kluge it.
|
||
Also knows about routing through MC or XX using
|
||
domains and using old-style hostnames with routing.
|
||
The addition is in & Process Recipient Field, right
|
||
where it already checks for foo%OZ@MC etc.
|
||
08/08/85 164 KRONJ Set all bits in Parser Ctl Flags for MMAILR
|
||
06/30/85 163 KRONJ Fix missing escape in edit 162
|
||
Clear FS D VERS to avoid problems bringing up ZBabyl
|
||
06/06/85 162 GUMBY Change the name of the ITS init file from BABYL VARS
|
||
to XUNAME BVARS
|
||
04/05/85 161 FHSU (mail queued) message around WAKEMM program.
|
||
12/12/84 160 ECC *** Fixing rubout-around-more-than-host bug ***
|
||
4/19/84 159 ECC Special case %MIT-OZ@MIT-MC etc. for stripping.
|
||
11/18/83 158 ECC Add to Process Babyl Init or Vars File the processing
|
||
(always) of EMACS:BABYL.VARS for site-dependent specs,
|
||
especially of what recips to remove from replies.
|
||
11/16/83 156 KMP Re-fixed & ITS Mail Buffer to also use the ";nnn."
|
||
format not only for USER-HEADER things, but also for
|
||
like SUBJECT which could run onto multiple lines.
|
||
Uses this format iff field really goes to multiple
|
||
lines.
|
||
11/14/83 154 KMP Fixed & ITS Mail Buffer to use USER-HEADER;nnn.
|
||
instead of USER-HEADER: in COMSAT request file
|
||
so that continuation lines will be assured of
|
||
sticking together. Gets around a bug in current
|
||
COMSAT that reverses USER-HEADER fields, but is a
|
||
generally good idea anyway.
|
||
11/03/83 153 ECC Fix up the 822 special code. Do not use Babyl ..D,
|
||
since that fouls up periods etc. in the uname part.
|
||
Just do some searching etc. within personal name
|
||
field, and only do this quoting on outgoing mail.
|
||
On incoming mail should do UNquoting when can.
|
||
10/25/83 150 ECC If & Process Recipient Field finds 822 specials ;:.[]
|
||
in personal name field, unquoted, it will quote them
|
||
or the whole field. In particular peiod is common
|
||
case, as in "Eugene C. Ciccarelli" <ECC at MIT-OZ>.
|
||
10/22/83 149 ECC FOO@BAR@GAGGLE bug fixed -- was giving FO%AR at GAGGLE.
|
||
10/13/83 148 KRONJ Add escape after second FZ in & MMAILR ...
|
||
so that (mail queued) message doesn't get lost.
|
||
Make Message-ID more like <KRONJ.12345678.BABYL@SIERRA>
|
||
09/30/83 147 GZ Fixed & MMAILR Queueing Function to use octal date
|
||
in queue file name, as per MMAILR specs.
|
||
09/21/83 146 ECC Add check code in & Default Babyl Queuing Function to
|
||
set Babyl Queuing Function by checking for the file
|
||
EMACS:BABYL.USE-MMAILR.
|
||
07/24/83 145 SHSU Fix REMAIL to not use Orig-To:, etc.
|
||
06/26/83 143 SHSU Generate TNX Message-ID: field if not there already.
|
||
06/14/83 142 ECC Fixed & TNX Mail Buffer bug (FCC was smashing the
|
||
default hostname q2). & ITS Mail Buffer quoting with
|
||
USER-HEADER extended to quote their continuation lines.
|
||
05/26/83 141 ECC & ITS Mail Buffer ensures ending CRLF. & TNX Mail
|
||
Buffer writes to fcc files before calling parser, thus
|
||
avoiding rubouts in header. & Append to TNX Mail File
|
||
checks that file is not a Babyl file.
|
||
05/18/83 140 KRONJ Wake up MMAILR by running WAKEMM.EXE (does IPCF wakeup)
|
||
04/10/83 139 ECC Babyl calls setup hook. Edit and Mail Buffer unmods
|
||
at beginning, so immediate abort doesnt cause later
|
||
query.
|
||
03/01/83 136 ECC Fix date to not have hyphen before zone, since RFC822
|
||
only allows Space there. Give parser (& Process
|
||
Recipient Field) ability to put rubouts around
|
||
host names, for XMAILR. Have parser driven by one
|
||
variable with bit flags. Prepare for splitting off
|
||
the TNX-mailer-dependent code. That will probably be
|
||
moved into a separate file, BABYLT, later. Get rid of
|
||
the novel Spaces around @ in outgoing headers, as no
|
||
one seems to like them (or with reformation, see
|
||
them), and some say RFC822 discourages the use.
|
||
Remove the OZ Sender hacks. Added KRONJs MMAILR code.
|
||
Temporary(?): parser control bit to say just 1 recip
|
||
per line, for XMAILR. Fixed date in outgoing mail to
|
||
conform to RFC822 -- 3-letter day and months. Dont
|
||
let FAKE-TO be quoted with USER-HEADER on ITS.
|
||
02/12/83 126 SHSU M confirms if last message aborted. Random functions
|
||
not used but so can be distributed (BBN). Cosmetic
|
||
changes to In-reply-to: field. Support for DECnet
|
||
mailers. File indirection in & TNX Mail Buffer fixed.
|
||
12/20/82 125 ECC Get ready for RFC822:
|
||
Add variable Babyl @ Flag, which signals & Process
|
||
Recipient Field to use @, not AT. It is bound in &
|
||
TNX Mail Buffer. Also, & Complete TNX Header doesnt
|
||
have to worry about @/AT/hosts, since now & TNX Mail
|
||
Buffer calls the parser on From and Sender fields. If
|
||
there are multiple @s, all but last turn into %s.
|
||
12/15/82 121 ECC Blank lines in TNX headers removed. ITS header fields
|
||
checkd to see whether COMSAT processes them, and put a
|
||
USER-HEADER before those that it doesn't.
|
||
12/01/82 120 ECC Moved insertion of in-reply-to out of & Setup Reply
|
||
Template and into its own subr, called AFTER editing
|
||
the mail, so user never sees it. # Babyl R now sets
|
||
the current template name to Standard Reply, as a
|
||
signal.
|
||
11/29/82 118 GZ Changed doc for Babyl Day Of Week Flag, Babyl Personal
|
||
Name and Babyl User Name to mention that these are for
|
||
TNX only.
|
||
11/18/82 117 LNZ Changed & Append to TNX Mail File to use a numeric
|
||
argument, if provided, as the date to write into
|
||
the TNX header.
|
||
8/22/82 113-5 ECC Move & Complete TNX Header back to before parsing, i.e
|
||
back to old way, makes more sense, cleans up
|
||
field-at-top problems. Fixed & Complete TNX Header
|
||
bug re Babyl Day of Week Flag, which caused colon
|
||
after field name to end up later in the line. Date
|
||
now ensured on top line, above Sender, From, again.
|
||
OZ host renaming kludge changed to use MC, since AI is
|
||
unreliable (has been for a while using a patch file).
|
||
Extra single-quote in code in Babyl Default Edit Mail
|
||
Hook removed, so now the & Setup.. shouldnt foul up if
|
||
loaded twice. (Was benign before, but slow.)
|
||
8/16/82 112 KRONJ Fix Bcc removal and Fcc processing -- & Complete Header
|
||
wasnt being called early enough so no crlf could be
|
||
guaranteed before the Bcc or Fcc. Also look for
|
||
IMMEDIATE-MAIL.EXE instead of SEND-MAIL.EXE for IMail.
|
||
7/18/82 111 ECC Removing @<otherITS> is dangerous after all, so back
|
||
to old code: just remove the @localITS when reform.
|
||
7/15/82 105-0 ECC Finishing touches: dont put in Sender if user put one
|
||
in already. Put KDO's code in to handle IPCF
|
||
immediate mailing, for non-net sites. They will also
|
||
need to load or generate-in the IMAIL library. Add
|
||
M-X Get Mail Template.
|
||
7/14/82 100-4 ECC Improve documentation for a few functions. Improve
|
||
templates somewhat: they remember point, handle null
|
||
string args better. See also BABYL. Added Process
|
||
Babyl Init or Vars File, called from & Setup.. Once
|
||
new AUX is fully in normal EMACS, can simplify. Added
|
||
Insert Mail Template Into VARS/Init File, setting a
|
||
template calls it upon a visited init/vars file.
|
||
7/12/82 99 ECC Fix bugs in new TNX header preparation: & TNX Mail
|
||
Buffer, & Complete TNX Header. Change & Process
|
||
Recipient Field to strip at-AI on OZ iff that uname
|
||
has a directory there. So pure-ai people show as
|
||
such.
|
||
7/08/82 98 ECC Add Babyl Reply-To Field variable, Babyl Default Edit
|
||
Mail Hook.
|
||
7/08/82 94-7 ECC Special hack for OZ, so mail to non-chaosnet hosts
|
||
will have a From that can be replied to. For mail
|
||
from OZ, all OZ-recipients and From field have User at
|
||
MIT-AI form. Changed & Complete TNX Header
|
||
and & Process Recipient Field. The latter also will
|
||
trim this AI-form on OZ, so OZ users wont see it. The
|
||
idea is to hope that Chaosnet-local (especially
|
||
OZ-to-OZ) mail wont be replied to via AI.
|
||
7/04/82 93 ECC TNX robustness in writing -- open to [TECO] OUTPUT:
|
||
& TNX Mail Buffer, & Append to TNX Mail File.
|
||
7/03/82 92 ECC & Push To Edit Mail: 0 fsError so no O1B error.
|
||
6/27/82 89-91 ECC & Process Recipient Field fixed re reforming: was
|
||
reforming FOO at LOCAL at OTHER to be FOO at OTHER,
|
||
clearly wrong. See comment in code re issues. People
|
||
may want it more featureful re recognition of local
|
||
host, but I dont see how just now. Better safe.
|
||
6/14/82 88 ECC Fix & ITS Mail Buffer to use last @ on line, e.g. so
|
||
@FILE specs will work. Maybe FOO@BAR@GAGGLE too?
|
||
4/29/82 84 KRONJ Dont need to include site name in Babyl User Name.
|
||
3/07/82 83 KRONJ Add Bcc: header field for TNX
|
||
3/01/82 82 KRONJ Fixed From: field handling in & Complete TNX Header.
|
||
Babyl User Name with different capitalization from
|
||
fsXUName wasn't being used, and Sender: wasn't being
|
||
inserted if From: was already in buffer.
|
||
2/28/82 81 KDO Added code in & TNX Mail Buffer to set generation-
|
||
count of unsent-mail file to 0 so that next mailing
|
||
doesn't overwrite it. Changed erset to a catch in Edit
|
||
and Mail Buffer so that ? gives backtrace after error.
|
||
1/16/82 80 ECC Adding Babyl FCC To variable for TNX.
|
||
11/10/81 79 ECC Removed & Expand Mailing Lists, since MMcM claims that
|
||
XMAILR now performs mailing list expansion.
|
||
11/02/81 78 ECC Fixed & Expand Mailing Lists infinite loop bug. Was
|
||
looping for non-mailing-list entries.
|
||
6/11/81 76 EAK Removed DM hack because PDL claims COMSYS will handle
|
||
COMSAT input files now. Deleted the following line:
|
||
fsMachine-(f6DM)"e etAI:'
|
||
4/20/81 74 Moon Mailing lists for Tenex (see & Expand Mailing Lists)
|
||
3/25/81 73 ECC F, V, R, and & Setup Reply Template moved into BABYL
|
||
proper since are either only for mail-reading (F and
|
||
R) or is a dispatch (V) command. Make BABYLM smaller.
|
||
2/16/81 72 ECC F and R only use 1 line of subject, since ITS mailer
|
||
cannot handle (I think).
|
||
12/20/80 69 ECC Changed yanker in accordance with Babyl changes to set
|
||
bounds just around message.
|
||
11/07/80 64 ECC Work on F: fixed so done hook goes off in *Babyl*, not
|
||
*Mail*. Added variable and argument options to
|
||
control reading To/Subject, whether into .
|
||
Mail edit level binds C-M-\ to filler.
|
||
11/07/80 61 EAK,ECC Made F use @:F to optimize redisplay by
|
||
scrolling the message down to where the yanked
|
||
message will be, and back up when done.
|
||
??? -- what JP work in here? -- ???
|
||
9/17/80 52 ECC Changed Edit and Mail Buffer to print only header and
|
||
current line if printing terminal. Used to print
|
||
whole buffer, bad for C, 3R, 4R, F.
|
||
8/27/80 50 ECC Added pruning of BBOARD@ to INFO- and * pruning. Also
|
||
made Babyl Dont Reply To search bounded over <CRLF>
|
||
<mailbox> <CRLF> so username can be fully delimited.
|
||
8/24/80 48 ECC Added 2-window control to M, C, F, and V (new template
|
||
command). Renamed # Babyl ^F to # Babyl F. Should do
|
||
the opposite in BABYL for the finder function.
|
||
8/24/80 45 ECC Split up the R/M/C/F shared code in # Babyl R and
|
||
distributed it among R, M, C, and F for clarity and
|
||
better modularity. New routine & Push to Edit Mail
|
||
which they call. Renamed # Edit Mail to Edit and Mail
|
||
Buffer, since it can conceivably now be user callable
|
||
on any buffer, and since it now sends the mail. #
|
||
Babyl ^F keeps same subject or makes one, and calls
|
||
the parser. Deleted the obsolete idea-file RMCF >.
|
||
8/24/80 40 ECC Added mail template hacking to # Babyl R and added
|
||
Mail With Template (# Babyl V) and Set Mail Template.
|
||
Changed some variable names and declared all of them
|
||
so user can use Edit Options etc. Names changed to
|
||
include "Babyl" in their names to allow giving "Babyl"
|
||
as filter to Edit Options. Changes (<...> is added):
|
||
<Babyl> Dont Reply To
|
||
<Babyl> CC To
|
||
<Babyl> Require Subjects
|
||
Babyl Reply Hook -> Babyl Edit Mail Hook
|
||
<Babyl> Day of Week Flag
|
||
<Babyl> User Name
|
||
<Babyl> Personal Name
|
||
|
||
8/23/80 38 ECC & Process Recipient Field modified, primarily to leave
|
||
recipient buffer with pairs of lines, not only mailbox
|
||
names, but full recipients as well for more general
|
||
use as a parser. # Babyl R uses it to remove
|
||
duplicate and unwanted recipients. Semantics of Dont
|
||
Reply To changed a little, and INFO-xxx and *xxx
|
||
always removed. Added option Babyl Trim Recipient List
|
||
to control whether any of this is done.
|
||
7/17/80 20 ECC & TNX Mail Buffer ensures that there is a final CRLF.
|
||
Was necessary for XMAILR, though XMAILR claims now to
|
||
be fixed so it could possibly be removed. Changed
|
||
recipient pruning to (1) use just the mailbox part of
|
||
TO (not host, not rfc733 personal name), and (2)
|
||
delete the entire recipient, not just a stupid FKD.
|
||
Also it will remove a lone Cc: line with no recipients.
|
||
Pre-history...!
|
||
|
||
!~FILENAME~:! !Mail-sending part of the Babyl mail subsystem.!
|
||
BABYLM
|
||
|
||
!# Babyl C:! !C# Continue editing the last message sent or aborted.
|
||
Describe Edit and Mail Buffer for details about message editing,
|
||
and general hooks.
|
||
If you give a numeric argument of 2 we will use 2 windows, with the
|
||
current message in the top and the message being sent in the
|
||
bottom one.
|
||
Runs any Teco program in the variable Babyl C Hook after the message
|
||
template has been set up.!
|
||
!* 1, numeric argument inhibits our setting abort message.!
|
||
|
||
m(m.m& Declare Load-Time Defaults)
|
||
Babyl C Hook, 0 or a Teco program to run after C sets up its template: 0
|
||
|
||
[1
|
||
ff&2"e :i*To continue editing this message use the C command.(
|
||
)[Abort Resumption Message' !* For Abort Recursive Edit.!
|
||
|
||
-2"'e,0m(m.m& Push To Edit Mail) !* Use 2 windows if NUMARG=2 but dont!
|
||
!* reset buffer.!
|
||
|
||
qBabyl C Hookf"nu1 m1'w !* Run M hook if any.!
|
||
|
||
:m(m.mEdit and Mail Buffer) !* Let user edit the mail and then!
|
||
!* mail it off.!
|
||
|
||
|
||
!& Mail Message:! !S Edit and then send a message.
|
||
To continue editing a message aborted earlier, provide a numeric
|
||
argument.!
|
||
|
||
:i*To resume, invoke the Send Mail command again with a numeric argument[Abort Resumption Message
|
||
!* C-] wont ask for a confirmation.!
|
||
ff&1"n 1,:m(m.m# Babyl C)' !* Continue editing mail and send.!
|
||
1,:m(m.m# Babyl M) !* Edit new mail and send.!
|
||
|
||
!Process Babyl Init or Vars File:! !C Find init or vars file and process it.
|
||
Babyl init and vars files are similar to EMACS ones, though these
|
||
should only be for customizing Babyl. If you only use Babyl from
|
||
WITHIN EMACS, you can customize it with your EMACS init or vars
|
||
file. You would then need no Babyl init or vars file. But if you
|
||
want to use Babyl outside EMACS, i.e. :BABYL on ITS or BABYL.EXE
|
||
on TNX, then you should put Babyl customizing in a Babyl init or
|
||
vars file.
|
||
Babyl checks your home directory for a Babyl init file, which should
|
||
be Teco code: BABYL INIT (ITS) or BABYL.INIT (TNX).
|
||
If no init file is found, it looks for a vars file: BABYL VARS (ITS)
|
||
or BABYL.VARS (TNX). This file should be in the same format as an
|
||
EMACS vars file.
|
||
This processing is only done the first time Babyl is loaded, for
|
||
reading or sending mail. If you edit your Babyl init or vars file
|
||
after this first entry to Babyl, you can give the M-X Process
|
||
Babyl Init or Vars File command manually so that Babyl takes
|
||
notice of the changes.
|
||
qSubDoc"n i
|
||
A 1, numarg means called from Babyl, so only process once.'!
|
||
|
||
!* TNX name will be (in home directory) BABYL.VARS. ITS name will be (in!
|
||
!* home directory) BABYL VARS. Unfortunately doesnt seem possible to use an!
|
||
!* ITS name like one for EMACS vars and also have parallel for init file --!
|
||
!* cannot have USER BABYL, since the Babyl file already uses that. So for!
|
||
!* ITS have BABYL VARS and BABYL INIT.!
|
||
|
||
ff&2"n 0fo..qBabyl Init/Vars Processed"n '' !* If called from!
|
||
!* Babyl, and if done already, exit.!
|
||
[1[2[3[4 f[DFile
|
||
f[BBind !* Temp buffer.!
|
||
e[fne] !* Push input channels if need.!
|
||
|
||
!* First the possibly site-specific EMACS:BABYL.VARS: !
|
||
fsOSTecof"ew etDSK:EMACS;BABYL VARS' !* ITS.!
|
||
"#-1"ew etEMACS:BABYL.VARS' !* Tops-20.!
|
||
"#w etDSK:<EMACS>BABYL.VARS'' !* Tenex. ???? EMACS:??? !
|
||
e?"e !* If the file exists, process it.!
|
||
fsDFile m(m.m& Babyl Process Init Vars)' !* ...!
|
||
|
||
etDSK: fsHSNamefsDSNamew !* Default to home directory.!
|
||
0fsdvers !* No version defaulting!
|
||
etBABYL INIT !* Init filename.!
|
||
0u1 !* 1: 0 until find a file.!
|
||
fsOSTeco-2"e !* Tenex -- avoid use of E?...!
|
||
1:<er ec 1u1>w' !* 1: Check for Tenex init file.!
|
||
"# fsOSTeco"e
|
||
et foo babini fs xuname fs dfn1' !* Set ITS name to look for !
|
||
e?"e 1u1'' !* 1: Check for ITS/Twenex init file.!
|
||
q1"n er @y m(hx*) !* Process init file.!
|
||
1m.vBabyl Init/Vars Processedw ' !* Say we have done it, exit.!
|
||
|
||
etBABYL VARS !* Vars filename.!
|
||
0u1 !* 1: 0 until find a file.!
|
||
fsOSTeco-2"e !* Tenex -- avoid use of E?...!
|
||
1:<er ec 1u1>w' !* 1: Check for Tenex vars file.!
|
||
"# fsOSTeco"e !* if ITS use special name !
|
||
et foo bvars fs xuname fs dfn1'
|
||
e?"e 1u1'' !* 1: Check for ITS/Twenex vars file.!
|
||
q1"e 1m.vBabyl Init/Vars Processedw !* Say that we have checked already.!
|
||
' !* No init file, no vars file. Exit.!
|
||
|
||
!* Process the BABYL VARS file: When EMACS proper has the latest AUX init!
|
||
!* (not just in the AUX library), we can remove our copy of it and change!
|
||
!* which we call here. (Here we call it & Babyl Process Init Vars instead of!
|
||
!* the standard & Process Init Vars.) And we can just do a simple m(m.m&!
|
||
!* Process Init Vars), passing it the filename. But the current EMACS!
|
||
!* MM-variable version of this is buggy.!
|
||
|
||
fsDFile m(m.m& Babyl Process Init Vars)
|
||
1m.vBabyl Init/Vars Processedw !* Say that we have done it now.!
|
||
|
||
|
||
!& Babyl Process Init Vars:! !S Read the user's EVARS file of var settings!
|
||
!* A filename string may be given as a numeric argument, to specify a!
|
||
!* non-standard vars file. ...THIS IS A COPY OF THE ONE IN AUX.EMACS.49. It!
|
||
!* can go away when that version of AUX is part of the standard EMACS,!
|
||
!* especially the (impure) MM-variable -- the current one is buggy.!
|
||
|
||
F[DFILE
|
||
FF&1"NFSDFILE'
|
||
"#FSOSTECO"E
|
||
ETFOO EVARS
|
||
FSXUNAMEFSDFN1'
|
||
"#ETEMACS.VARS'
|
||
FSHSNAMEFSDSNAM'
|
||
[1[3[4
|
||
Q..O[5F[BBINDQ..O[6
|
||
[..O
|
||
128*5,32:i*[2
|
||
*5:f2 /
|
||
"*5:f2 |!'!
|
||
1:<ER@Y>"L'
|
||
<.-Z;
|
||
@:F |