diff options
author | Alvaro Herrera | 2009-05-24 15:01:43 +0000 |
---|---|---|
committer | Alvaro Herrera | 2009-05-24 15:01:43 +0000 |
commit | b5108c4734910339e0d0b08a4400ea73115785e7 (patch) | |
tree | 6a67bc935261e0671e06b571415866364bdc464e | |
parent | db1f91fdc706548e6573d7891cd458f3fd0b924a (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.php | 22 |
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; +} + +?> + |