SA Bugzilla – Bug 8121
header rules with keyword all not working
Last modified: 2023-03-18 09:05:46 UTC
rules like __TO_EQ_FROM_1 are not working anymore because the newlines at the end of the line are doubled. Deleting the \n in line $hval = scalar(@harr) ? join("\n", @harr) : ' . of Check.pm corrects the problem. A workaround for the ALL-rules is to replace the \n with \n{1,2}.
Thanks, we are missing many tests for these.. Unfortunately the fix is not that simple. Removing "\n" from Check.pm breaks other stuff like Cc:addr. The real culprit is pms->_get() returning inconsistent line endings, this needs careful vetting and adding tests for all cases. In the meantime, I've committed the workaround for some tests: Sending rules/20_head_tests.cf Sending rulesrc/sandbox/jhardin/20_misc_testing.cf Sending rulesrc/sandbox/jm/20_basic.cf Sending rulesrc/sandbox/khopesh/20_khop_experimental.cf Sending rulesrc/sandbox/pds/10_menaces.cf Transmitting file data .....done Committing transaction... Committed revision 1908419.
I think it's best that Check.pm checks if get() value has newlines and joins the matching string accordingly. Normally a get() user should know what header/metadata is called and expect certain format, but Check.pm is not normal since it accepts anything from header rules. Will try to document more if I have time. Sending lib/Mail/SpamAssassin/PerMsgStatus.pm Sending lib/Mail/SpamAssassin/Plugin/Check.pm Sending t/header.t Transmitting file data ...done Committing transaction... Committed revision 1908472.