Index: src/terminal-util.c
===================================================================
--- src/terminal-util.c	(revision 3293)
+++ src/terminal-util.c	(working copy)
@@ -212,40 +212,39 @@
                         guint32 user_time)
 {
   GError *error = NULL;
-  char *uri;
+  GString *uri;
 
   g_return_if_fail (orig_url != NULL);
 
   switch (flavor)
     {
-    case FLAVOR_DEFAULT_TO_HTTP:
-      uri = g_strdup_printf ("http:%s", orig_url);
+    case FLAVOR_WWW_ADDRESS:
+      uri = g_string_new ("http://");
+      g_string_append (uri, orig_url);
       break;
-    case FLAVOR_EMAIL:
-      if (g_ascii_strncasecmp ("mailto:", orig_url, 7) != 0)
-	uri = g_strdup_printf ("mailto:%s", orig_url);
-      else
-	uri = g_strdup (orig_url);
+    case FLAVOR_EMAIL_ADDRESS:
+      uri = g_string_new ("mailto:");
+      g_string_append_uri_escaped (uri, orig_url, "$_!", FALSE);
       break;
-    case FLAVOR_VOIP_CALL:
+    case FLAVOR_URI:
     case FLAVOR_AS_IS:
-      uri = g_strdup (orig_url);
+      uri = g_string_new (orig_url);
       break;
     default:
-      uri = NULL;
+	  uri = NULL;
       g_assert_not_reached ();
     }
 
-  if (!open_url (GTK_WINDOW (parent), uri, user_time, &error))
+  if (!open_url (GTK_WINDOW (parent), uri->str, user_time, &error))
     {
       terminal_util_show_error_dialog (GTK_WINDOW (parent), NULL,
                                        _("Could not open the address “%s”:\n%s"),
-                                       uri, error->message);
+                                       uri->str, error->message);
 
       g_error_free (error);
     }
 
-  g_free (uri);
+  g_string_free (uri, TRUE);
 }
 
 /**
Index: src/terminal-screen.c
===================================================================
--- src/terminal-screen.c	(revision 3293)
+++ src/terminal-screen.c	(working copy)
@@ -144,17 +144,67 @@
 
 static guint signals[LAST_SIGNAL];
 
-#define USERCHARS "-[:alnum:]"
-#define USERCHARS_CLASS "[" USERCHARS "]"
-#define PASSCHARS_CLASS "[-[:alnum:]\\Q,?;.:/!%$^*&~\"#'\\E]"
-#define HOSTCHARS_CLASS "[-[:alnum:]]"
-#define HOST HOSTCHARS_CLASS "+(\\." HOSTCHARS_CLASS "+)*"
-#define PORT "(?:\\:[[:digit:]]{1,5})?"
-#define PATHCHARS_CLASS "[-[:alnum:]\\Q_$.+!*,;@&=?/~#%\\E]"
-#define SCHEME "(?:news:|telnet:|nntp:|file:\\/|https?:|ftps?:|webcal:)"
-#define USERPASS USERCHARS_CLASS "+(?:" PASSCHARS_CLASS "+)?"
-#define URLPATH   "(/"PATHCHARS_CLASS"+(?:[(]"PATHCHARS_CLASS"*[)])*"PATHCHARS_CLASS"*)*"
+#define DIGIT                 "0-9"
+#define HEXDIG                DIGIT "a-fA-F"
+#define ALPHA                 "a-zA-Z"
+#define ALNUM                 ALPHA DIGIT
 
+/* URI: see http://tools.ietf.org/html/rfc3986 */
+#define UNRESERVED            ALNUM "\\Q-._~\\E"
+//#define GEN_DELIMS            "\\Q:/?#[]@\\E"
+#define SUB_DELIMS            "\\Q!$&'()*+,;=\\E"
+//#define RESERVED              GEN_DELIMS SUB_DELIMS
+
+#define PCT_ENCODED           "%" "[" HEXDIG "]{2}"
+#define PCHAR                 "(?:" PCT_ENCODED "|[" UNRESERVED SUB_DELIMS "\\Q:@\\E])"
+#define SCHEME                "[" ALPHA "][" ALNUM "\\Q+-.\\E]*"
+#define SEGMENT               PCHAR "*"
+#define SEGMENT_NZ            PCHAR "+"
+//#define SEGMENT_NZ_NC         "(?:" PCT_ENCODED "|[" UNRESERVED SUB_DELIMS "\\@])+"
+#define PATH_ABEMPTY          "(?:/" SEGMENT ")*"
+#define PATH_ROOTLESS         SEGMENT_NZ PATH_ABEMPTY 
+//#define PATH_NOSCHEME         SEGMENT_NZ_NC PATH_ABEMPTY
+#define PATH_ABSOLUTE         "/(?:" PATH_ROOTLESS ")?"
+#define PATH_EMPTY            "(?!" PCHAR "+)"
+#define USERINFO              "(?:" PCT_ENCODED "|[" UNRESERVED SUB_DELIMS ":])*"
+#define DEC_OCTET             "(?:1[" DIGIT "]{2}|[1-9][" DIGIT "]|2[0-4][" DIGIT "]|25[0-5]|[" DIGIT "])" 
+#define IPv4_ADDRESS          DEC_OCTET "(?:\\." DEC_OCTET "){3}"
+#define H16                   "[" HEXDIG "]{1,4}"
+#define LS32                  "(?:" H16 ":" H16 "|" IPv4_ADDRESS ")"
+#define IPv6_ADDRESS          "(?:" \
+                                "(?:" H16 ":){6}" LS32 "|" \
+                                "::(?:" H16 ":){5}" LS32 "|" \
+                                "(?:" H16 ")?::(?:" H16 ":){4}" LS32 "|" \
+                                "(?:(?:" H16 ":)?" H16 ")?::(?:" H16 ":){3}" LS32 "|" \
+                                "(?:(?:" H16 ":){,2}" H16 ")?::(?:" H16 ":){2}" LS32 "|" \
+                                "(?:(?:" H16 ":){,3}" H16 ")?::" H16 ":" LS32 "|" \
+                                "(?:(?:" H16 ":){,4}" H16 ")?::" LS32 "|" \
+                                "(?:(?:" H16 ":){,5}" H16 ")?::" H16 "|" \
+                                "(?:(?:" H16 ":){,6}" H16 ")?::" \
+                              ")"
+#define IPvFUTURE             "v[" HEXDIG "]+\\.[" UNRESERVED SUB_DELIMS ":]+" 
+#define IP_LITERAL            "\\[(?:" IPv6_ADDRESS "|" IPvFUTURE ")\\]"
+#define REG_NAME              "(?:" PCT_ENCODED "|[" UNRESERVED SUB_DELIMS "])*"
+#define HOST                  "(?:" IP_LITERAL "|" IPv4_ADDRESS "|" REG_NAME ")"
+#define PORT                  "[" DIGIT "]*"
+#define AUTHORITY             "(?:" USERINFO "\\@)?" HOST "(?::" PORT ")?"
+#define HIER_PART             "(?:(?://" AUTHORITY "|" SEGMENT_NZ ")" PATH_ABEMPTY "|" PATH_ABSOLUTE "|" PATH_EMPTY ")"
+#define QUERY                 "(?:" PCT_ENCODED "|[" UNRESERVED SUB_DELIMS "\\Q:@/?\\E])*"
+#define FRAGMENT              QUERY
+#define URI                   SCHEME ":" HIER_PART "(?:\\?" QUERY ")?(?:\\#" FRAGMENT ")?"
+
+/* Internet Message Address: see http://tools.ietf.org/html/rfc5322 */
+#define LABEL                 "[" ALNUM "](?:-*[" ALNUM "]+)*"
+#define DOMAIN                LABEL "(?:\\." LABEL ")*"
+
+#define UNQUOTED              ALNUM "\\Q-!#$%&'*+/=?^_`{|}~\\E"
+#define QUOTED                "\\Q@\\\\,\[] \\E"
+#define LOCAL                 "(?:[" UNQUOTED "](?:[" UNQUOTED "]|\\\\[" QUOTED "\"]|\\.(?!\\.))*|\"[" QUOTED UNQUOTED "]+\")"
+#define EMAIL_ADDRESS         LOCAL "\\@" DOMAIN
+
+/* Misc */
+#define WWW_ADDRESS           "www\\." DOMAIN "(?::" PORT ")?" PATH_ABEMPTY "(?:\\?" QUERY ")?(?:\\#" FRAGMENT ")?"
+
 typedef struct {
   const char *pattern;
   TerminalURLFlavour flavor;
@@ -162,11 +212,9 @@
 } TerminalRegexPattern;
 
 static const TerminalRegexPattern url_regex_patterns[] = {
-  { SCHEME "//(?:" USERPASS "\\@)?" HOST PORT URLPATH, FLAVOR_AS_IS, G_REGEX_CASELESS },
-  { "(?:www|ftp)" HOSTCHARS_CLASS "*\\." HOST PORT URLPATH , FLAVOR_DEFAULT_TO_HTTP, G_REGEX_CASELESS  },
-  { "(?:callto:|h323:|sip:)" USERCHARS_CLASS "[" USERCHARS ".]*(?:" PORT "/[a-z0-9]+)?\\@" HOST, FLAVOR_VOIP_CALL, G_REGEX_CASELESS  },
-  { "(?:mailto:)?" USERCHARS_CLASS "[" USERCHARS ".]*\\@" HOSTCHARS_CLASS "+\\." HOST, FLAVOR_EMAIL, G_REGEX_CASELESS  },
-  { "news:[[:alnum:]\\Q^_{|}~!\"#$%&'()*+,./;:=?`\\E]+", FLAVOR_AS_IS, G_REGEX_CASELESS  },
+  { URI,           FLAVOR_URI,           G_REGEX_CASELESS },
+  { WWW_ADDRESS,   FLAVOR_WWW_ADDRESS,   G_REGEX_CASELESS },
+  { EMAIL_ADDRESS, FLAVOR_EMAIL_ADDRESS, G_REGEX_CASELESS }
 };
 
 static const TerminalRegexPattern skey_regex_patterns[] = {
Index: src/terminal-screen.h
===================================================================
--- src/terminal-screen.h	(revision 3293)
+++ src/terminal-screen.h	(working copy)
@@ -29,9 +29,9 @@
 
 typedef enum {
   FLAVOR_AS_IS,
-  FLAVOR_DEFAULT_TO_HTTP,
-  FLAVOR_VOIP_CALL,
-  FLAVOR_EMAIL,
+  FLAVOR_WWW_ADDRESS,
+  FLAVOR_EMAIL_ADDRESS,
+  FLAVOR_URI,
   FLAVOR_SKEY
 } TerminalURLFlavour;
 
Index: src/terminal-window.c
===================================================================
--- src/terminal-window.c	(revision 3293)
+++ src/terminal-window.c	(working copy)
@@ -1202,18 +1202,14 @@
 
   can_paste = targets != NULL && gtk_targets_include_text (targets, n_targets);
   can_paste_uris = targets != NULL && gtk_targets_include_uri (targets, n_targets);
-  show_link = info->string != NULL && (info->flavour == FLAVOR_AS_IS || info->flavour == FLAVOR_DEFAULT_TO_HTTP);
-  show_email_link = info->string != NULL && info->flavour == FLAVOR_EMAIL;
-  show_call_link = info->string != NULL && info->flavour == FLAVOR_VOIP_CALL;
+  show_link = info->string != NULL &&
+    (info->flavour == FLAVOR_AS_IS || info->flavour == FLAVOR_URI || info->flavour == FLAVOR_WWW_ADDRESS);
+  show_email_link = info->string != NULL && info->flavour == FLAVOR_EMAIL_ADDRESS;
 
   action = gtk_action_group_get_action (priv->action_group, "PopupSendEmail");
   gtk_action_set_visible (action, show_email_link);
   action = gtk_action_group_get_action (priv->action_group, "PopupCopyEmailAddress");
   gtk_action_set_visible (action, show_email_link);
-  action = gtk_action_group_get_action (priv->action_group, "PopupCall");
-  gtk_action_set_visible (action, show_call_link);
-  action = gtk_action_group_get_action (priv->action_group, "PopupCopyCallAddress");
-  gtk_action_set_visible (action, show_call_link);
   action = gtk_action_group_get_action (priv->action_group, "PopupOpenLink");
   gtk_action_set_visible (action, show_link);
   action = gtk_action_group_get_action (priv->action_group, "PopupCopyLinkAddress");
@@ -1662,12 +1658,6 @@
       { "PopupCopyEmailAddress", NULL, N_("_Copy E-mail Address"), NULL,
         NULL,
         G_CALLBACK (popup_copy_url_callback) },
-      { "PopupCall", NULL, N_("C_all To…"), NULL,
-        NULL,
-        G_CALLBACK (popup_open_url_callback) },
-      { "PopupCopyCallAddress", NULL, N_("_Copy Call Address"), NULL,
-        NULL,
-        G_CALLBACK (popup_copy_url_callback) },
       { "PopupOpenLink", NULL, N_("_Open Link"), NULL,
         NULL,
         G_CALLBACK (popup_open_url_callback) },
Index: src/terminal.xml
===================================================================
--- src/terminal.xml	(revision 3293)
+++ src/terminal.xml	(working copy)
@@ -63,8 +63,6 @@
   <popup name="Popup" action="Popup">
     <menuitem action="PopupSendEmail" />
     <menuitem action="PopupCopyEmailAddress" />
-    <menuitem action="PopupCall" />
-    <menuitem action="PopupCopyCallAddress" />
     <menuitem action="PopupOpenLink" />
     <menuitem action="PopupCopyLinkAddress" />
     <separator />
