* The VRFY and EXPN commands have been removed from this implementation
* because nobody uses these commands anymore, except for spammers.
*
- * Copyright (c) 1998-2009 by the citadel.org team
+ * Copyright (c) 1998-2012 by the citadel.org team
*
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
+ * 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.
+ *
+ *
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *
+ *
+ *
*/
#include "sysdep.h"
if (sSMTP == NULL)
return NULL;
- else return sSMTP->from;
+ else return ChrPtr(sSMTP->from);
}
time_t submitted = 0L;
struct CtdlMessage *bmsg = NULL;
int give_up = 0;
- struct recptypes *valid;
+ 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;
- bmsg->cm_fields['A'] = strdup("Citadel");
- bmsg->cm_fields['O'] = strdup(MAILROOM);
- bmsg->cm_fields['N'] = strdup(config.c_nodename);
- bmsg->cm_fields['U'] = strdup("Delivery Status Notification (Failure)");
+ CM_SetField(bmsg, eAuthor, HKEY("Citadel"));
+ CM_SetField(bmsg, eOriginalRoom, HKEY(MAILROOM));
+ CM_SetField(bmsg, eNodeName, CFG_KEY(c_nodename));
+ CM_SetField(bmsg, eMsgSubject, HKEY("Delivery Status Notification (Failure)"));
StrBufAppendBufPlain(
BounceMB,
HKEY("Content-type: multipart/mixed; boundary=\""), 0);
CtdlOutputMsg(omsgid,
MT_RFC822,
HEADERS_ALL,
- 0, 1, NULL, 0);
+ 0, 1, NULL, 0,
+ NULL, NULL, NULL);
StrBufAppendBuf(BounceMB, CC->redirect_buffer, 0);
FreeStrBuf(&CC->redirect_buffer);
StrBufAppendBufPlain(BounceMB, HKEY("--"), 0);
StrBufAppendBuf(BounceMB, boundary, 0);
StrBufAppendBufPlain(BounceMB, HKEY("--\r\n"), 0);
- if (bmsg->cm_fields['A'] != NULL)
- free(bmsg->cm_fields['A']);
- bmsg->cm_fields['A'] = SmashStrBuf(&BounceMB);
+ CM_SetAsFieldSB(bmsg, eMesageText, &BounceMB);
+
/* Deliver the bounce if there's anything worth mentioning */
syslog(LOG_DEBUG, "num_bounces = %d\n", num_bounces);
if (num_bounces > 0) {
}
}
FreeStrBuf(&boundary);
- CtdlFreeMessage(bmsg);
+ CM_Free(bmsg);
syslog(LOG_DEBUG, "Done processing bounces\n");
}