Opened 4 years ago

Closed 3 years ago

#1486037 closed Feature Patches (fixed)

Roundcube composer should filter out 'mailto:' in addresses (for use as protocol handler)

Reported by: Tobbi Owned by:
Priority: 5 Milestone: 0.4-beta
Component: Core functionality Version: git-master
Severity: normal Keywords:
Cc: trisk@…

Description

It would be great if Roundcube could support external mailto calls. At the moment, when opening a mail address like mailto:test@… with Roundcube, the mailto: protocol still stays together with the mail address. We should filter that out to make it support that.

See https://bugzilla.mozilla.org/show_bug.cgi?id=509086 for the Bugzilla bug.

Change History (6)

comment:1 follow-up: Changed 4 years ago by thomasb

I don't quite understand what you're asking for. Could give an example?

comment:2 in reply to: ↑ 1 Changed 4 years ago by Tobbi

Replying to thomasb:

I don't quite understand what you're asking for. Could give an example?

Firefox is able to support external Webmail clients as mailto handlers http://support.mozilla.com/en-US/kb/Changing+the+e-mail+program+used+by+Firefox#Using_webmail_services

There's a way to add webmail services, like GMail, Yahoo! (AND Roundcube), to this list. However, when registering Roundcube as external handler for mailto: links (cf. http://www.roundcubeforum.net/roundcube-discussion/1231-mailto-link-opening-roundcube.html), Firefox passes the whole mailto string to roundcube, which is (mailto:mailaddress@…).

Is there a way to filter the mailto: per default so that it doesn't appear in the 'TO' bar at all?

Did you understand now, what I'm pointing to?

comment:3 Changed 3 years ago by trisk

  • Milestone changed from later to 0.4-beta
  • Summary changed from Support using Roundcube webmail as external protocol handler (filter out 'mailto:') to Roundcube composer should filter out 'mailto:' in addresses (for use as protocol handler)
  • Version changed from 0.3-rc1 to svn-trunk

The problem is that if the composer is invoked as "?_task=mail&_action=compose&to=mailto:user@…"

The Recipient field has "mailto:user@…" instead of "user@host".

comment:4 Changed 3 years ago by trisk

  • Type changed from Feature Requests to Patches

Here's a solution for the problem: Extract the address from the string after "mailto:", and reassign the 'to' parameter. As before, we parse additional parameters in the URI.

Index: program/steps/mail/compose.inc
===================================================================
--- program/steps/mail/compose.inc      (revision 3214)
+++ program/steps/mail/compose.inc      (working copy)
@@ -44,9 +44,11 @@
   
   // process values like "mailto:foo@bar.com?subject=new+message&cc=another"
   if ($_SESSION['compose']['param']['to']) {
-    $mailto = explode('?', $_SESSION['compose']['param']['to']);
+    if (preg_match('/^mailto:(.*)/i', $_SESSION['compose']['param']['to'], $mailto)) {
+      $mailto = explode('?', $mailto[1]);
+      $_SESSION['compose']['param']['to'] = $mailto[0];
+    }
     if (count($mailto) > 1) {
-      $_SESSION['compose']['param']['to'] = $mailto[0];
       parse_str($mailto[1], $query);
       foreach ($query as $f => $val)
         $_SESSION['compose']['param'][$f] = $val;

comment:5 Changed 3 years ago by trisk

  • Cc trisk@… added

comment:6 Changed 3 years ago by alec

  • Resolution set to fixed
  • Status changed from new to closed

Fixed in [3e8898ef].

Note: See TracTickets for help on using tickets.