Add PHP script to fetch a message as plain/text by msgid
authorAlvaro Herrera <alvherre@alvh.no-ip.org>
Sun, 24 May 2009 15:01:43 +0000 (15:01 +0000)
committerAlvaro Herrera <alvherre@alvh.no-ip.org>
Sun, 24 May 2009 15:01:43 +0000 (15:01 +0000)
git-svn-id: file:///Users/dpage/pgweb/svn-repo/trunk@2491 8f5c7a92-453e-0410-a47f-ad33c8a6b003

archives/html/msgtxt.php [new file with mode: 0644]

diff --git a/archives/html/msgtxt.php b/archives/html/msgtxt.php
new file mode 100644 (file)
index 0000000..ee8b02e
--- /dev/null
@@ -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;
+}
+
+?>
+