From: Art Cancro Date: Tue, 2 May 2023 03:31:53 +0000 (-0400) Subject: serv_inboxrules.c: applied patch by Allen (awrdgrs) to make X-Spam-Status work X-Git-Tag: v976~13 X-Git-Url: https://code.citadel.org/?a=commitdiff_plain;h=f341b886bcec72ae247d795839131b8351fba279;p=citadel.git serv_inboxrules.c: applied patch by Allen (awrdgrs) to make X-Spam-Status work --- diff --git a/citadel/server/modules/inboxrules/serv_inboxrules.c b/citadel/server/modules/inboxrules/serv_inboxrules.c index 889b138ff..5b8bd99c7 100644 --- a/citadel/server/modules/inboxrules/serv_inboxrules.c +++ b/citadel/server/modules/inboxrules/serv_inboxrules.c @@ -485,6 +485,8 @@ void inbox_do_msg(long msgnum, void *userdata) { int compare_compound = 0; // Set to 1 when we are comparing both display name and email address int keep_message = 1; // Nonzero to keep the message in the inbox after processing, 0 to delete it. int i; + const char *ptr,*ptr1; // Temporary variables to get X-Spam-Status + int len; syslog(LOG_DEBUG, "inboxrules: processing message #%ld which is higher than %ld, we are in %s", msgnum, ii->lastproc, CC->room.QRname); @@ -607,12 +609,28 @@ void inbox_do_msg(long msgnum, void *userdata) { } break; + case field_xspamstatus: + if (!IsEmptyStr(msg->cm_fields[eMesageText])) { + if ((ptr=strstr(msg->cm_fields[eMesageText],"X-Spam-Status"))!=NULL) { + len=0; + ptr1=ptr; + while (*ptr1 && (*ptr1!='\r') && (*ptr1!='\n')) { + ptr1++; + len++; + } + if (len && (len