]> code.citadel.org Git - citadel.git/commitdiff
* More message submission queue stuff
authorArt Cancro <ajc@citadel.org>
Wed, 2 Jan 2002 04:18:06 +0000 (04:18 +0000)
committerArt Cancro <ajc@citadel.org>
Wed, 2 Jan 2002 04:18:06 +0000 (04:18 +0000)
citadel/msgbase.c
citadel/serv_smtp.c

index 549271b17286bc96b20f525ab0630269eb9bd6fd..7add467a52a02f69ff6f6adce4e15468e537e324 100644 (file)
@@ -1821,7 +1821,7 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,       /* message to save */
         * message, we want to BYPASS saving the sender's copy (because there
         * is no local sender; it would otherwise go to the Trashcan).
         */
-       if ((!CC->internal_pgm) || (strlen(recipient) == 0)) {
+       if ((!CC->internal_pgm) || (recps == NULL)) {
                if (CtdlSaveMsgPointerInRoom(actual_rm, newmsgid, 0) != 0) {
                        lprintf(3, "ERROR saving message pointer!\n");
                        CtdlSaveMsgPointerInRoom(AIDEROOM, newmsgid, 0);
@@ -1858,12 +1858,16 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,     /* message to save */
                extract(recipient, recps->recp_local, i);
                lprintf(9, "Delivering private local mail to <%s>\n",
                        recipient);
-               if (getuser(&userbuf, recipient) == 0) {
+               if (!strcasecmp(recipient, "sysop")) {
+                       CtdlSaveMsgPointerInRoom(AIDEROOM, newmsgid, 0);
+               }
+               else if (getuser(&userbuf, recipient) == 0) {
                        MailboxName(actual_rm, &userbuf, MAILROOM);
                        CtdlSaveMsgPointerInRoom(actual_rm, newmsgid, 0);
                }
                else {
                        lprintf(9, "No user <%s>\n", recipient);
+                       CtdlSaveMsgPointerInRoom(AIDEROOM, newmsgid, 0);
                }
        }
 
@@ -2292,7 +2296,6 @@ void cmd_ent0(char *entargs)
        char newusername[SIZ];
        struct CtdlMessage *msg;
        int anonymous = 0;
-       int mtsflag = 0;
        char errmsg[SIZ];
        int err = 0;
        struct recptypes *valid = NULL;
@@ -2357,9 +2360,6 @@ void cmd_ent0(char *entargs)
                        return;
                }
 
-               if (!strcasecmp(recp, "sysop")) {
-                       mtsflag = 1;
-               }
        }
 
        /* Is this a room which has anonymous-only or anonymous-option? */
@@ -2404,7 +2404,7 @@ void cmd_ent0(char *entargs)
                CC->quickroom.QRname, anonymous, format_type, masquerade_as);
 
        if (msg != NULL) {
-               CtdlSubmitMsg(msg, valid, (mtsflag ? AIDEROOM : "") );
+               CtdlSubmitMsg(msg, valid, "");
                CtdlFreeMessage(msg);
        }
        CC->fake_postname[0] = '\0';
index c88eb64f2f04a8defe7d3bd63257726f11039b0b..71a4b1dd3f324a9c0cd2e2d94126f370f3592e7b 100644 (file)
@@ -713,7 +713,7 @@ void smtp_try(char *key, char *addr, int *status, char *dsn, long msgnum)
                                if (mailfrom[i] == '<') lp = i;
                                if (mailfrom[i] == '>') rp = i;
                        }
-                       if ((lp>=0)&&(rp>lp)) {
+                       if ( (lp>=0) && (rp>lp) ) {
                                mailfrom[rp] = 0;
                                strcpy(mailfrom, &mailfrom[lp]);
                        }
@@ -723,7 +723,6 @@ void smtp_try(char *key, char *addr, int *status, char *dsn, long msgnum)
        } while (scan_done == 0);
        if (strlen(mailfrom)==0) strcpy(mailfrom, "someone@somewhere.org");
 
-
        /* Figure out what mail exchanger host we have to connect to */
        num_mxhosts = getmx(mxhosts, node);
        lprintf(9, "Number of MX hosts for <%s> is %d\n", node, num_mxhosts);
@@ -1057,6 +1056,11 @@ void smtp_do_bounce(char *instr) {
                if (successful_bounce == 0) {
                        CtdlSubmitMsg(bmsg, NULL, AIDEROOM);
                }
+
+               /* Free up the memory we used */
+               if (valid != NULL) {
+                       phree(valid);
+               }
        }
 
        CtdlFreeMessage(bmsg);