]> code.citadel.org Git - citadel.git/commitdiff
* Finished the updates to serv_smtp.c, although I think there may be a
authorArt Cancro <ajc@citadel.org>
Tue, 1 Jan 2002 21:32:10 +0000 (21:32 +0000)
committerArt Cancro <ajc@citadel.org>
Tue, 1 Jan 2002 21:32:10 +0000 (21:32 +0000)
  problem with one-too-many reference counts when a message is submitted
  via SMTP.

citadel/ChangeLog
citadel/msgbase.c
citadel/msgbase.h
citadel/serv_smtp.c

index a306e675472ec3927c9b7b83c8a664f20fd2a1d4..76e0ed2ef773278dba202b517081dd69801ce432 100644 (file)
@@ -1,4 +1,9 @@
  $Log$
+ Revision 590.28  2002/01/01 21:32:10  ajc
+ * Finished the updates to serv_smtp.c, although I think there may be a
+   problem with one-too-many reference counts when a message is submitted
+   via SMTP.
+
  Revision 590.27  2001/12/31 20:15:13  ajc
  * Almost finished converting serv_smtp.c to the new message submission
    framework.  Still not done yet; don't use this.
@@ -3040,3 +3045,4 @@ Sat Jul 11 00:20:48 EDT 1998 Nathan Bryant <bryant@cs.usm.maine.edu>
 
 Fri Jul 10 1998 Art Cancro <ajc@uncensored.citadel.org>
        * Initial CVS import 
+
index 70d16cf300a5a8d1d7c3501383cb34d5e3af0517..549271b17286bc96b20f525ab0630269eb9bd6fd 100644 (file)
@@ -1839,8 +1839,7 @@ long CtdlSubmitMsg(struct CtdlMessage *msg,       /* message to save */
         if (recps->num_room > 0)
          for (i=0; i<num_tokens(recps->recp_room, '|'); ++i) {
                extract(recipient, recps->recp_room, i);
-               lprintf(9, "Delivering to local room <%s>\n",
-                       recipient);
+               lprintf(9, "Delivering to local room <%s>\n", recipient);
                CtdlSaveMsgPointerInRoom(recipient, newmsgid, 0);
        }
 
index 0251e01090a8797974dfb6d84199a1b8f5761d3f..b42b3025bda2e50afd777ac0161f5e2f72c4e40f 100644 (file)
@@ -117,3 +117,4 @@ int CtdlCopyMsgToRoom(long msgnum, char *dest);
 int CtdlDoIHavePermissionToDeleteMessagesFromThisRoom(void);
 int CtdlDoIHavePermissionToPostInThisRoom(char *errmsgbuf);
 void CtdlSetSeen(long target_msgnum, int target_setting);
+struct recptypes *validate_recipients(char *recipients);
index 5bd23bea3027f141f6d9abc46826f27915b7fde7..c88eb64f2f04a8defe7d3bd63257726f11039b0b 100644 (file)
@@ -429,6 +429,7 @@ void smtp_rcpt(char *argbuf) {
                        }
                        strcat(SMTP->valid.recp_local, user);
                        SMTP->valid.num_local += 1;
+                       SMTP->number_of_recipients += 1;
                        return;
 
                case rfc822_room_delivery:
@@ -439,11 +440,17 @@ void smtp_rcpt(char *argbuf) {
                        }
                        strcat(SMTP->valid.recp_room, user);
                        SMTP->valid.num_room += 1;
+                       SMTP->number_of_recipients += 1;
                        return;
 
                case rfc822_address_on_citadel_network:
-                       cprintf("250 Delivering to room '%s'\r\n", user);
-                       /* FIXME */
+                       cprintf("250 '%s' is a valid network user.\r\n", user);
+                       if (SMTP->valid.num_ignet > 0) {
+                               strcat(SMTP->valid.recp_ignet, "|");
+                       }
+                       strcat(SMTP->valid.recp_ignet, user);
+                       SMTP->valid.num_ignet += 1;
+                       SMTP->number_of_recipients += 1;
                        return;
 
                case rfc822_no_such_user:
@@ -456,8 +463,7 @@ void smtp_rcpt(char *argbuf) {
                        }
                        else {
                                cprintf("250 Remote recipient %s ok\r\n", recp);
-
-
+                               SMTP->number_of_recipients += 1;
                                return;
                        }
                        return;
@@ -929,6 +935,8 @@ void smtp_do_bounce(char *instr) {
        time_t submitted = 0L;
        struct CtdlMessage *bmsg = NULL;
        int give_up = 0;
+       struct recptypes *valid;
+       int successful_bounce = 0;
 
        lprintf(9, "smtp_do_bounce() called\n");
        strcpy(bounceto, "");
@@ -1035,23 +1043,20 @@ void smtp_do_bounce(char *instr) {
                        lprintf(7, "No bounce address specified\n");
                        bounce_msgid = (-1L);
                }
-/* FIXME this won't work
-               else if (mes_type = alias(bounceto), mes_type == MES_ERROR) {
-                       lprintf(7, "Invalid bounce address <%s>\n", bounceto);
-                       bounce_msgid = (-1L);
-               }
-               else {
-                       bounce_msgid = CtdlSubmitMsg(bmsg,
-                               bounceto,
-                               "", mes_type);
+
+               /* Can we deliver the bounce to the original sender? */
+               valid = validate_recipients(bounceto);
+               if (valid != NULL) {
+                       if (valid->num_error == 0) {
+                               CtdlSubmitMsg(bmsg, valid, "");
+                               successful_bounce = 1;
+                       }
                }
- */
-               TRACE;
 
-               /* Otherwise, go to the Aide> room */
-               lprintf(9, "bounce to room?\n");
-               if (bounce_msgid < 0L) bounce_msgid = CtdlSubmitMsg(bmsg,
-                       NULL, AIDEROOM);
+               /* If not, post it in the Aide> room */
+               if (successful_bounce == 0) {
+                       CtdlSubmitMsg(bmsg, NULL, AIDEROOM);
+               }
        }
 
        CtdlFreeMessage(bmsg);