validate_recipients() remove extra copy of recipients
[citadel.git] / citadel / server / modules / smtp / smtp_util.c
index e025db9ddb5514f7d8f6f0000b7a7f09176c4c1b..29534ab69ca53fe312a976341bbfaafa04dd3ea8 100644 (file)
@@ -53,8 +53,9 @@
 const char *smtp_get_Recipients(void) {
        struct citsmtp *sSMTP = SMTP;
 
-       if (sSMTP == NULL)
+       if (sSMTP == NULL) {
                return NULL;
+       }
        else return ChrPtr(sSMTP->from);
 }
 
@@ -82,7 +83,6 @@ void smtp_do_bounce(const char *instr, int is_final) {
        int num_bounces = 0;
        int bounce_this = 0;
        struct CtdlMessage *bmsg = NULL;
-       struct recptypes *valid;
        int successful_bounce = 0;
        static int seq = 0;
        StrBuf *BounceMB;
@@ -225,24 +225,12 @@ void smtp_do_bounce(const char *instr, int is_final) {
                else {
                        syslog(LOG_DEBUG, "bounce to user <%s>", bounceto);
                }
-               /* Can we deliver the bounce to the original sender? */
-               valid = validate_recipients(bounceto, smtp_get_Recipients (), 0);
-               if (valid != NULL) {
-                       if (valid->num_error == 0) {
-                               CtdlSubmitMsg(bmsg, valid, "");
-                               successful_bounce = 1;
-                       }
-               }
 
                /* If not, post it in the Aide> room */
                if (successful_bounce == 0) {
                        CtdlSubmitMsg(bmsg, NULL, CtdlGetConfigStr("c_aideroom"));
                }
 
-               /* Free up the memory we used */
-               if (valid != NULL) {
-                       free_recipients(valid);
-               }
        }
        FreeStrBuf(&boundary);
        CM_Free(bmsg);