- sprintf(message_text,
- "Content-type: multipart/mixed; boundary=\"%s\"\r\n"
- "Content-Identifer: ExJournalReport\r\n"
- "MIME-Version: 1.0\r\n"
- "\n"
- "--%s\r\n"
- "Content-type: text/plain\r\n"
- "\r\n"
- "Sender: %s "
- ,
- mime_boundary,
- mime_boundary,
- ( journal_msg->cm_fields['A'] ? journal_msg->cm_fields['A'] : "(null)" )
- );
-
- if (journal_msg->cm_fields['F']) {
- sprintf(&message_text[strlen(message_text)], "<%s>",
- journal_msg->cm_fields['F']);
+ StrBufAppendBufPlain(
+ message_text,
+ HKEY("Content-type: multipart/mixed; boundary=\""), 0);
+
+ StrBufAppendBufPlain(message_text, mime_boundary, mblen, 0);
+
+ StrBufAppendBufPlain(
+ message_text,
+ HKEY("\"\r\n"
+ "Content-Identifer: ExJournalReport\r\n"
+ "MIME-Version: 1.0\r\n"
+ "\n"
+ "--"), 0);
+
+ StrBufAppendBufPlain(message_text, mime_boundary, mblen, 0);
+
+ StrBufAppendBufPlain(
+ message_text,
+ HKEY("\r\n"
+ "Content-type: text/plain\r\n"
+ "\r\n"
+ "Sender: "), 0);
+
+ if (CM_IsEmpty(journal_msg, eAuthor))
+ StrBufAppendBufPlain(
+ message_text,
+ journal_msg->cm_fields[eAuthor], -1, 0);
+ else
+ StrBufAppendBufPlain(
+ message_text,
+ HKEY("(null)"), 0);
+
+ if (!CM_IsEmpty(journal_msg, erFc822Addr)) {
+ StrBufAppendPrintf(message_text, " <%s>",
+ journal_msg->cm_fields[erFc822Addr]);