use an Enum for the cm_fields vector instead of nameless chars
[citadel.git] / citadel / modules / smtp / smtp_util.c
index 292bebf4782b321c3f9010f4dde487dacfecc232..dd4c80751bf3244bf0e7f3624c866ec1f9871131 100644 (file)
@@ -161,10 +161,10 @@ void smtp_do_bounce(char *instr, StrBuf *OMsgTxt)
        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)");
+       bmsg->cm_fields[eAuthor] = strdup("Citadel");
+       bmsg->cm_fields[eOriginalRoom] = strdup(MAILROOM);
+       bmsg->cm_fields[eNodeName] = strdup(config.c_nodename);
+       bmsg->cm_fields[eMsgSubject] = strdup("Delivery Status Notification (Failure)");
        StrBufAppendBufPlain(
                BounceMB,
                HKEY("Content-type: multipart/mixed; boundary=\""), 0);
@@ -286,9 +286,9 @@ void smtp_do_bounce(char *instr, StrBuf *OMsgTxt)
        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);
+       if (bmsg->cm_fields[eAuthor] != NULL)
+               free(bmsg->cm_fields[eAuthor]);
+       bmsg->cm_fields[eAuthor] = SmashStrBuf(&BounceMB);
        /* Deliver the bounce if there's anything worth mentioning */
        syslog(LOG_DEBUG, "num_bounces = %d\n", num_bounces);
        if (num_bounces > 0) {