rohrpost

A commandline mail client to change the world as we see it.
git clone git://r-36.net/rohrpost
Log | Files | Refs | README | LICENSE

+weAvjOm0M2Yt5A34N= (25215B)


      1 Return-Path: <dnew>
      2 Received: from nevada.bellcore.com by greenbush.bellcore.com (4.1/4.7)
      3 	id <AA22702> for nsb; Mon, 8 Jun 92 15:57:08 EDT
      4 Received: by nevada.bellcore.com (4.1/4.7)
      5 	id <AA08471> for nsb@greenbush; Mon, 8 Jun 92 15:57:01 EDT
      6 Received: from Messages.8.5.N.CUILIB.3.45.SNAP.NOT.LINKED.nevada.galaxy.sun4.41
      7           via MS.5.6.nevada.galaxy.sun4_41;
      8           Mon,  8 Jun 1992 15:56:59 -0400 (EDT)
      9 Message-Id: <0eAvi=C0M2U=0U4XZI@thumper.bellcore.com>
     10 Date: Mon,  8 Jun 1992 15:56:59 -0400 (EDT)
     11 From: Darren New <dnew>
     12 X-Andrew-Message-Size: 8538+4
     13 Mime-Version: 1.0
     14 Content-Type: multipart/alternative; 
     15 	boundary="Interpart.Boundary.keAvi9O0M2U=AU4XRw"
     16 To: Nathaniel Borenstein <nsb>
     17 Subject: Fwd: revised MIME architecture
     18 References: <9206062231.AA23867@pixel.convex.com>
     19 
     20 > THIS IS A MESSAGE IN 'MIME' FORMAT.  Your mail reader does not support MIME.
     21 > Please read the first section, which is plain text, and ignore the rest.
     22 
     23 --Interpart.Boundary.keAvi9O0M2U=AU4XRw
     24 Content-type: text/plain; charset=US-ASCII
     25 
     26 
     27 I am on the WWW mailing list and got this interesting tidbit of which I
     28 thought you should be aware...
     29       -- Darren
     30 
     31 
     32 
     33 Return-Path: <new@ee.udel.edu>
     34 Received: from thumper.bellcore.com by nevada.bellcore.com (4.1/4.7)
     35 	id <AA08378> for dnew; Mon, 8 Jun 92 15:50:28 EDT
     36 Received: from udel.edu (louie.udel.edu) by thumper.bellcore.com (4.1/4.7)
     37 	id <AA01533> for dnew@nevada; Mon, 8 Jun 92 15:50:25 EDT
     38 Received: from snow-white.ee.udel.edu by louie.udel.edu id ah01113;
     39           8 Jun 92 15:45 EDT
     40 Received: from louie.udel.edu by snow-white.ee.udel.edu id aa01403;
     41           8 Jun 92 18:34 GMT
     42 Received: from CEARN.cern.ch by pucc.Princeton.EDU (IBM VM SMTP V2R2)
     43    with BSMTP id 0017; Sat, 06 Jun 92 18:56:24 EDT
     44 Received: from CEARN by CEARN.cern.ch (Mailer R2.07B) with BSMTP id 7873; Sun,
     45  07 Jun 92 00:35:28 SET
     46 Received: from dxmint.cern.ch by CEARN.cern.ch (IBM VM SMTP V2R1) with TCP;
     47    Sun, 07 Jun 92 00:35:21 SET
     48 Received: by dxmint.cern.ch (dxcern) (5.57/3.14)
     49 	id AA02301; Sun, 7 Jun 92 00:34:37 +0200
     50 Received: from dxmint.cern.ch by  nxoc01.cern.ch  (NeXT-1.0 (From Sendmail
     51  5.52)/NeXT-2.0)
     52 	id AA08529; Sun, 7 Jun 92 00:34:17 MET DST
     53 Received: by dxmint.cern.ch (dxcern) (5.57/3.14)
     54 	id AA02281; Sun, 7 Jun 92 00:32:19 +0200
     55 Received: from pixel.convex.com by convex.convex.com (5.64/1.35)
     56 	id AA04364; Sat, 6 Jun 92 17:32:01 -0500
     57 Received: from localhost by pixel.convex.com (5.64/1.28)
     58 	id AA23867; Sat, 6 Jun 92 17:31:59 -0500
     59 Message-Id: <9206062231.AA23867@pixel.convex.com>
     60 To: www-interest@nxoc01.cern.ch
     61 Subject: revised MIME architecture
     62 Mime-Version: 1.0
     63 Content-Type: multipart/mixed;boundary=cut-here
     64 Date: Sat, 06 Jun 92 17:31:58 CDT
     65 From: Dan Connolly <connolly@pixel.convex.com>
     66 Resent-Date:  Mon, 8 Jun 92 18:34:59 GMT
     67 Resent-From: new@ee.udel.edu
     68 Resent-To: dnew@thumper.bellcore.com
     69 
     70 In an earlier message, I proposed we make the W3 project
     71 interoperate with MIME systems. I made the mistake
     72 of using existing names for formats and types that
     73 don't yet exist.
     74 
     75 I'd like to make a more organized transition to MIME
     76 interoperability.
     77 
     78 First, we define some types for existing web servers
     79 and documents.
     80 
     81 X-HTTP is an access-type for message/external-body body
     82 parts to access existing W3 servers.
     83 Additional parameters include host, port, path, and anchor.
     84 
     85 X-HTML is a subtype of text for existing W3 documents.
     86 
     87 So the next part of this message is an HTML document expressed
     88 as a MIME external-body message.
     89 
     90 
     91 [An Andrew ToolKit view (mailobjv) was included here, but could not be
     92 displayed.]Then we address limitations in the existing format with two
     93 new types:
     94 
     95 In order to encapsulate multimedia objects in web nodes,
     96 we define X-HYPERTEXT to be a subtype of the multipart body type.
     97 The first part of a multipart/X-HYPERTEXT is the content of the hypertext.
     98 The other parts are multimedia attachments and links to other documents.
     99 
    100 The user agent (WWW client) displays the first part and allows the
    101 user to choose attachments and/or links. The attachments and links
    102 will be displayed in addition to or in place of the original content.
    103 
    104 Then, in order to formalize the structure of hypertext parts,
    105 we define X-SGML to be a subtype of text. The body of an X-SGML part must
    106 be a complete SGML document. The user agent (WWW client) will resolve
    107 external entities (such as the DTD and the mutlimedia attachments).
    108 
    109 So here's a multimedia web node expressed as MIME body part:
    110 
    111 
    112 [An Andrew ToolKit view (mailobjv) was included here, but could not be
    113 displayed.]
    114 [An Andrew ToolKit view (mailobjv) was included here, but could not be
    115 displayed.]
    116 [An Andrew ToolKit view (mailobjv) was included here, but could not be
    117 displayed.]And here's the DTD for WEB-NODE documents:
    118 
    119 <!-- This DTD was produced by DeveGram on Tue Jun  2 18:58:16 1992 -->
    120 <!-- and hand-edited by connolly@convex.com -->
    121 
    122 <!--     Parameter Entities       -->
    123 
    124 <!--      Terminal symbols        -->
    125 
    126 <!ENTITY % words "#PCDATA" >
    127 
    128 <!--    Non-ELEMENT symbols       -->
    129 
    130 <!ENTITY % inline	"%words | A" >
    131 <!ENTITY % text         "%inline | P | IMAGE" >
    132 <!ENTITY % heading "H1|H2|H3|H4|H5|H6" >
    133 
    134 <!ENTITY lt "<">
    135 <!ENTITY gt ">">
    136 <!ENTITY amp "&">
    137 
    138 <!ENTITY lt. "<">
    139 <!ENTITY gt. ">">
    140 <!ENTITY amp. "&">
    141 
    142 <!--     Document structure       -->
    143 
    144 <!ELEMENT WEB-NODE	O O  (TITLE, NEXTID?, ISINDEX?, section+, ADDRESS?)>
    145 
    146 <!ELEMENT TITLE	- -  (%inline)+>
    147 <!ELEMENT ADDRESS - - (%text)+>
    148 
    149 <!ELEMENT NEXTID - O EMPTY >
    150 <!ATTLIST NEXTID N NUMBER #IMPLIED>
    151 
    152 <!ELEMENT ISINDEX - O EMPTY >
    153 
    154 
    155 <!ELEMENT section O O ((%heading)?,
    156 			(
    157 			%text |
    158 			section |
    159 			MENU |
    160 			UL |
    161 			OL |
    162 			DIR |
    163 			DL)+)>
    164 
    165 <!ELEMENT (H1|H2|H3|H4|H5|H6)	- -  (%inline) >
    166 
    167 <!ELEMENT P	- O  EMPTY -- paragraph SEPARATOR -->
    168 
    169 <!ELEMENT IMAGE - O  EMPTY>
    170 <!ATTLIST IMAGE ATTACHMENT ENTITY #REQUIRED>
    171 
    172 <!ELEMENT A	- -  (%inline)+>
    173 <!ATTLIST A
    174 	NAME CDATA #IMPLIED
    175 	HREF ENTITY #IMPLIED
    176 	TYPE CDATA #IMPLIED --@@-- >
    177 
    178 <!ELEMENT MENU	- -  (LI+)>
    179 
    180 <!ELEMENT UL	- -  (LI+)>
    181 
    182 <!ELEMENT OL	- -  (LI+)>
    183 
    184 <!ELEMENT DIR	- -  (LI+)>
    185 
    186 <!ELEMENT LI	- O  (%text)+>
    187 
    188 <!ELEMENT DL	- -  ((DT, DD)+)>
    189 
    190 <!ELEMENT DT	- O  (%inline)+>
    191 
    192 <!ELEMENT DD	- O  (%text)+>
    193 
    194 And here's a perl script to convert an HTML document
    195 into a multipart/X-HYPERTEXT MIME body part:
    196 
    197 #!/usr/local/bin/perl
    198 
    199 $boundary = "attachment";
    200 print "Content-Type: multipart/X-HYPERTEXT; boundary=$boundary\n\n";
    201 
    202 print "--$boundary\n";
    203 print "Content-Type: text/SGML\n\n";
    204 
    205 print "<!DOCTYPE WEB-NODE SYSTEM \n[\n";
    206 
    207 @html = <>;			# read whole file
    208 $_ = join('', @html);
    209 $out = '';
    210 
    211 sub fix_anchor{
    212     local($name, $href, $type);
    213 
    214     # What exactly is the syntax of an SGML attribute value?
    215     while(s/^(\w+)\s*=\s*((\"[^\"]*\")|([^\s>]+))\s*//){
    216 	local($v) = ($3 || $4);
    217 	local($a) = $1;
    218 	$href = $v if $a =~ /^href$/i;
    219 	$name = $v if $a =~ /^name$/i;
    220 	$type = $v if $a =~ /^type$/i;
    221     }
    222     s/[^>]*>//;
    223 
    224     $out .= "<A";
    225     $out .= " NAME=\"$name\"" if $name ne '';
    226     $out .= " TYPE=\"$type\"" if $type ne '';
    227     if($href ne ''){
    228 	if(!defined($anchor{$href})){
    229 	    $anchor{$href} = ++$anchor;
    230 	}
    231 	$out .= " HREF=" . $anchor{$href};
    232     }
    233     $out .= ">";
    234 }
    235 
    236 $header = 0;
    237 $anchor = "UDI000";
    238 while(/</){
    239     $out .= $`;
    240     $_ = $';
    241     if(s/^A\s+//i){
    242 	&fix_anchor;
    243     }elsif(s/^NEXTID\s+(\d+)\s*>//){
    244 	$out .= "<NEXTID N=$1>";
    245     }elsif(s/^H(\d)>//){
    246 	local($n) = $1;
    247 	while($n<=$header){ $out .= "</SECTION>"; $header--; }
    248 	while($n>$header){ $out .= "<SECTION>"; $header++; }
    249 	$out .= "<H$n>";
    250     }else{
    251 	$out .= '<';
    252     }
    253 }
    254 
    255 $out .= $_;
    256 
    257 foreach(keys %anchor){
    258     local($ent) = $anchor{$_};
    259 
    260     print "<!ENTITY $ent SDATA \"$_\">\n";
    261 }
    262 
    263 print "]>\n", $out;
    264 
    265 foreach(keys %anchor){
    266     local($access_type);
    267 
    268     print "\n\n--$boundary\n";
    269     print "Content-id: $_\n";
    270     print "Content-type: message/external-body\n";
    271 
    272     $access_type = $1 if s/^(\w+)://;
    273 
    274     if(s/#([^#]+)$//){
    275 	print "\t;x-anchor=\"$1\"\n";
    276     }
    277 
    278     if($access_type =~ /file/i){
    279 	if(&hostport){
    280 	    &param('access-type', "ANON-FTP");
    281 	}else{
    282 	    &param('access-type', 'LOCAL-FILE');
    283 	}
    284 	&param('name', $_);
    285 
    286 	print "\nContent-Type: application/octet-stream\n\n";
    287     }elsif($access_type =~ /http/i){
    288 	&param('access-type', 'X-HTTP');
    289 	&hostport;
    290 	&unescape;
    291 	&param('name', $_);
    292 
    293 	print "\nContent-Type: text/X-HTML\n\n";
    294     }elsif($access_type =~ /news/i){
    295 	&param('access-type', 'X-NEWS');
    296 	&unescape;
    297 	if(/@/){
    298 	    &param('message-id', $_);
    299 	}else{
    300 	    &param('group', $_);
    301 	}
    302 
    303 	print "\nContent-Type: message\n\n";
    304 
    305     }elsif($access_type =~ /telnet/i){
    306 	&param('access-type', 'x-telnet');
    307 	&unescape;
    308 	&param('user', $1) if s/^(.*)@//;
    309 	&param('port', $1) if s/:(.*)$//;
    310 	&param('site', $_);
    311 
    312 	print "\nContent-Type: X-TELNET\n\n";
    313 
    314     }elsif($access_type =~ /gopher/i){
    315 	&param('access-type', 'x-gopher');
    316 	&hostport;
    317 	&param('type', $1) if s-^/(\d+)/--;
    318 	&unescape;
    319 	&param('selector', $_);
    320 
    321 	print "\nContent-Type: @@@@\n\n";
    322 
    323     }elsif($access_type =~ /wais/i){
    324 	&param('access-type', 'x-wais');
    325 	&hostport;
    326 	if(m-^/-){
    327 	    &param('type', $1) if s-^/(\w+)--;
    328 	    &param('size', $1) if s-^/(\d+)--;
    329 	    &unescape;
    330 	    &param('path', $_);
    331 	}else{
    332 	    &unescape;
    333 	    &param('words', $1) if /\?(.*)/;
    334 	}
    335 
    336 	$type = "image/$type" if $type =~ /gif|tiff/i;
    337 	$type = "application/postscript" if $type =~ /PS/i;
    338 
    339 	print "\nContent-Type: $type\n\n";
    340 
    341     }elsif($access_type eq ""){
    342 	&param('access-type', 'x-relative');
    343 	&unescape;
    344 	&param('name', $_);
    345 
    346 	print "\nContent-Type: message\n\n";
    347     }else{
    348 	warn "unknown access type: $access_type in $_";
    349     }
    350 }
    351 
    352 print "--$boundary--\n";
    353 
    354 sub unescape{
    355     s/%(\w\w)/sprintf("%c",hex($1))/ge;
    356 }
    357 
    358 sub param{
    359     local($p, $v) = @_;
    360     # quote tspecials in parameter values
    361     $v = '"'.$v.'"' if $v =~ m-[\s()<>@,;:\\\"\/\[\]?\.=]-;
    362     print "\t;$p=$v\n";
    363 }
    364 
    365 sub hostport{
    366     if(s-//([^:/]+)--){
    367 	&param('host', $1);
    368 	&param('port', $1)  if s/:(\d+)//;
    369 	1;
    370     }else{
    371 	0;
    372     }
    373 }
    374 
    375 
    376 --Interpart.Boundary.keAvi9O0M2U=AU4XRw
    377 Content-Type: multipart/mixed; 
    378 	boundary="Alternative.Boundary.keAvi9O0M2U=8U4XMt"
    379 
    380 --Alternative.Boundary.keAvi9O0M2U=8U4XMt
    381 Content-type: text/richtext; charset=US-ASCII
    382 Content-Transfer-Encoding: quoted-printable
    383 
    384 <nl>
    385 I am on the WWW mailing list and got this interesting tidbit of which I though=
    386 t you should be aware...<nl>
    387       -- Darren<nl>
    388 <nl>
    389 <nl>
    390 <smaller><nl>
    391 Return-Path: <lt>new@ee.udel.edu><nl>
    392 Received: from thumper.bellcore.com by nevada.bellcore.com (4.1/4.7)<nl>
    393 	id <lt>AA08378> for dnew; Mon, 8 Jun 92 15:50:28 EDT<nl>
    394 Received: from udel.edu (louie.udel.edu) by thumper.bellcore.com (4.1/4.7)<nl>=
    395 
    396 	id <lt>AA01533> for dnew@nevada; Mon, 8 Jun 92 15:50:25 EDT</smaller><smaller><nl>
    397 Received: from snow-white.ee.udel.edu by louie.udel.edu id ah01113;<nl>
    398           8 Jun 92 15:45 EDT<nl>
    399 Received: from louie.udel.edu by snow-white.ee.udel.edu id aa01403;<nl>
    400           8 Jun 92 18:34 GMT<nl>
    401 Received: from CEARN.cern.ch by pucc.Princeton.EDU (IBM VM SMTP V2R2)<nl>
    402    with BSMTP id 0017; Sat, 06 Jun 92 18:56:24 EDT<nl>
    403 Received: from CEARN by CEARN.cern.ch (Mailer R2.07B) with BSMTP id 7873; Sun,=
    404 <nl>
    405  07 Jun 92 00:35:28 SET<nl>
    406 Received: from dxmint.cern.ch by CEARN.cern.ch (IBM VM SMTP V2R1) with TCP;<nl=
    407 >
    408    Sun, 07 Jun 92 00:35:21 SET<nl>
    409 Received: by dxmint.cern.ch (dxcern) (5.57/3.14)<nl>
    410 	id AA02301; Sun, 7 Jun 92 00:34:37 +0200<nl>
    411 Received: from dxmint.cern.ch by  nxoc01.cern.ch  (NeXT-1.0 (From Sendmail<nl>=
    412 
    413  5.52)/NeXT-2.0)<nl>
    414 	id AA08529; Sun, 7 Jun 92 00:34:17 MET DST<nl>
    415 Received: by dxmint.cern.ch (dxcern) (5.57/3.14)<nl>
    416 	id AA02281; Sun, 7 Jun 92 00:32:19 +0200<nl>
    417 Received: from pixel.convex.com by convex.convex.com (5.64/1.35)<nl>
    418 	id AA04364; Sat, 6 Jun 92 17:32:01 -0500<nl>
    419 Received: from localhost by pixel.convex.com (5.64/1.28)<nl>
    420 	id AA23867; Sat, 6 Jun 92 17:31:59 -0500<nl>
    421 Message-Id: <lt>9206062231.AA23867@pixel.convex.com><nl>
    422 To: www-interest@nxoc01.cern.ch<nl>
    423 Subject: revised MIME architecture<nl>
    424 Mime-Version: 1.0<nl>
    425 Content-Type: multipart/mixed;boundary=3Dcut-here<nl>
    426 Date: Sat, 06 Jun 92 17:31:58 CDT<nl>
    427 From: Dan Connolly <lt>connolly@pixel.convex.com><nl>
    428 Resent-Date:  Mon, 8 Jun 92 18:34:59 GMT<nl>
    429 Resent-From: new@ee.udel.edu<nl>
    430 Resent-To: dnew@thumper.bellcore.com</smaller><nl>
    431 <nl>
    432 In an earlier message, I proposed we make the W3 project<nl>
    433 interoperate with MIME systems. I made the mistake<nl>
    434 of using existing names for formats and types that<nl>
    435 don't yet exist.<nl>
    436 <nl>
    437 I'd like to make a more organized transition to MIME<nl>
    438 interoperability.<nl>
    439 <nl>
    440 First, we define some types for existing web servers<nl>
    441 and documents.<nl>
    442 <nl>
    443 X-HTTP is an access-type for message/external-body body<nl>
    444 parts to access existing W3 servers.<nl>
    445 Additional parameters include host, port, path, and anchor.<nl>
    446 <nl>
    447 X-HTML is a subtype of text for existing W3 documents.<nl>
    448 <nl>
    449 So the next part of this message is an HTML document expressed<nl>
    450 as a MIME external-body message.<nl>
    451 <nl>
    452 <nl>
    453 
    454 --Alternative.Boundary.keAvi9O0M2U=8U4XMt
    455 Content-type: message/external-body;
    456 	access-type="X-HTTP";
    457 	host="info.cern.ch";
    458 	port="2784";
    459 	path="/hypertext/WWW/TheProject.html"
    460 Content-Description: Object of type 'message/external-body;
    461 
    462 Content-type: text/X-HTML
    463 
    464 
    465 
    466 
    467 --Alternative.Boundary.keAvi9O0M2U=8U4XMt
    468 Content-type: text/richtext; charset=US-ASCII
    469 Content-Transfer-Encoding: quoted-printable
    470 
    471 <nl>
    472 Then we address limitations in the existing format with two<nl>
    473 new types:<nl>
    474 <nl>
    475 In order to encapsulate multimedia objects in web nodes,<nl>
    476 we define X-HYPERTEXT to be a subtype of the multipart body type.<nl>
    477 The first part of a multipart/X-HYPERTEXT is the content of the hypertext.<nl>=
    478 
    479 The other parts are multimedia attachments and links to other documents.<nl>
    480 <nl>
    481 The user agent (WWW client) displays the first part and allows the<nl>
    482 user to choose attachments and/or links. The attachments and links<nl>
    483 will be displayed in addition to or in place of the original content.<nl>
    484 <nl>
    485 Then, in order to formalize the structure of hypertext parts,<nl>
    486 we define X-SGML to be a subtype of text. The body of an X-SGML part must<nl>
    487 be a complete SGML document. The user agent (WWW client) will resolve<nl>
    488 external entities (such as the DTD and the mutlimedia attachments).<nl>
    489 <nl>
    490 So here's a multimedia web node expressed as MIME body part:<nl>
    491 <nl>
    492 <nl>
    493 
    494 --Alternative.Boundary.keAvi9O0M2U=8U4XMt
    495 Content-type: text/SGML
    496 Content-Description: Object of type 'text/SGML
    497 Content-Transfer-Encoding: quoted-printable
    498 
    499 <!DOCTYPE WEB-NODE SYSTEM
    500 [
    501 <!ENTITY UDI001 SDATA "HTTP://info.cern.ch/hypertext/WWW/TheProject.html"=
    502 >
    503 <!ENTITY part3 SDATA "part3">
    504 ]>
    505 <TITLE>Sample mutlimedia web node</TITLE>
    506 <SECTION><H1>Old features</H1>
    507 Here's a link to some info at cern:
    508  <A HREF=3DUDI001>cern stuff</A>
    509 <SECTION><H2>New features</H2>
    510 Here's a picture: <IMAGE ATTACHMENT=3Dpart3>
    511 
    512 
    513 
    514 
    515 --Alternative.Boundary.keAvi9O0M2U=8U4XMt
    516 Content-type: text/richtext; charset=US-ASCII
    517 Content-Transfer-Encoding: quoted-printable
    518 
    519 <nl>
    520 <nl>
    521 
    522 --Alternative.Boundary.keAvi9O0M2U=8U4XMt
    523 Content-type: message/external-body 	;
    524 	access-type="X-HTTP 	";
    525 	host="info.cern.ch";
    526 	name="/hypertext/WWW/TheProject.html"
    527 Content-Description: Object of type 'message/external-body
    528 
    529 Content-Type: text/X-HTML
    530 
    531 
    532 
    533 --Alternative.Boundary.keAvi9O0M2U=8U4XMt
    534 Content-type: text/richtext; charset=US-ASCII
    535 Content-Transfer-Encoding: quoted-printable
    536 
    537 <nl>
    538 <nl>
    539 
    540 --Alternative.Boundary.keAvi9O0M2U=8U4XMt
    541 Content-type: image/gif
    542 Content-Description: Object of type 'image/gif
    543 Content-Transfer-Encoding: base64
    544 
    545 R0lGODdhdQAvAIQAAL9/v3+ff39/f/+/f/+ff/9/f3+fv///v39/v//fv/+/v/+fv/9/v7+/
    546 f7+ff79/f//////f/7/fv7+/v7+fvwAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
    547 ACwAAAAAdQAvAAAF/uARHQkkiuMoQmZUnixUvkfNHjKbivM75riEMIa7xYiQXYvH/CVIMuhz
    548 5gK6nsuabUYawqamcCQJvOGKQZnz9oues9rge/wOy4asWdQpj6r1EWNVRSVKT3RLYXWEbIot
    549 jjw6J21jZEdaOycleVCTQYc9PXQ0nSMvXC4qg46QPzA4bWdKNXpvtFpPK4g+d4W9vUIKXHk7
    550 p0m2KSYJV0JrejmNrJp7dkLNwtbLPKmXLc3DUd8JCuTl2MzZh37ariuHnmVAUCZFpndXRi48
    551 2MvLKdauikWyBsyauXIUFEwgN65cQyFSfHhyZ+RFHlaPSFCEJgtWM45hapUhEWjIpn4N/oUp
    552 VEBhAAUCAwgsaKCA5sIJFG4qGLOpkx0Vyqz4PHkCVtBOIm040iNxEDeSmnz463dlwoKFORU4
    553 WKlw5oKtE6Z4wYelip0iZ6GdFIO27TGeOVyFzNiOjj01Upb0c5gym06rDVbhQRrU0MW5i5Ag
    554 MiJtLq83hfLeeZTr3x9xKJlhU9il54rPSNLY8JkmIxpCtogo4ZiGhpF5RSMXY4oys8FxFFIB
    555 HC3nSzXVae1AE8721cUaldrClT0pRw/nk9/ppjrB6gCNASNLYmURdOq0trQfOU4GeVBIqV85
    556 +SeqC3aDCgjEPzbxVEd7HefA+u72LO/XZ40CHVyGrOFJMTxd/rENVgoM8E5ZjyTiVizHAFiG
    557 RcGJIdx+QEGiiEVS4SWRP51dRoICCwxwlR9u5GJcLvRU5OGGMrYSIy0WMreDXVTkJ6IK7EBE
    558 RUMyOcCDdG8hh9YmErIhmlJoIMaYDq/JlVhHWeiD1xc7bpPNSgkJ0weM2mmkDGmJ/FQljegh
    559 AxlbUgKyhWXNHPlgkAmkqNUC0WmixYXdGKfknyKxiKFbUe6SRkC2UHRGT2Bcho5VFDjQkgPt
    560 VTFIJLck8ligH+boKYBbvIYlPCGGs9wU+qRCQaUvvYqpfVxwOlx3WWLnnRngNdYTIrKMtFQW
    561 JgVV7CEKTUCApcwye4U+AGWjV16H/oYWbJSjMZZtRo29WQsWRFVhEjsrESArrLAaKaQJKFpa
    562 XVilZYtKKRk1VaFo5GXbh3429lBUbMoksJC7lprrwAMUPGBpOuM4gJO7K42DGT1AFdWhLONI
    563 AA8MHu7nJKOZKOkGxaxilVPBsCr8KsJ9yVRpdczilFN1yQ4k7pH2CPHuTVigGa9cuHbHcRyP
    564 WuTCw+mmvLLCCDfoNLqWNoA0sy/Di9SJEryrCtIUNEABROAx2jHQzrkYEooviSnwAklbirAD
    565 cK+csDkGc02wrEizw0N1FFw1E82VKuQ13z2j5uG8cqiyhdksQV3pV0knXCnCABwMt8IDKDv1
    566 yefGTfXL/sHgxrnMr5KeU+kJ/Qfjf1Iq2U9nOLBkaeSOU90sAJI33XnblRpAQQAUCHDu6TjJ
    567 7O7LXb/ssAMzvUwOLl5gzJAxKOnE8OxUK9xsyg4AgPADlTsgQPcBPDCAVo6nW3nllTpggO1J
    568 TzA7uvQTD6uYLqCoQOzk8L3QMhErHur6Foy2+Q5q7Gtf+QLgAAR072DB413cHvC+CiLMgQAA
    569 nqXeF7m4tc948nscTqRmDpqhDXtVW96r+gY/k1EtAOH7HaxgKIAHIIB93useBR8APqXNTng6
    570 lJzjfGcp4B1wfkjcnfzmF0JYTcBrJxPg/CQoK/g9MGEG+F7CPNe98TXwAeUD/iMYPRc8ZgmP
    571 gb9DIdyKWEXgyfBzn6Pf5wY3Oyh2MH27U58G35i0ytkQbgCoIQQF4L1Aeq+MwXsb7oRnQAo4
    572 EIu4S5oR4WjF4U0RfrWrIhwrlcGEZfCQ32ug+PwYSB0igIfiCyMiEfa7DKrsbZy8ovvWeMZ0
    573 MYuIllwhCtu3Sypu8FwMrBwG3Za9B76NgoAU4xdPaUOVCW98fsQiGWdJQ08iIJadFGbc0IjG
    574 9qXxm7ubpi7f98AsUqBy5oTbI2uITMkdLIuBBKP3Tmk5dhLScq7M4vuaCUMdhg+Z6mQjGGG1
    575 PsmFz3dunJ3ChIcw4T2SlQzEYOX6Wal+ds+Bf6TA/vu8Vz6GRpOH5fsiIeUpgGdCkGl/dFv5
    576 3nfKLNqQoeVjX0oxSk7fKSyHNJVVJyf4PoqykX3Q/N4+J+c9kK7vAeMjZPlOGc8dEpKdBzvl
    577 +FoaVXkmbHyT46A8F7rTg17wpuaUXBYP9smLihJ3DwRl+XL3O6YlMosRjar4PGlP8fEwizW0
    578 5x+dejBBjlQAwEPqU+PJUbSCT56n3KKlxoewiKqskwpzIAQP1lD33bStZbzgR78HPsZWTpB7
    579 DWQikeq9GkoVqZ1N7D1hyEOGXm6WMFWqDi8HQ3MeM4ZbJSbu5DlUhY21sgAY61zHh9cyltK0
    580 zcwrakva2uX+0ZVVHaU8/jsaSGYmN4el/aIB/OhMZDbznAEFIjQvV6lhljV86wviTQfpSaYx
    581 NpFF7SxqmancZlZVnmSdnDq3ODkHCg+90y2lJzXoRQwmDIMMdSA92SdLoJLPrPoEpPscqdLK
    582 PhW1RWXnXW+KRmO6koKHPKkiiXlK1qZ1h/784hbXy1/wVVim+nzlA8mrxdemNWHr5eFV7dpM
    583 t57UdkB2p051O1nyNfam2luwVcUYQe2prFI1HKtMNRpZAPzzqmjl6EKv+sca4ni0hy3yiitV
    584 ADIr9sprbB8pYfjlTt7ze/1cMgTZ7FJWTtbFUrZcA10JZaTqcKzDPCxyUVliPx/WXMtiAHkn
    585 KchJNbO1sf/87YjLqsXLehmVS0urA0yMSmEyjZQPZOxhF2rovuZWACEAADs=
    586 
    587 
    588 
    589 --Alternative.Boundary.keAvi9O0M2U=8U4XMt
    590 Content-type: text/richtext; charset=US-ASCII
    591 Content-Transfer-Encoding: quoted-printable
    592 
    593 <nl>
    594 And here's the DTD for WEB-NODE documents:<nl>
    595 <nl>
    596 <lt>!-- This DTD was produced by DeveGram on Tue Jun  2 18:58:16 1992 --><nl>
    597 <lt>!-- and hand-edited by connolly@convex.com --><nl>
    598 <nl>
    599 <lt>!--     Parameter Entities       --><nl>
    600 <nl>
    601 <lt>!--      Terminal symbols        --><nl>
    602 <nl>
    603 <lt>!ENTITY % words "#PCDATA" ><nl>
    604 <nl>
    605 <lt>!--    Non-ELEMENT symbols       --><nl>
    606 <nl>
    607 <lt>!ENTITY % inline	"%words | A" ><nl>
    608 <lt>!ENTITY % text         "%inline | P | IMAGE" ><nl>
    609 <lt>!ENTITY % heading "H1|H2|H3|H4|H5|H6" ><nl>
    610 <nl>
    611 <lt>!ENTITY lt "<lt>"><nl>
    612 <lt>!ENTITY gt ">"><nl>
    613 <lt>!ENTITY amp "&"><nl>
    614 <nl>
    615 <lt>!ENTITY lt. "<lt>"><nl>
    616 <lt>!ENTITY gt. ">"><nl>
    617 <lt>!ENTITY amp. "&"><nl>
    618 <nl>
    619 <lt>!--     Document structure       --><nl>
    620 <nl>
    621 <lt>!ELEMENT WEB-NODE	O O  (TITLE, NEXTID?, ISINDEX?, section+, ADDRESS?)><nl>=
    622 
    623 <nl>
    624 <lt>!ELEMENT TITLE	- -  (%inline)+><nl>
    625 <lt>!ELEMENT ADDRESS - - (%text)+><nl>
    626 <nl>
    627 <lt>!ELEMENT NEXTID - O EMPTY ><nl>
    628 <lt>!ATTLIST NEXTID N NUMBER #IMPLIED><nl>
    629 <nl>
    630 <lt>!ELEMENT ISINDEX - O EMPTY ><nl>
    631 <nl>
    632 <nl>
    633 <lt>!ELEMENT section O O ((%heading)?,<nl>
    634 			(<nl>
    635 			%text |<nl>
    636 			section |<nl>
    637 			MENU |<nl>
    638 			UL |<nl>
    639 			OL |<nl>
    640 			DIR |<nl>
    641 			DL)+)><nl>
    642 <nl>
    643 <lt>!ELEMENT (H1|H2|H3|H4|H5|H6)	- -  (%inline) ><nl>
    644 <nl>
    645 <lt>!ELEMENT P	- O  EMPTY -- paragraph SEPARATOR --><nl>
    646 <nl>
    647 <lt>!ELEMENT IMAGE - O  EMPTY><nl>
    648 <lt>!ATTLIST IMAGE ATTACHMENT ENTITY #REQUIRED><nl>
    649 <nl>
    650 <lt>!ELEMENT A	- -  (%inline)+><nl>
    651 <lt>!ATTLIST A<nl>
    652 	NAME CDATA #IMPLIED<nl>
    653 	HREF ENTITY #IMPLIED<nl>
    654 	TYPE CDATA #IMPLIED --@@-- ><nl>
    655 <nl>
    656 <lt>!ELEMENT MENU	- -  (LI+)><nl>
    657 <nl>
    658 <lt>!ELEMENT UL	- -  (LI+)><nl>
    659 <nl>
    660 <lt>!ELEMENT OL	- -  (LI+)><nl>
    661 <nl>
    662 <lt>!ELEMENT DIR	- -  (LI+)><nl>
    663 <nl>
    664 <lt>!ELEMENT LI	- O  (%text)+><nl>
    665 <nl>
    666 <lt>!ELEMENT DL	- -  ((DT, DD)+)><nl>
    667 <nl>
    668 <lt>!ELEMENT DT	- O  (%inline)+><nl>
    669 <nl>
    670 <lt>!ELEMENT DD	- O  (%text)+><nl>
    671 <nl>
    672 And here's a perl script to convert an HTML document<nl>
    673 into a multipart/X-HYPERTEXT MIME body part:<nl>
    674 <nl>
    675 #!/usr/local/bin/perl<nl>
    676 <nl>
    677 $boundary =3D "attachment";<nl>
    678 print "Content-Type: multipart/X-HYPERTEXT; boundary=3D$boundary\n\n";<nl>
    679 <nl>
    680 print "--$boundary\n";<nl>
    681 print "Content-Type: text/SGML\n\n";<nl>
    682 <nl>
    683 print "<lt>!DOCTYPE WEB-NODE SYSTEM \n[\n";<nl>
    684 <nl>
    685 @html =3D <lt>>;			# read whole file<nl>
    686 $_ =3D join('', @html);<nl>
    687 $out =3D '';<nl>
    688 <nl>
    689 sub fix_anchor{<nl>
    690     local($name, $href, $type);<nl>
    691 <nl>
    692     # What exactly is the syntax of an SGML attribute value?<nl>
    693     while(s/^(\w+)\s*=3D\s*((\"[^\"]*\")|([^\s>]+))\s*//){<nl>
    694 	local($v) =3D ($3 || $4);<nl>
    695 	local($a) =3D $1;<nl>
    696 	$href =3D $v if $a =3D~ /^href$/i;<nl>
    697 	$name =3D $v if $a =3D~ /^name$/i;<nl>
    698 	$type =3D $v if $a =3D~ /^type$/i;<nl>
    699     }<nl>
    700     s/[^>]*>//;<nl>
    701 <nl>
    702     $out .=3D "<lt>A";<nl>
    703     $out .=3D " NAME=3D\"$name\"" if $name ne '';<nl>
    704     $out .=3D " TYPE=3D\"$type\"" if $type ne '';<nl>
    705     if($href ne ''){<nl>
    706 	if(!defined($anchor{$href})){<nl>
    707 	    $anchor{$href} =3D ++$anchor;<nl>
    708 	}<nl>
    709 	$out .=3D " HREF=3D" . $anchor{$href};<nl>
    710     }<nl>
    711     $out .=3D ">";<nl>
    712 }<nl>
    713 <nl>
    714 $header =3D 0;<nl>
    715 $anchor =3D "UDI000";<nl>
    716 while(/<lt>/){<nl>
    717     $out .=3D $`;<nl>
    718     $_ =3D $';<nl>
    719     if(s/^A\s+//i){<nl>
    720 	&fix_anchor;<nl>
    721     }elsif(s/^NEXTID\s+(\d+)\s*>//){<nl>
    722 	$out .=3D "<lt>NEXTID N=3D$1>";<nl>
    723     }elsif(s/^H(\d)>//){<nl>
    724 	local($n) =3D $1;<nl>
    725 	while($n<lt>=3D$header){ $out .=3D "<lt>/SECTION>"; $header--; }<nl>
    726 	while($n>$header){ $out .=3D "<lt>SECTION>"; $header++; }<nl>
    727 	$out .=3D "<lt>H$n>";<nl>
    728     }else{<nl>
    729 	$out .=3D '<lt>';<nl>
    730     }<nl>
    731 }<nl>
    732 <nl>
    733 $out .=3D $_;<nl>
    734 <nl>
    735 foreach(keys %anchor){<nl>
    736     local($ent) =3D $anchor{$_};<nl>
    737 <nl>
    738     print "<lt>!ENTITY $ent SDATA \"$_\">\n";<nl>
    739 }<nl>
    740 <nl>
    741 print "]>\n", $out;<nl>
    742 <nl>
    743 foreach(keys %anchor){<nl>
    744     local($access_type);<nl>
    745 <nl>
    746     print "\n\n--$boundary\n";<nl>
    747     print "Content-id: $_\n";<nl>
    748     print "Content-type: message/external-body\n";<nl>
    749 <nl>
    750     $access_type =3D $1 if s/^(\w+)://;<nl>
    751 <nl>
    752     if(s/#([^#]+)$//){<nl>
    753 	print "\t;x-anchor=3D\"$1\"\n";<nl>
    754     }<nl>
    755 <nl>
    756     if($access_type =3D~ /file/i){<nl>
    757 	if(&hostport){<nl>
    758 	    &param('access-type', "ANON-FTP");<nl>
    759 	}else{<nl>
    760 	    &param('access-type', 'LOCAL-FILE');<nl>
    761 	}<nl>
    762 	&param('name', $_);<nl>
    763 <nl>
    764 	print "\nContent-Type: application/octet-stream\n\n";<nl>
    765     }elsif($access_type =3D~ /http/i){<nl>
    766 	&param('access-type', 'X-HTTP');<nl>
    767 	&hostport;<nl>
    768 	&unescape;<nl>
    769 	&param('name', $_);<nl>
    770 <nl>
    771 	print "\nContent-Type: text/X-HTML\n\n";<nl>
    772     }elsif($access_type =3D~ /news/i){<nl>
    773 	&param('access-type', 'X-NEWS');<nl>
    774 	&unescape;<nl>
    775 	if(/@/){<nl>
    776 	    &param('message-id', $_);<nl>
    777 	}else{<nl>
    778 	    &param('group', $_);<nl>
    779 	}<nl>
    780 <nl>
    781 	print "\nContent-Type: message\n\n";<nl>
    782 <nl>
    783     }elsif($access_type =3D~ /telnet/i){<nl>
    784 	&param('access-type', 'x-telnet');<nl>
    785 	&unescape;<nl>
    786 	&param('user', $1) if s/^(.*)@//;<nl>
    787 	&param('port', $1) if s/:(.*)$//;<nl>
    788 	&param('site', $_);<nl>
    789 <nl>
    790 	print "\nContent-Type: X-TELNET\n\n";<nl>
    791 <nl>
    792     }elsif($access_type =3D~ /gopher/i){<nl>
    793 	&param('access-type', 'x-gopher');<nl>
    794 	&hostport;<nl>
    795 	&param('type', $1) if s-^/(\d+)/--;<nl>
    796 	&unescape;<nl>
    797 	&param('selector', $_);<nl>
    798 <nl>
    799 	print "\nContent-Type: @@@@\n\n";<nl>
    800 <nl>
    801     }elsif($access_type =3D~ /wais/i){<nl>
    802 	&param('access-type', 'x-wais');<nl>
    803 	&hostport;<nl>
    804 	if(m-^/-){<nl>
    805 	    &param('type', $1) if s-^/(\w+)--;<nl>
    806 	    &param('size', $1) if s-^/(\d+)--;<nl>
    807 	    &unescape;<nl>
    808 	    &param('path', $_);<nl>
    809 	}else{<nl>
    810 	    &unescape;<nl>
    811 	    &param('words', $1) if /\?(.*)/;<nl>
    812 	}<nl>
    813 <nl>
    814 	$type =3D "image/$type" if $type =3D~ /gif|tiff/i;<nl>
    815 	$type =3D "application/postscript" if $type =3D~ /PS/i;<nl>
    816 <nl>
    817 	print "\nContent-Type: $type\n\n";<nl>
    818 <nl>
    819     }elsif($access_type eq ""){<nl>
    820 	&param('access-type', 'x-relative');<nl>
    821 	&unescape;<nl>
    822 	&param('name', $_);<nl>
    823 <nl>
    824 	print "\nContent-Type: message\n\n";<nl>
    825     }else{<nl>
    826 	warn "unknown access type: $access_type in $_";<nl>
    827     }<nl>
    828 }<nl>
    829 <nl>
    830 print "--$boundary--\n";<nl>
    831 <nl>
    832 sub unescape{<nl>
    833     s/%(\w\w)/sprintf("%c",hex($1))/ge;<nl>
    834 }<nl>
    835 <nl>
    836 sub param{<nl>
    837     local($p, $v) =3D @_;<nl>
    838     # quote tspecials in parameter values<nl>
    839     $v =3D '"'.$v.'"' if $v =3D~ m-[\s()<lt>>@,;:\\\"\/\[\]?\.=3D]-;<nl>
    840     print "\t;$p=3D$v\n";<nl>
    841 }<nl>
    842 <nl>
    843 sub hostport{<nl>
    844     if(s-//([^:/]+)--){<nl>
    845 	&param('host', $1);<nl>
    846 	&param('port', $1)  if s/:(\d+)//;<nl>
    847 	1;<nl>
    848     }else{<nl>
    849 	0;<nl>
    850     }<nl>
    851 }<nl>
    852 <nl>
    853 
    854 --Alternative.Boundary.keAvi9O0M2U=8U4XMt--
    855 
    856 --Interpart.Boundary.keAvi9O0M2U=AU4XRw--
    857