Temporarily adding dump of badmail to smtpclient
authorArt Cancro <ajc@uncensored.citadel.org>
Fri, 1 Apr 2011 15:35:48 +0000 (11:35 -0400)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 4 Sep 2011 17:21:59 +0000 (17:21 +0000)
citadel/modules/smtp/serv_smtpclient.c
citadel/room_ops.c

index d4ca65264c271ab3b830c413181fcda030be39ef..8b84b12dd1ee2b70521a7f63ccf3979158f0d97b 100644 (file)
@@ -183,7 +183,15 @@ void smtp_try(const char *key, const char *addr, int *status,
                                scan_done = 1;
                        }
                } while (scan_done == 0);
-               if (IsEmptyStr(mailfrom)) strcpy(mailfrom, "someone@somewhere.org");
+               if (IsEmptyStr(mailfrom)) {
+                       char badmail_filename[128];
+                       snprintf(badmail_filename, sizeof badmail_filename, "/tmp/badmail.%d.%ld",
+                               getpid, time(NULL)
+                       );
+                       FILE *badmail_fp = fopen(badmail_filename, "w");
+                       fwrite(msgtext, msg_size, 1, badmail_fp);
+                       fclose(badmail_fp);
+               }
                stripallbut(mailfrom, '<', '>');
                envelope_from = mailfrom;
        }
index 629aeeb30fad8a1a767582311cc4b2435ab4d777..30b14ae3caa84eb6b73cecbe672fb9dd6036cb59 100644 (file)
@@ -143,7 +143,7 @@ void CtdlRoomAccess(struct ctdlroom *roombuf, struct ctdluser *userbuf,
 
        /* For mailbox rooms, also check the namespace */
        /* Also, mailbox owners can delete their messages */
-       if (roombuf->QRflags & QR_MAILBOX) {
+       if ( (roombuf->QRflags & QR_MAILBOX) && (atol(roombuf->QRname) != 0)) {
                if (userbuf->usernum == atol(roombuf->QRname)) {
                        retval = retval | UA_KNOWN | UA_GOTOALLOWED | UA_POSTALLOWED | UA_DELETEALLOWED | UA_REPLYALLOWED;
                }