Add maildir support.

git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@4798 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
Johan Danielsson
1998-04-23 18:39:20 +00:00
parent 540beaa79e
commit 332e9f03d9
5 changed files with 290 additions and 38 deletions

View File

@@ -107,6 +107,7 @@ pop_pass (POP *p)
{
struct passwd *pw;
int i;
struct stat st;
/* Make one string of all these parameters */
@@ -198,13 +199,17 @@ pop_pass (POP *p)
/* Build the name of the user's maildrop */
snprintf(p->drop_name, sizeof(p->drop_name), "%s/%s", POP_MAILDIR, p->user);
/* Make a temporary copy of the user's maildrop */
/* and set the group and user id */
if (pop_dropcopy(p,pw) != POP_SUCCESS) return (POP_FAILURE);
/* Get information about the maildrop */
if (pop_dropinfo(p) != POP_SUCCESS) return(POP_FAILURE);
if(stat(p->drop_name, &st) < 0 || !S_ISDIR(st.st_mode)){
/* Make a temporary copy of the user's maildrop */
/* and set the group and user id */
if (pop_dropcopy(p,pw) != POP_SUCCESS) return (POP_FAILURE);
/* Get information about the maildrop */
if (pop_dropinfo(p) != POP_SUCCESS) return(POP_FAILURE);
} else {
changeuser(p, pw);
if(pop_maildir_info(p) != POP_SUCCESS) return POP_FAILURE;
}
/* Initialize the last-message-accessed number */
p->last_msg = 0;