Arne Hoffmann wrote: > Emmanuel Lesouef wrote: > > >> body LOCAL_DEMONSTRATION_RULE /test/ >> score LOCAL_DEMONSTRATION_RULE 1.000 >> describe LOCAL_DEMONSTRATION_RULE This is a simple test rule >> >> The problem is that the rule doesn't seems to be parsed. >> > > Yes, if you want to match 'test' in the Subject, you need a header rule: > > header LOCAL_DEMONSTRATION_RULE /test/ > score LOCAL_DEMONSTRATION_RULE 1.000 > describe LOCAL_DEMONSTRATION_RULE This is a simple test rule >
First, Arne, that header rule is invalid, you forgot to specify what header to match. If you want to match subject headers, but not the body: header LOCAL_DEMONSTRATION_RULE Subject =~ /test/ If you wanted to match all headers header LOCAL_DEMONSTRATION_RULE ALL =~ /test/ Second, body rules *WILL* match the subject line of a message. Therefore you do NOT need a header rule. (99.9% of body rules are looking for common message text that could appear in either the body or the subject. Rather than forcing the ruleset to be doubled-up with both body and subject rules looking for the same text, body rules were made to match both) Finally, Emmanuel's real probem is that he didn't restart amavis after modifying his local.cf. Anyone using spamd, or a tool like amavis that uses the perl API, will need to restart it in order for local.cf to be re-parsed. This has the positive side-effect of letting you run spamassassin --lint on your rules after editing them before they "go live", but the real purpose is to save the overhead of constantly checking or re-reading this file.