[horde] Imp and go.php mailto handling
Daniel A. Ramaley
daniel.ramaley at DRAKE.EDU
Fri Jan 27 09:15:24 PST 2006
On Thursday 26 January 2006 10:40, Daniel A. Ramaley wrote:
>Using Horde 3.0.9 and Imp 4.0.4 i've found that when viewing an HTML
>e-mail that contains mailto: links the links do nothing. Imp rewrites
>the mailto: links to point to Horde's services/go.php, but go.php
>doesn't do anything with them. Do i have something misconfigured, or is
>there a fix for this?
I have written a patch that needs to be applied to horde/services/go.php which fixes the issue. Here it is:
--- horde/services/go.php~ 2005-05-05 09:11:25.000000000 -0500
+++ horde/services/go.php 2006-01-27 11:08:02.000000000 -0600
@@ -30,6 +30,24 @@
$url = @parse_url(trim($_GET['url']));
}
+// Handle mailto: URLs.
+if ($url['scheme'] == 'mailto' and !empty($url['path'])) {
+ $path = 'to=' . $url['path'];
+ if (!empty($url['query'])) {
+ foreach (explode('&', $url['query']) as $value) {
+ $value = preg_replace('/^body=/', 'message=', $value);
+ $path .= '&' . $value;
+ }
+ }
+
+ @define('HORDE_BASE', dirname(__FILE__) . '/..');
+ require_once dirname(__FILE__) . '/../lib/core.php';
+ $registry = &Registry::singleton();
+ $newurl = $registry->{'applications'}{'imp'}{'webroot'} . "/compose.php?$path";
+ header('Refresh: 0; URL=' . $newurl);
+ exit;
+}
+
if (empty($url) || empty($url['host'])) {
exit;
}
------------------------------------------------------------------------
Dan Ramaley Dial Center 118, Drake University
Network Programmer/Analyst 2407 Carpenter Ave
+1 515 271-4540 Des Moines IA 50311 USA
More information about the horde
mailing list