Commit 84de61a4 84de61a48d89a05c13e7f5e6056246d08de8112b by Sergey Poznyakoff

Use mu_path_maildir instead of maildir.

1 parent 425d200a
......@@ -585,9 +585,9 @@ mailbox_path (const char *user)
if (!mu_virtual_domain)
{
mailbox_name = calloc (strlen (maildir) + 1
+ strlen (pw->pw_name) + 1, 1);
sprintf (mailbox_name, "%s%s", maildir, pw->pw_name);
mailbox_name = calloc (strlen (mu_path_maildir) + 1 +
strlen (pw->pw_name) + 1, 1);
sprintf (mailbox_name, "%s%s", mu_path_maildir, pw->pw_name);
}
else
{
......
......@@ -28,7 +28,7 @@ collect_open_default ()
if (!default_mailbox)
{
asprintf (&default_mailbox, "%s%s", maildir, user_name);
asprintf (&default_mailbox, "%s%s", mu_path_maildir, user_name);
if (!default_mailbox)
{
util_error ("not enough memory");
......
......@@ -62,13 +62,14 @@ imap4d_select0 (struct imap4d_command *command, char *arg, int flags)
pw = mu_getpwuid (getuid ());
if (pw)
{
mailbox_name = malloc (strlen (maildir) + strlen (pw->pw_name) + 1);
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", maildir, pw->pw_name);
sprintf (mailbox_name, "%s%s", mu_path_maildir, pw->pw_name);
}
else
mailbox_name = strdup ("/dev/null");
......
......@@ -125,7 +125,6 @@ struct argp_child mu_daemon_argp_child[] =
{NULL, 0, NULL, 0}
};
char *maildir = MU_PATH_MAILDIR;
int log_facility = LOG_FACILITY;
int mu_argp_error_code = 1;
......@@ -198,7 +197,7 @@ mu_common_argp_parser (int key, char *arg, struct argp_state *state)
switch (key)
{
case 'm':
maildir = arg;
mu_path_maildir = arg;
break;
case 'L':
......@@ -255,13 +254,13 @@ mu_common_argp_parser (int key, char *arg, struct argp_state *state)
#endif
case ARGP_KEY_FINI:
p = mu_normalize_maildir (maildir);
p = mu_normalize_maildir (mu_path_maildir);
if (!p)
{
mu_error ("Badly formed maildir: %s", maildir);
mu_error ("Badly formed maildir: %s", mu_path_maildir);
exit (mu_argp_error_code);
}
maildir = p;
mu_path_maildir = p;
break;
default:
......
......@@ -447,13 +447,13 @@ deliver (FILE *fp, char *name)
return;
}
path = malloc (strlen (maildir) + strlen (name) + 1);
path = malloc (strlen (mu_path_maildir) + strlen (name) + 1);
if (!path)
{
mailer_err ("Out of memory");
return;
}
sprintf (path, "%s%s", maildir, name);
sprintf (path, "%s%s", mu_path_maildir, name);
if ((status = mailbox_create (&mbox, path)) != 0)
{
......
......@@ -216,9 +216,9 @@ pop3d_apop (const char *arg)
if (setuid (pw->pw_uid) == -1)
return ERR_BAD_LOGIN;
mailbox_name = calloc (strlen (maildir) + 1
mailbox_name = calloc (strlen (mu_path_maildir) + 1
+ strlen (pw->pw_name) + 1, 1);
sprintf (mailbox_name, "%s%s", maildir, pw->pw_name);
sprintf (mailbox_name, "%s%s", mu_path_maildir, pw->pw_name);
if ((status = mailbox_create (&mbox, mailbox_name)) != 0
|| (status = mailbox_open (mbox, MU_STREAM_RDWR)) != 0)
......
......@@ -197,13 +197,14 @@ pop3d_user (const char *arg)
if (pw->pw_uid > 0 && !mu_virtual_domain)
{
setuid (pw->pw_uid);
mailbox_name = malloc (strlen (maildir) + strlen (pw->pw_name) + 1);
mailbox_name = malloc (strlen (mu_path_maildir) +
strlen (pw->pw_name) + 1);
if (!mailbox_name)
{
syslog (LOG_ERR, "Not enough memory");
return ERR_UNKNOWN;
}
sprintf (mailbox_name, "%s%s", maildir, pw->pw_name);
sprintf (mailbox_name, "%s%s", mu_path_maildir, pw->pw_name);
}
else if (mu_virtual_domain)
{
......