Matt Kettler wrote: >Philip Prindeville wrote: > > >>Matt Kettler wrote: >> >> >> >>>Philip Prindeville wrote: >>> >>> >>> >>> >>>>Matt Kettler wrote: >>>> >>>> >>>> >>>> >>> >>> >>> >>> >>>>>Perhaps you want something more like: >>>>> >>>>>header L_INCOMPETENT ALL =~ /\\r\\n\s?$/ >>>>> >>>>> >>>>> >>>>> >>>Scratch my last email. $ doesn't work with ALL. >>> >>>I just tested 3 variants: >>> >>>header L_INCOMPETENT1 ALL =~ /\\r\\n/ >>> >>>header L_INCOMPETENT2 ALL =~ /\\r\\n\s?$/ >>> >>>header L_INCOMPETENT3 ALL =~ /\\r\\n\s?\n/ >>> >>> >>>1 and 3 work. 2 does not. >>> >>> >>> >>> >>Ok, I tried #3 and it worked, as you said... But leaving the \s? didn't. >> >>I'm confused. What exactly is in the pattern buffer when the match for ALL >>is run? And why does taking the \s? fail? What is it matching against? >> >> > >My guess is an extra literal \r or \f. > >\s matches "any whitespace" ie: [ \t\n\r\f] > >
Ok, so I tried \\r\\n\r\n and that worked. I'm confused... When the message is written by mimedefang (or sendmail's libmilter) into a file and then spamassassin gets run over it, is it still in the network format (i.e. \r\n), or has it been converted to UNIX line termination (i.e. \n)? Because I'm looking at patterns that match ALL and seeing: /usr/share/spamassassin/20_head_tests.cf:header __MSGID_BEFORE_RECEIVED ALL =~ /\nMessage-Id:.*\nReceived:/si /usr/share/spamassassin/20_head_tests.cf:header UNCLOSED_BRACKET ALL =~ /\[\d+\r?\n/s /usr/share/spamassassin/20_head_tests.cf:header X_PRIORITY_CC ALL =~ /\nX-Priority:[^\n]{0,80}\nCc:/si /usr/share/spamassassin/20_ratware.cf:header HDR_ORDER_MTSRIX ALL =~ /\nMessage-ID: <[EMAIL PROTECTED]>\nTo: [^\n]+ <\S+>\nSubject: [^\n]+\nReferences: <[EMAIL PROTECTED]>\nIn-Reply-To: <[EMAIL PROTECTED]>\nX-Mailer: / /usr/share/spamassassin/20_ratware.cf:header HDR_ORDER_TRIMRS ALL =~ /\nTo: [^\n]+\nReferences: <[EMAIL PROTECTED]>\nIn-Reply-To: <[EMAIL PROTECTED]>\nMessage-ID: <[EMAIL PROTECTED]>\nReply-To: [^\n]+\nSender: / and this is leaving me a little boggled. On another note, is there a way to hand-edit your ~/.spamassassin/auto-whitelist file, or turn it into a text file than can be edited and then converted back? There's some stuff in there that shouldn't be... Thanks, -Philip