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;
}
/* 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;
}