11 #include <sys/types.h>
19 #include "sysdep_decls.h"
20 #include "citserver.h"
23 #include "dynloader.h"
30 #include "internet_addressing.h"
33 #include "clientsocket.h"
36 struct citsmtp { /* Information about the current session */
38 struct usersupp vrfy_buffer;
42 int number_of_recipients;
46 enum { /* Command states for login authentication */
52 enum { /* Delivery modes */
57 #define SMTP ((struct citsmtp *)CtdlGetUserData(SYM_SMTP))
58 #define SMTP_RECP ((char *)CtdlGetUserData(SYM_SMTP_RECP))
65 /*****************************************************************************/
66 /* SMTP SERVER (INBOUND) STUFF */
67 /*****************************************************************************/
73 * Here's where our SMTP session begins its happy day.
75 void smtp_greeting(void) {
77 strcpy(CC->cs_clientname, "SMTP session");
79 CC->cs_flags |= CS_STEALTH;
80 CtdlAllocUserData(SYM_SMTP, sizeof(struct citsmtp));
81 CtdlAllocUserData(SYM_SMTP_RECP, 256);
82 sprintf(SMTP_RECP, "%s", "");
84 cprintf("220 Welcome to the Citadel/UX ESMTP server at %s\r\n",
90 * Implement HELO and EHLO commands.
92 void smtp_hello(char *argbuf, int is_esmtp) {
95 cprintf("250 Greetings and joyous salutations.\r\n");
98 cprintf("250-Greetings and joyous salutations.\r\n");
99 cprintf("250-HELP\r\n");
100 cprintf("250-SIZE %ld\r\n", config.c_maxmsglen);
101 cprintf("250 AUTH=LOGIN\r\n");
107 * Implement HELP command.
109 void smtp_help(void) {
110 cprintf("214-Here's the frequency, Kenneth:\r\n");
111 cprintf("214- DATA\r\n");
112 cprintf("214- EHLO\r\n");
113 cprintf("214- EXPN\r\n");
114 cprintf("214- HELO\r\n");
115 cprintf("214- HELP\r\n");
116 cprintf("214- MAIL\r\n");
117 cprintf("214- NOOP\r\n");
118 cprintf("214- QUIT\r\n");
119 cprintf("214- RCPT\r\n");
120 cprintf("214- RSET\r\n");
121 cprintf("214- VRFY\r\n");
122 cprintf("214 I could tell you more, but then I'd have to kill you.\r\n");
129 void smtp_get_user(char *argbuf) {
133 decode_base64(username, argbuf);
134 lprintf(9, "Trying <%s>\n", username);
135 if (CtdlLoginExistingUser(username) == login_ok) {
136 encode_base64(buf, "Password:");
137 cprintf("334 %s\r\n", buf);
138 SMTP->command_state = smtp_password;
141 cprintf("500 No such user.\r\n");
142 SMTP->command_state = smtp_command;
150 void smtp_get_pass(char *argbuf) {
153 decode_base64(password, argbuf);
154 lprintf(9, "Trying <%s>\n", password);
155 if (CtdlTryPassword(password) == pass_ok) {
156 cprintf("235 Authentication successful.\r\n");
157 lprintf(9, "SMTP authenticated login successful\n");
158 CC->internal_pgm = 0;
159 CC->cs_flags &= ~CS_STEALTH;
162 cprintf("500 Authentication failed.\r\n");
164 SMTP->command_state = smtp_command;
171 void smtp_auth(char *argbuf) {
174 if (strncasecmp(argbuf, "login", 5) ) {
175 cprintf("550 We only support LOGIN authentication.\r\n");
179 if (strlen(argbuf) >= 7) {
180 smtp_get_user(&argbuf[6]);
184 encode_base64(buf, "Username:");
185 cprintf("334 %s\r\n", buf);
186 SMTP->command_state = smtp_user;
192 * Back end for smtp_vrfy() command
194 void smtp_vrfy_backend(struct usersupp *us, void *data) {
196 if (!fuzzy_match(us, SMTP->vrfy_match)) {
198 memcpy(&SMTP->vrfy_buffer, us, sizeof(struct usersupp));
204 * Implements the VRFY (verify user name) command.
205 * Performs fuzzy match on full user names.
207 void smtp_vrfy(char *argbuf) {
208 SMTP->vrfy_count = 0;
209 strcpy(SMTP->vrfy_match, argbuf);
210 ForEachUser(smtp_vrfy_backend, NULL);
212 if (SMTP->vrfy_count < 1) {
213 cprintf("550 String does not match anything.\r\n");
215 else if (SMTP->vrfy_count == 1) {
216 cprintf("250 %s <cit%ld@%s>\r\n",
217 SMTP->vrfy_buffer.fullname,
218 SMTP->vrfy_buffer.usernum,
221 else if (SMTP->vrfy_count > 1) {
222 cprintf("553 Request ambiguous: %d users matched.\r\n",
231 * Back end for smtp_expn() command
233 void smtp_expn_backend(struct usersupp *us, void *data) {
235 if (!fuzzy_match(us, SMTP->vrfy_match)) {
237 if (SMTP->vrfy_count >= 1) {
238 cprintf("250-%s <cit%ld@%s>\r\n",
239 SMTP->vrfy_buffer.fullname,
240 SMTP->vrfy_buffer.usernum,
245 memcpy(&SMTP->vrfy_buffer, us, sizeof(struct usersupp));
251 * Implements the EXPN (expand user name) command.
252 * Performs fuzzy match on full user names.
254 void smtp_expn(char *argbuf) {
255 SMTP->vrfy_count = 0;
256 strcpy(SMTP->vrfy_match, argbuf);
257 ForEachUser(smtp_expn_backend, NULL);
259 if (SMTP->vrfy_count < 1) {
260 cprintf("550 String does not match anything.\r\n");
262 else if (SMTP->vrfy_count >= 1) {
263 cprintf("250 %s <cit%ld@%s>\r\n",
264 SMTP->vrfy_buffer.fullname,
265 SMTP->vrfy_buffer.usernum,
272 * Implements the RSET (reset state) command.
273 * Currently this just zeroes out the state buffer. If pointers to data
274 * allocated with mallok() are ever placed in the state buffer, we have to
275 * be sure to phree() them first!
277 void smtp_rset(void) {
278 memset(SMTP, 0, sizeof(struct citsmtp));
279 if (CC->logged_in) logout(CC);
280 cprintf("250 Zap!\r\n");
286 * Implements the "MAIL From:" command
288 void smtp_mail(char *argbuf) {
293 if (strlen(SMTP->from) != 0) {
294 cprintf("503 Only one sender permitted\r\n");
298 if (strncasecmp(argbuf, "From:", 5)) {
299 cprintf("501 Syntax error\r\n");
303 strcpy(SMTP->from, &argbuf[5]);
306 if (strlen(SMTP->from) == 0) {
307 cprintf("501 Empty sender name is not permitted\r\n");
312 /* If this SMTP connection is from a logged-in user, make sure that
313 * the user only sends email from his/her own address.
316 cvt = convert_internet_address(user, node, SMTP->from);
317 lprintf(9, "cvt=%d, citaddr=<%s@%s>\n", cvt, user, node);
318 if ( (cvt != 0) || (strcasecmp(user, CC->usersupp.fullname))) {
319 cprintf("550 <%s> is not your address.\r\n", SMTP->from);
320 strcpy(SMTP->from, "");
325 /* Otherwise, make sure outsiders aren't trying to forge mail from
329 cvt = convert_internet_address(user, node, SMTP->from);
330 lprintf(9, "cvt=%d, citaddr=<%s@%s>\n", cvt, user, node);
331 if (!strcasecmp(node, config.c_nodename)) { /* FIX use fcn */
332 cprintf("550 You must log in to send mail from %s\r\n",
334 strcpy(SMTP->from, "");
339 cprintf("250 Sender ok. Groovy.\r\n");
345 * Implements the "RCPT To:" command
347 void smtp_rcpt(char *argbuf) {
352 int is_spam = 0; /* FIX implement anti-spamming */
354 if (strlen(SMTP->from) == 0) {
355 cprintf("503 MAIL first, then RCPT. Duh.\r\n");
359 if (strncasecmp(argbuf, "To:", 3)) {
360 cprintf("501 Syntax error\r\n");
364 strcpy(recp, &argbuf[3]);
368 cvt = convert_internet_address(user, node, recp);
369 sprintf(recp, "%s@%s", user, node);
373 case rfc822_address_locally_validated:
374 cprintf("250 %s is a valid recipient.\r\n", user);
375 ++SMTP->number_of_recipients;
376 CtdlReallocUserData(SYM_SMTP_RECP,
377 strlen(SMTP_RECP) + 1024 );
378 strcat(SMTP_RECP, "local|");
379 strcat(SMTP_RECP, user);
380 strcat(SMTP_RECP, "|0\n");
383 case rfc822_room_delivery:
384 cprintf("250 Delivering to room '%s'\r\n", user);
385 ++SMTP->number_of_recipients;
386 CtdlReallocUserData(SYM_SMTP_RECP,
387 strlen(SMTP_RECP) + 1024 );
388 strcat(SMTP_RECP, "room|");
389 strcat(SMTP_RECP, user);
390 strcat(SMTP_RECP, "|0|\n");
393 case rfc822_no_such_user:
394 cprintf("550 %s: no such user\r\n", recp);
397 case rfc822_address_invalid:
399 cprintf("551 Away with thee, spammer!\r\n");
402 cprintf("250 Remote recipient %s ok\r\n", recp);
403 ++SMTP->number_of_recipients;
404 CtdlReallocUserData(SYM_SMTP_RECP,
405 strlen(SMTP_RECP) + 1024 );
406 strcat(SMTP_RECP, "remote|");
407 strcat(SMTP_RECP, recp);
408 strcat(SMTP_RECP, "|0|\n");
414 cprintf("599 Unknown error\r\n");
422 * Back end for smtp_data() ... this does the actual delivery of the message
423 * Returns 0 on success, nonzero on failure
425 int smtp_message_delivery(struct CtdlMessage *msg) {
432 int successful_saves = 0; /* number of successful local saves */
433 int failed_saves = 0; /* number of failed deliveries */
434 int remote_spools = 0; /* number of copies to send out */
437 struct usersupp userbuf;
438 char *instr; /* Remote delivery instructions */
439 struct CtdlMessage *imsg;
441 lprintf(9, "smtp_message_delivery() called\n");
443 /* Fill in 'from' fields with envelope information if missing */
444 process_rfc822_addr(SMTP->from, user, node, name);
445 if (msg->cm_fields['A']==NULL) msg->cm_fields['A'] = strdoop(user);
446 if (msg->cm_fields['N']==NULL) msg->cm_fields['N'] = strdoop(node);
447 if (msg->cm_fields['H']==NULL) msg->cm_fields['H'] = strdoop(name);
449 /* Save the message in the queue */
450 msgid = CtdlSaveMsg(msg,
457 instr = mallok(1024);
458 sprintf(instr, "Content-type: %s\n\nmsgid|%ld\nsubmitted|%ld\n",
459 SPOOLMIME, msgid, time(NULL) );
461 for (i=0; i<SMTP->number_of_recipients; ++i) {
462 extract_token(buf, SMTP_RECP, i, '\n');
463 extract(dtype, buf, 0);
465 /* Stuff local mailboxes */
466 if (!strcasecmp(dtype, "local")) {
467 extract(user, buf, 1);
468 if (getuser(&userbuf, user) == 0) {
469 MailboxName(room, &userbuf, MAILROOM);
470 CtdlSaveMsgPointerInRoom(room, msgid, 0);
478 /* Delivery to local non-mailbox rooms */
479 if (!strcasecmp(dtype, "room")) {
480 extract(room, buf, 1);
481 CtdlSaveMsgPointerInRoom(room, msgid, 0);
485 /* Remote delivery */
486 if (!strcasecmp(dtype, "remote")) {
487 extract(user, buf, 1);
488 instr = reallok(instr, strlen(instr) + 1024);
489 sprintf(&instr[strlen(instr)],
497 /* If there are remote spools to be done, save the instructions */
498 if (remote_spools > 0) {
499 imsg = mallok(sizeof(struct CtdlMessage));
500 memset(imsg, 0, sizeof(struct CtdlMessage));
501 imsg->cm_magic = CTDLMESSAGE_MAGIC;
502 imsg->cm_anon_type = MES_NORMAL;
503 imsg->cm_format_type = FMT_RFC822;
504 imsg->cm_fields['M'] = instr;
505 CtdlSaveMsg(imsg, "", SMTP_SPOOLOUT_ROOM, MES_LOCAL, 1);
506 CtdlFreeMessage(imsg);
509 /* If there are no remote spools, delete the message */
511 phree(instr); /* only needed here, because CtdlSaveMsg()
512 * would free this buffer otherwise */
513 CtdlDeleteMessages(SMTP_SPOOLOUT_ROOM, msgid, NULL);
516 return(failed_saves);
522 * Implements the DATA command
524 void smtp_data(void) {
526 struct CtdlMessage *msg;
530 if (strlen(SMTP->from) == 0) {
531 cprintf("503 Need MAIL command first.\r\n");
535 if (SMTP->number_of_recipients < 1) {
536 cprintf("503 Need RCPT command first.\r\n");
540 cprintf("354 Transmit message now; terminate with '.' by itself\r\n");
542 generate_rfc822_datestamp(nowstamp, time(NULL));
544 if (body != NULL) sprintf(body,
545 "Received: from %s\n"
552 body = CtdlReadMessageBody(".", config.c_maxmsglen, body);
554 cprintf("550 Unable to save message text: internal error.\r\n");
558 lprintf(9, "Converting message...\n");
559 msg = convert_internet_message(body);
561 /* If the user is locally authenticated, FORCE the From: header to
562 * show up as the real sender
565 if (msg->cm_fields['A'] != NULL) phree(msg->cm_fields['A']);
566 if (msg->cm_fields['N'] != NULL) phree(msg->cm_fields['N']);
567 if (msg->cm_fields['H'] != NULL) phree(msg->cm_fields['H']);
568 msg->cm_fields['A'] = strdoop(CC->usersupp.fullname);
569 msg->cm_fields['N'] = strdoop(config.c_nodename);
570 msg->cm_fields['H'] = strdoop(config.c_humannode);
573 retval = smtp_message_delivery(msg);
574 CtdlFreeMessage(msg);
577 cprintf("250 Message accepted for delivery.\r\n");
580 cprintf("550 Internal delivery errors: %d\r\n", retval);
588 * Main command loop for SMTP sessions.
590 void smtp_command_loop(void) {
594 memset(cmdbuf, 0, sizeof cmdbuf); /* Clear it, just in case */
595 if (client_gets(cmdbuf) < 1) {
596 lprintf(3, "SMTP socket is broken. Ending session.\n");
600 lprintf(5, "citserver[%3d]: %s\n", CC->cs_pid, cmdbuf);
601 while (strlen(cmdbuf) < 5) strcat(cmdbuf, " ");
603 if (SMTP->command_state == smtp_user) {
604 smtp_get_user(cmdbuf);
607 else if (SMTP->command_state == smtp_password) {
608 smtp_get_pass(cmdbuf);
611 else if (!strncasecmp(cmdbuf, "AUTH", 4)) {
612 smtp_auth(&cmdbuf[5]);
615 else if (!strncasecmp(cmdbuf, "DATA", 4)) {
619 else if (!strncasecmp(cmdbuf, "EHLO", 4)) {
620 smtp_hello(&cmdbuf[5], 1);
623 else if (!strncasecmp(cmdbuf, "EXPN", 4)) {
624 smtp_expn(&cmdbuf[5]);
627 else if (!strncasecmp(cmdbuf, "HELO", 4)) {
628 smtp_hello(&cmdbuf[5], 0);
631 else if (!strncasecmp(cmdbuf, "HELP", 4)) {
635 else if (!strncasecmp(cmdbuf, "MAIL", 4)) {
636 smtp_mail(&cmdbuf[5]);
639 else if (!strncasecmp(cmdbuf, "NOOP", 4)) {
640 cprintf("250 This command successfully did nothing.\r\n");
643 else if (!strncasecmp(cmdbuf, "QUIT", 4)) {
644 cprintf("221 Goodbye...\r\n");
649 else if (!strncasecmp(cmdbuf, "RCPT", 4)) {
650 smtp_rcpt(&cmdbuf[5]);
653 else if (!strncasecmp(cmdbuf, "RSET", 4)) {
657 else if (!strncasecmp(cmdbuf, "VRFY", 4)) {
658 smtp_vrfy(&cmdbuf[5]);
662 cprintf("502 I'm sorry Dave, I'm afraid I can't do that.\r\n");
670 /*****************************************************************************/
671 /* SMTP CLIENT (OUTBOUND PROCESSING) STUFF */
672 /*****************************************************************************/
679 * Called by smtp_do_procmsg() to attempt delivery to one SMTP host
682 void smtp_try(char *key, char *addr, int *status, char *dsn, long msgnum)
689 char user[256], node[256], name[256];
691 /* Parse out the host portion of the recipient address */
692 process_rfc822_addr(addr, user, node, name);
693 lprintf(9, "Attempting SMTP delivery to <%s> @ <%s> (%s)\n",
696 num_mxhosts = getmx(mxhosts, node);
697 lprintf(9, "Number of MX hosts for <%s> is %d\n", node, num_mxhosts);
698 if (num_mxhosts < 1) {
700 sprintf(dsn, "No MX hosts found for <%s>", node);
704 for (mx=0; mx<num_mxhosts; ++mx) {
705 extract(buf, mxhosts, mx);
706 lprintf(9, "Trying <%s>\n", buf);
707 sock = sock_connect(buf, "25", "tcp");
708 sprintf(dsn, "Could not connect: %s", strerror(errno));
709 if (sock >= 0) lprintf(9, "Connected!\n");
710 if (sock < 0) sprintf(dsn, "%s", strerror(errno));
711 if (sock >= 0) break;
715 *status = 4; /* dsn is already filled in */
719 /* Process the SMTP greeting from the server */
720 if (sock_gets(sock, buf) < 0) {
722 strcpy(dsn, "Connection broken during SMTP conversation");
726 lprintf(9, "%s\n", buf);
730 strcpy(dsn, &buf[4]);
736 strcpy(dsn, &buf[4]);
742 /* At this point we know we are talking to a real SMTP server */
744 /* Do a HELO command */
745 sprintf(buf, "HELO %s", config.c_fqdn);
746 sock_puts(sock, buf);
747 if (sock_gets(sock, buf) < 0) {
749 strcpy(dsn, "Connection broken during SMTP conversation");
753 lprintf(9, "%s\n", buf);
757 strcpy(dsn, &buf[4]);
763 strcpy(dsn, &buf[4]);
770 /* HELO succeeded, now try the MAIL From: command */
771 sprintf(buf, "MAIL From: FIX@uncnsrd.mt-kisco.ny.us"); /* FIX */
772 sock_puts(sock, buf);
773 if (sock_gets(sock, buf) < 0) {
775 strcpy(dsn, "Connection broken during SMTP conversation");
779 lprintf(9, "%s\n", buf);
783 strcpy(dsn, &buf[4]);
789 strcpy(dsn, &buf[4]);
796 /* MAIL succeeded, now try the RCPT To: command */
797 sprintf(buf, "RCPT To: %s", addr);
798 sock_puts(sock, buf);
799 if (sock_gets(sock, buf) < 0) {
801 strcpy(dsn, "Connection broken during SMTP conversation");
805 lprintf(9, "%s\n", buf);
809 strcpy(dsn, &buf[4]);
815 strcpy(dsn, &buf[4]);
822 /* RCPT succeeded, now try the DATA command */
823 sock_puts(sock, "DATA");
824 if (sock_gets(sock, buf) < 0) {
826 strcpy(dsn, "Connection broken during SMTP conversation");
830 lprintf(9, "%s\n", buf);
834 strcpy(dsn, &buf[4]);
840 strcpy(dsn, &buf[4]);
846 /* If we reach this point, the server is expecting data */
847 CtdlOutputMsg(msgnum, MT_RFC822, 0, 0, NULL, sock, 1);
848 sock_puts(sock, ".");
849 if (sock_gets(sock, buf) < 0) {
851 strcpy(dsn, "Connection broken during SMTP conversation");
855 lprintf(9, "%s\n", buf);
859 strcpy(dsn, &buf[4]);
865 strcpy(dsn, &buf[4]);
872 strcpy(dsn, &buf[4]);
875 sock_puts(sock, "QUIT");
876 sock_gets(sock, buf);
877 lprintf(9, "%s\n", buf);
887 * Called by smtp_do_queue() to handle an individual message.
889 void smtp_do_procmsg(long msgnum) {
890 struct CtdlMessage *msg;
892 char *results = NULL;
900 long text_msgid = (-1);
902 msg = CtdlFetchMessage(msgnum);
904 lprintf(3, "SMTP: tried %ld but no such message!\n", msgnum);
908 instr = strdoop(msg->cm_fields['M']);
909 CtdlFreeMessage(msg);
911 /* Strip out the headers amd any other non-instruction line */
912 lines = num_tokens(instr, '\n');
913 for (i=0; i<lines; ++i) {
914 extract_token(buf, instr, i, '\n');
915 if (num_tokens(buf, '|') < 2) {
916 lprintf(9, "removing <%s>\n", buf);
917 remove_token(instr, i, '\n');
923 /* Learn the message ID */
924 lines = num_tokens(instr, '\n');
925 for (i=0; i<lines; ++i) {
926 extract_token(buf, instr, i, '\n');
927 extract(key, buf, 0);
928 if (!strcasecmp(key, "msgid")) {
929 text_msgid = extract_long(buf, 1);
933 if (text_msgid < 0L) {
934 lprintf(3, "SMTP: no 'msgid' directive found!\n");
939 /* Plow through the instructions looking for 'remote' directives and
940 * a status of 0 (no delivery yet attempted) or 3 (transient errors
941 * were experienced and it's time to try again)
943 lines = num_tokens(instr, '\n');
944 for (i=0; i<lines; ++i) {
945 extract_token(buf, instr, i, '\n');
946 extract(key, buf, 0);
947 extract(addr, buf, 1);
948 status = extract_int(buf, 2);
949 extract(dsn, buf, 3);
950 if ( (!strcasecmp(key, "remote"))
951 && ((status==0)||(status==3)) ) {
952 remove_token(instr, i, '\n');
955 lprintf(9, "SMTP: Trying <%s>\n", addr);
956 smtp_try(key, addr, &status, dsn, text_msgid);
958 if (results == NULL) {
959 results = mallok(1024);
960 memset(results, 0, 1024);
963 results = reallok(results,
964 strlen(results) + 1024);
966 sprintf(&results[strlen(results)],
968 key, addr, status, dsn);
973 if (results != NULL) {
974 instr = reallok(instr, strlen(instr) + strlen(results) + 2);
975 strcat(instr, results);
979 /* Delete the instructions and replace with the updated ones */
980 CtdlDeleteMessages(SMTP_SPOOLOUT_ROOM, msgnum, NULL);
981 msg = mallok(sizeof(struct CtdlMessage));
982 memset(msg, 0, sizeof(struct CtdlMessage));
983 msg->cm_magic = CTDLMESSAGE_MAGIC;
984 msg->cm_anon_type = MES_NORMAL;
985 msg->cm_format_type = FMT_RFC822;
986 msg->cm_fields['M'] = malloc(strlen(instr)+256);
987 sprintf(msg->cm_fields['M'],
988 "Content-type: %s\n\n%s\n", SPOOLMIME, instr);
990 CtdlSaveMsg(msg, "", SMTP_SPOOLOUT_ROOM, MES_LOCAL, 1);
991 CtdlFreeMessage(msg);
999 * Run through the queue sending out messages.
1001 void smtp_do_queue(void) {
1002 lprintf(5, "SMTP: processing outbound queue\n");
1004 if (getroom(&CC->quickroom, SMTP_SPOOLOUT_ROOM) != 0) {
1005 lprintf(3, "Cannot find room <%s>\n", SMTP_SPOOLOUT_ROOM);
1008 CtdlForEachMessage(MSGS_ALL, 0L, SPOOLMIME, NULL, smtp_do_procmsg);
1010 lprintf(5, "SMTP: queue run completed\n");
1014 /**** FIX temporary hack to run the queue *****/
1015 void cmd_qqqq(char *argbuf) {
1017 cprintf("%d ok\n", OK);
1022 /*****************************************************************************/
1023 /* MODULE INITIALIZATION STUFF */
1024 /*****************************************************************************/
1027 char *Dynamic_Module_Init(void)
1029 SYM_SMTP = CtdlGetDynamicSymbol();
1030 SYM_SMTP_RECP = CtdlGetDynamicSymbol();
1031 CtdlRegisterServiceHook(SMTP_PORT,
1035 /**** FIX ... temporary hack to run the queue ******/
1036 CtdlRegisterProtoHook(cmd_qqqq, "QQQQ", "run the queue");
1038 create_room(SMTP_SPOOLOUT_ROOM, 3, "", 0);