$Log$
+ Revision 573.86 2001/02/08 04:45:58 ajc
+ * Fixed namespace problems resulting from the automatic namespece prefixing
+ added to create_room(). Also added the ability to specify "create a mailbox
+ but I've already supplied the namespace prefix" for situations where the
+ namespace isn't that of the logged in user.
+ * Made the POP3 server response messages slightly less humorous
+
Revision 573.85 2001/02/06 04:44:12 ajc
* Added a floor listing (complete with \NoSelect flag) to LIST and LSUB
Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
* Initial CVS import
+
/* Create the requested room if we have to. */
if (getroom(&qrbuf, roomname) != 0) {
create_room(roomname,
- ( (is_mailbox != NULL) ? 4 : 3 ),
+ ( (is_mailbox != NULL) ? 5 : 3 ),
"", 0, 1);
}
/* If the caller specified this object as unique, delete all
/*
* Internal code to create a new room (returns room flags)
*
- * Room types: 0=public, 1=guessname, 2=passworded, 3=inv-only, 4=mailbox
+ * Room types: 0=public, 1=guessname, 2=passworded, 3=inv-only,
+ * 4=mailbox, 5=mailbox, but caller supplies namespace
*/
unsigned create_room(char *new_room_name,
int new_room_type,
qrbuf.QRflags = (qrbuf.QRflags | QR_GUESSNAME);
if (new_room_type == 2)
qrbuf.QRflags = (qrbuf.QRflags | QR_PASSWORDED);
- if (new_room_type == 4)
+ if ( (new_room_type == 4) || (new_room_type == 5) )
qrbuf.QRflags = (qrbuf.QRflags | QR_MAILBOX);
/* If the user is requesting a personal room, set up the room
struct quickroom qr;
/* Create the room if it doesn't already exist */
- MailboxName(roomname, &CC->usersupp, USERCALENDARROOM);
- create_room(roomname, 4, "", 0, 1);
+ create_room(USERCALENDARROOM, 4, "", 0, 1);
/* Set expiration policy to manual; otherwise objects will be lost! */
if (lgetroom(&qr, roomname)) {
lprintf(3, "Couldn't get the user calendar room!\n");
POP3->msgs = NULL;
POP3->num_msgs = 0;
- cprintf("+OK Welcome to the Citadel/UX POP3 server %s\r\n",
+ cprintf("+OK Citadel/UX POP3 server %s\r\n",
CC->cs_nonce, config.c_fqdn);
}
}
else
{
- cprintf("-ERR That is NOT the password! Go away!\r\n");
+ cprintf("-ERR That is NOT the password.\r\n");
}
}
pop3_login();
}
else {
- cprintf("-ERR That is NOT the password! Go away!\r\n");
+ cprintf("-ERR That is NOT the password.\r\n");
}
}
return;
}
- cprintf("+OK Whoop, there it is:\r\n");
+ cprintf("+OK Message %d:\r\n", which_one);
bytes_remaining = POP3->msgs[which_one -1].rfc822_length;
rewind(POP3->msgs[which_one - 1].temp);
while (bytes_remaining-- > 0) {
return;
}
- cprintf("+OK Whoop, there it is:\r\n");
+ cprintf("+OK Message %d:\r\n", which_one);
rewind(POP3->msgs[which_one - 1].temp);
while (ptr = fgets(buf, sizeof buf, POP3->msgs[which_one - 1].temp),
( (ptr!=NULL) && (done == 0))) {
/* Flag the message as deleted. Will expunge during QUIT command. */
POP3->msgs[which_one - 1].deleted = 1;
- cprintf("+OK Message %d disappears in a cloud of orange smoke.\r\n",
+ cprintf("+OK Message %d deleted.\r\n",
which_one);
}
POP3->msgs[i].deleted = 0;
}
}
- cprintf("+OK all that has come to pass, has now gone away.\r\n");
+ cprintf("+OK Reset completed.\r\n");
}
while (strlen(cmdbuf) < 5) strcat(cmdbuf, " ");
if (!strncasecmp(cmdbuf, "NOOP", 4)) {
- cprintf("+OK This command successfully did nothing.\r\n");
+ cprintf("+OK No operation.\r\n");
}
else if (!strncasecmp(cmdbuf, "QUIT", 4)) {
}
else {
- cprintf("500 I'm afraid I can't do that, Dave.\r\n");
+ cprintf("500 I'm afraid I can't do that.\r\n");
}
}
char *new_room_pass,
int new_room_floor,
int really_create)
-
+
This function is used to create a new room. new_room_name should be set to
-the desired name for the new room. new_room_type should be set to 0 for a
-public room, 1 for a guessname room, 2 for a passworded room, 3 for an
-invitation-only room, or 4 for a personal room (a mailbox). If the room is
-a type 2 (passworded) room, new_room_pass should be set to the desired
-password. new_room_floor should be set to the number of the floor upon which
-the new room should reside.
+the desired name for the new room.
+
+ new_room_type should be set to one of the following values:
+ 0 = public room
+ 1 = guess-name room
+ 2 = passworded room
+ 3 = invitation-only room
+ 4 = personal (mailbox) room
+ 5 = personal (mailbox) room, and new_room_name already contains
+ the namespace prefix (use with caution!)
+
+ new_room_pass should be set to the desired password for the room (obviously
+this is only valid for passworded rooms).
If the room is really to be created, set really_create to 1. Otherwise, the
caller may merely check to see if it's possible to create the room without
actually creating it by setting really_create to 0.
-
+
create_room() returns the flags associated with the new room (as in the
data structure item quickroom.QRflags). If the room cannot be created (for
example, a room with the name already exists), it returns 0.
int a;
struct passwd *p = NULL;
char username[64];
- char mailboxname[ROOMNAMELEN];
strcpy(username, newusername);
strproc(username);
return (ERROR + INTERNAL_ERROR);
}
/* give the user a private mailbox */
- MailboxName(mailboxname, &CC->usersupp, MAILROOM);
- create_room(mailboxname, 4, "", 0, 1);
+ create_room(MAILROOM, 4, "", 0, 1);
rec_log(CL_NEWUSER, CC->curr_user);
return (0);