summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlvaro Herrera2009-05-24 15:01:43 +0000
committerAlvaro Herrera2009-05-24 15:01:43 +0000
commitb5108c4734910339e0d0b08a4400ea73115785e7 (patch)
tree6a67bc935261e0671e06b571415866364bdc464e
parentdb1f91fdc706548e6573d7891cd458f3fd0b924a (diff)
Add PHP script to fetch a message as plain/text by msgid
git-svn-id: file:///Users/dpage/pgweb/svn-repo/trunk@2491 8f5c7a92-453e-0410-a47f-ad33c8a6b003
-rw-r--r--archives/html/msgtxt.php22
1 files changed, 22 insertions, 0 deletions
diff --git a/archives/html/msgtxt.php b/archives/html/msgtxt.php
new file mode 100644
index 00000000..ee8b02ee
--- /dev/null
+++ b/archives/html/msgtxt.php
@@ -0,0 +1,22 @@
+<?php
+
+$id = $_GET["id"];
+$id = str_replace("/", "_", $id);
+
+$parts = split("@", $id, 2);
+
+header("Content-type: text/plain");
+
+$filename= "/home/archives/messages/@" . $parts[1] . "/" . $parts[0];
+$file = fopen($filename, "r");
+if (!$file) {
+ print "not found\n";
+ exit;
+}
+
+while ($line = fread($file, 8192)) {
+ print $line;
+}
+
+?>
+