Commit Diff


commit - f1ceade9f67fd8e6d5f2b278d97303fffd3f76c1
commit + 84989e10fb9698b366551500ae77fdef784f4d92
blob - bf6ca9f2b573e71a41fcd7ef97791b936c9fc5f6
blob + 2eac6c03f71e3970f22856ec0b085e1a03e6ef7e
--- Makefile
+++ Makefile
@@ -13,6 +13,7 @@ all: .mblaze dirs assets
 dirs:
 	mkdir -p ${OUTDIR}/mbox/
 	mkdir -p ${OUTDIR}/parts/
+	mkdir -p ${OUTDIR}/text/
 	mkdir -p ${OUTDIR}/thread/
 
 assets: dirs got.png style.css
blob - 72c6a0607706032218ca0b1fdc2f00e262a4c498
blob + 14a383944d72862e8136b9b5e9877fce6811ba6c
--- mexp
+++ mexp
@@ -95,6 +95,9 @@ while (<>) {
 	open(my $mshow, "-|", "mshow", "-nNA", "text/plain", $fname)
 	    or die "can't exec mshow: $!";
 
+	open(my $text, '>', "$outdir/text/$mid.txt")
+	    or die "can't open $outdir/text/$mid.txt: $!";
+
 	print $fh "<header class='mail-header'>";
 	print $fh "<p>";
 	print $fh $logo;
@@ -105,6 +108,7 @@ while (<>) {
 	print $fh "<dl>";
 	while (<$mshow>) {
 		chomp;
+		say $text $_;
 		last if /^$/;
 		my ($h, $v) = m/^([-A-Za-z]+): (.*)/;
 		die "bogus line? $fname : $_" unless (defined $h and defined $v);
@@ -116,7 +120,8 @@ while (<>) {
 		print $fh "<dd>", san($v), "</dd>";
 	}
 	print $fh "</dl>";
-	print $fh "<p><a href='/mbox/$mid.mbox'>Raw message</a></p>";
+	print $fh "<p>Raw <a href='/mbox/$mid.mbox'>message</a>";
+	print $fh " or <a href='/text/$mid.txt'>body</a>.</p>";
 	print $fh "</header>";
 
 	my $body = do {
@@ -125,10 +130,11 @@ while (<>) {
 	};
 
 	print $fh "<pre>";
-	# print $fh san($_) while <>;
 	print $fh san($body // "");
 	print $fh "</pre>";
 
+	print $text $body;
+
 	# generate the listing for the exported parts
 	my $part_seen = 0;
 	while (<$parts>) {
@@ -142,6 +148,7 @@ while (<>) {
 
 	print $fh $foot;
 
+	close($text);
 	close($mshow);
 	close($parts);
 	close($fh);