Commit 6c01b9d8 6c01b9d8055dfdb55a8deab5bc8aefd118a90f1f by Sergey Poznyakoff

Removed unnecessary code: namespace_getfullpath() now translates INBOX to filename.

1 parent bf6389f9
......@@ -73,12 +73,6 @@ imap4d_copy0 (char *arg, int isuid, char *resp, size_t resplen)
return RESP_BAD;
}
if (strcasecmp (name, "INBOX") == 0 && !mu_virtual_domain)
{
struct passwd *pw = mu_getpwuid (getuid());
mailbox_name = strdup ((pw) ? pw->pw_name : "");
}
else
mailbox_name = namespace_getfullpath (name, delim);
if (!mailbox_name)
......@@ -117,7 +111,7 @@ imap4d_copy0 (char *arg, int isuid, char *resp, size_t resplen)
return RESP_OK;
}
/* Unless it is certain that the destination mailbix can not be created,
/* Unless it is certain that the destination mailbox can not be created,
the server MUST send the response code "[TRYCREATE]" as the prefix
of the text of the tagged NO response. This gives a hint to the
client that it can attempt a CREATE command and retry the copy if
......
......@@ -57,24 +57,6 @@ imap4d_select0 (struct imap4d_command *command, char *arg, int flags)
imap4d_sync ();
}
if (strcasecmp (mailbox_name, "INBOX") == 0 && !mu_virtual_domain)
{
pw = mu_getpwuid (getuid ());
if (pw)
{
mailbox_name = malloc (strlen (mu_path_maildir) +
strlen (pw->pw_name) + 1);
if (!mailbox_name)
{
syslog (LOG_ERR, "Not enough memory");
return util_finish (command, RESP_NO, "Not enough memory");
}
sprintf (mailbox_name, "%s%s", mu_path_maildir, pw->pw_name);
}
else
mailbox_name = strdup ("/dev/null");
}
else
mailbox_name = namespace_getfullpath (mailbox_name, "/");
if (!mailbox_name)
......
......@@ -72,21 +72,6 @@ imap4d_status (struct imap4d_command *command, char *arg)
if (!name || *name == '\0' || !sp || *sp == '\0')
return util_finish (command, RESP_BAD, "Too few args");
if (strcasecmp (name, "INBOX") == 0 && !mu_virtual_domain)
{
struct passwd *pw = mu_getpwuid (getuid());
if (!pw)
return util_finish (command, RESP_NO, "Cannot map UID to username");
mailbox_name = malloc (strlen (mu_path_maildir) +
strlen (pw->pw_name) + 1);
if (!mailbox_name)
{
syslog (LOG_ERR, "Not enough memory");
return util_finish (command, RESP_NO, "Not enough memory");
}
sprintf (mailbox_name, "%s%s", mu_path_maildir, pw->pw_name);
}
else
mailbox_name = namespace_getfullpath (name, delim);
if (!mailbox_name)
......