/[mailutils]/mailutils/comsat/comsat.c
ViewVC logotype

Diff of /mailutils/comsat/comsat.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.24 by gray, Wed Aug 7 23:05:56 2002 UTC revision 1.25 by gray, Tue Aug 13 13:24:57 2002 UTC
# Line 585  change_user (const char *user) Line 585  change_user (const char *user)
585  char *  char *
586  mailbox_path (const char *user)  mailbox_path (const char *user)
587  {  {
588    struct passwd *pw;    struct mu_auth_data *auth;
589    char *mailbox_name;    char *mailbox_name;
590    
591    pw = mu_getpwnam (user);    auth = mu_get_auth_by_name (user);
592    if (!pw)  
593      if (!auth)
594      {      {
595        syslog (LOG_ALERT, "user nonexistent: %s", user);        syslog (LOG_ALERT, "user nonexistent: %s", user);
596        return NULL;        return NULL;
597      }      }
598    
599    if (!mu_virtual_domain)    mailbox_name = strdup (auth->mailbox);
600      {    mu_auth_data_free (auth);
       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  
     {  
       mailbox_name = calloc (strlen (pw->pw_dir) + strlen ("/INBOX"), 1);  
       sprintf (mailbox_name, "%s/INBOX", pw->pw_dir);  
     }  
601    return mailbox_name;    return mailbox_name;
602  }  }
603    

Legend:
Removed from v.1.24  
changed lines
  Added in v.1.25

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26