+ // If the rule involves a field comparison, load the field to be compared.
+ compare_me[0] = 0;
+ switch(ii->rules[i].compared_field) {
+
+ case field_from: // From:
+
+ // FIXME we actually need the rfc822 address
+ syslog(LOG_DEBUG, "eAuthor is <%s>", msg->cm_fields[eAuthor]);
+
+ safestrncpy(compare_me, msg->cm_fields[eAuthor], sizeof compare_me);
+ break;
+ case field_tocc: // To: or Cc:
+ if (!IsEmptyStr(msg->cm_fields[eRecipient])) {
+ safestrncpy(compare_me, msg->cm_fields[eRecipient], sizeof compare_me);
+ }
+ if (!IsEmptyStr(msg->cm_fields[eCarbonCopY])) {
+ if (!IsEmptyStr(compare_me)) {
+ strcat(compare_me, ",");
+ }
+ safestrncpy(&compare_me[strlen(compare_me)], msg->cm_fields[eCarbonCopY], (sizeof compare_me - strlen(compare_me)));
+ }
+ break;
+ case field_subject: // Subject:
+ safestrncpy(compare_me, msg->cm_fields[eMsgSubject], sizeof compare_me);
+ break;
+ case field_replyto: // Reply-to:
+ safestrncpy(compare_me, msg->cm_fields[eReplyTo], sizeof compare_me);
+ break;
+ case field_listid: // List-ID:
+ safestrncpy(compare_me, msg->cm_fields[eListID], sizeof compare_me);
+ break;
+ case field_envto: // Envelope-to:
+ safestrncpy(compare_me, msg->cm_fields[eenVelopeTo], sizeof compare_me);
+ break;
+ case field_envfrom: // Return-path:
+ safestrncpy(compare_me, msg->cm_fields[eMessagePath], sizeof compare_me);
+ break;
+
+ case field_sender:
+ case field_resentfrom:
+ case field_resentto:
+ case field_xmailer:
+ case field_xspamflag:
+ case field_xspamstatus:
+
+ default:
+ break;
+ }
+