/*
* Utility functions for the Citadel SMTP implementation
*
- * Copyright (c) 1998-2021 by the citadel.org team
+ * Copyright (c) 1998-2023 by the citadel.org team
*
* This program is open source software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 3.
#include "../../ctdl_module.h"
#include "smtp_util.h"
-const char *smtp_get_Recipients(void) {
- struct citsmtp *sSMTP = SMTP;
-
- if (sSMTP == NULL)
- return NULL;
- else return ChrPtr(sSMTP->from);
-}
-
/*
* smtp_do_bounce() is caled by smtp_process_one_msg() to scan a set of delivery
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;
bmsg->cm_magic = CTDLMESSAGE_MAGIC;
bmsg->cm_anon_type = MES_NORMAL;
bmsg->cm_format_type = FMT_RFC822;
- CM_SetField(bmsg, eAuthor, HKEY("Citadel"));
- CM_SetField(bmsg, eOriginalRoom, HKEY(MAILROOM));
- CM_SetField(bmsg, eMsgSubject, HKEY("Delivery Status Notification (Failure)"));
+ CM_SetField(bmsg, eAuthor, "Citadel");
+ CM_SetField(bmsg, eOriginalRoom, MAILROOM);
+ CM_SetField(bmsg, eMsgSubject, "Delivery Status Notification (Failure)");
StrBufAppendBufPlain(BounceMB, HKEY("Content-type: multipart/mixed; boundary=\""), 0);
StrBufAppendBuf(BounceMB, boundary, 0);
StrBufAppendBufPlain(BounceMB, HKEY("\"\r\n"), 0);
StrBufAppendBufPlain(BounceMB, HKEY("--"), 0);
StrBufAppendBuf(BounceMB, boundary, 0);
StrBufAppendBufPlain(BounceMB, HKEY("--\r\n"), 0);
- CM_SetAsFieldSB(bmsg, eMesageText, &BounceMB);
+ CM_SetAsFieldSB(bmsg, eMessageText, &BounceMB);
/* Deliver the bounce if there's anything worth mentioning */
syslog(LOG_DEBUG, "num_bounces = %d", num_bounces);
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);