]> granicus.if.org Git - neomutt/commitdiff
imap: remove old PINE url format
authorMehdi Abaakouk <sileht@sileht.net>
Wed, 14 Nov 2018 09:22:06 +0000 (10:22 +0100)
committerRichard Russon <rich@flatcap.org>
Thu, 15 Nov 2018 00:26:28 +0000 (00:26 +0000)
This format is broken since a while (when we started to use url_parse
to get the mailbox name).

This change removes it.

imap/util.c

index 5d9bce6dcd29da807d00256c5ac61cef7b42ca24..990b6c3e0887b214e86a22df5182544c0516cf9c 100644 (file)
@@ -606,56 +606,8 @@ int imap_parse_path2(const char *path, struct ConnAccount *account, char *mailbo
     url_free(&url);
     FREE(&c);
   }
-  /* old PINE-compatibility code */
   else
-  {
-    url_free(&url);
-    FREE(&c);
-    char tmp[128];
-    if (sscanf(path, "{%127[^}]}", tmp) != 1)
-      return -1;
-
-    c = strchr(path, '}');
-    if (!c)
-      return -1;
-    else
-    {
-      /* walk past closing '}' */
-      mutt_str_strfcpy(mailbox, c + 1, mailboxlen);
-    }
-
-    c = strrchr(tmp, '@');
-    if (c)
-    {
-      *c = '\0';
-      mutt_str_strfcpy(account->user, tmp, sizeof(account->user));
-      mutt_str_strfcpy(tmp, c + 1, sizeof(tmp));
-      account->flags |= MUTT_ACCT_USER;
-    }
-
-    const int n = sscanf(tmp, "%127[^:/]%127s", account->host, tmp);
-    if (n < 1)
-    {
-      mutt_debug(1, "NULL host in %s\n", path);
-      return -1;
-    }
-
-    if (n > 1)
-    {
-      if (sscanf(tmp, ":%hu%127s", &(account->port), tmp) >= 1)
-        account->flags |= MUTT_ACCT_PORT;
-      if (sscanf(tmp, "/%s", tmp) == 1)
-      {
-        if (mutt_str_startswith(tmp, "ssl", CASE_MATCH))
-          account->flags |= MUTT_ACCT_SSL;
-        else
-        {
-          mutt_debug(1, "Unknown connection type in %s\n", path);
-          return -1;
-        }
-      }
-    }
-  }
+    return -1;
 
   if ((account->flags & MUTT_ACCT_SSL) && !(account->flags & MUTT_ACCT_PORT))
     account->port = ImapsPort;