From: Art Cancro Date: Mon, 17 Aug 1998 04:08:48 +0000 (+0000) Subject: * Updated citmail.c with the latest stuff from the production system. X-Git-Tag: v7.86~8392 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=2ca409825c7a2a324b5103a1e1f232069a463975;p=citadel.git * Updated citmail.c with the latest stuff from the production system. * Implemented AGUP and ASUP commands, but AGUP crashes the server after its first successful use (user-not-found's don't affect it). Haven't figured this one out yet... --- diff --git a/citadel/ChangeLog b/citadel/ChangeLog index e4186819f..6d67000e9 100644 --- a/citadel/ChangeLog +++ b/citadel/ChangeLog @@ -1,3 +1,9 @@ +Mon Aug 17 00:06:52 EDT 1998 Art Cancro + * Updated citmail.c with the latest stuff from the production system. + * Implemented AGUP and ASUP commands, but AGUP crashes the server + after its first successful use (user-not-found's don't affect it). + Haven't figured this one out yet... + Thu Aug 6 19:25:01 EDT 1998 Art Cancro * Got the CitadelAPI library to the point where the server can start up an extension, and the extension will connect to the server, do diff --git a/citadel/citadelapi.c b/citadel/citadelapi.c index ffdc6ca6d..68bd7f580 100644 --- a/citadel/citadelapi.c +++ b/citadel/citadelapi.c @@ -9,6 +9,8 @@ struct CtdlServerHandle CtdlAppHandle; struct CtdlServInfo CtdlAppServInfo; +int CtdlErrno = 0; + void CtdlMain(); void logoff(exitcode) { @@ -110,3 +112,26 @@ char *argv[]; { serv_puts("QUIT"); exit(0); } + + +int CtdlGetLastError() { + return CtdlErrno; + } + + +int CtdlSendExpressMessage(char *ToUser, char *MsgText) { + char buf[256]; + + if (strlen(ToUser) + strlen(MsgText) > 248) { + CtdlErrno = ERROR + TOO_BIG; + return CtdlErrno; + } + + sprintf(buf, "SEXP %s|%s", ToUser, MsgText); + serv_puts(buf); + serv_gets(buf); + + CtdlErrno = atoi(buf); + if (CtdlErrno == OK) CtdlErrno = 0; + return CtdlErrno; + } diff --git a/citadel/citmail.c b/citadel/citmail.c index 720b4ed95..f2c367fcc 100644 --- a/citadel/citmail.c +++ b/citadel/citmail.c @@ -1,5 +1,5 @@ /* - * citmail.c v4.0 + * citmail.c v4.1 * * This program may be used as a local mail delivery agent, which will allow * all Citadel users to receive Internet e-mail. To enable this functionality, @@ -368,19 +368,18 @@ void do_citmail(char recp[], int dtype) { /* chop the system name out, so we're left with a user */ while (haschar(recp,'!')) strcpy(recp,&recp[1]); + } - /* now convert underscores to spaces */ - for (a=0; aptr, cdbus->len); @@ -87,7 +87,8 @@ void putuser(struct usersupp *usbuf, char *name) lowercase_name[a] = tolower(name[a]); } - cdb_store(CDB_USERSUPP, lowercase_name, strlen(lowercase_name), + cdb_store(CDB_USERSUPP, + lowercase_name, strlen(lowercase_name), usbuf, sizeof(struct usersupp)); } @@ -96,8 +97,7 @@ void putuser(struct usersupp *usbuf, char *name) /* * lputuser() - same as putuser() but locks the record */ -void lputuser(struct usersupp *usbuf, char *name) -{ +void lputuser(struct usersupp *usbuf, char *name) { putuser(usbuf,name); end_critical_section(S_USERSUPP); } @@ -117,8 +117,12 @@ int is_aide(void) { */ int is_room_aide(void) { if ( (CC->usersupp.axlevel >= 6) - || (CC->quickroom.QRroomaide == CC->usersupp.usernum) ) return(1); - else return(0); + || (CC->quickroom.QRroomaide == CC->usersupp.usernum) ) { + return(1); + } + else { + return(0); + } } /* @@ -1112,10 +1116,12 @@ void cmd_agup(char *cmdbuf) { } extract(requested_user, cmdbuf, 0); + lprintf(9, "Requesting <%s>\n", requested_user); if (getuser(&usbuf, requested_user) != 0) { cprintf("%d No such user.\n", ERROR + NO_SUCH_USER); return; } + lprintf(9, "getuser() returned zero\n"); cprintf("%d %s|%s|%u|%d|%d|%d|%ld\n", OK, @@ -1126,6 +1132,8 @@ void cmd_agup(char *cmdbuf) { usbuf.posted, (int)usbuf.axlevel, usbuf.usernum); + + lprintf(9, "Done.\n"); }