On 8/5/2010 2:11 PM, Matthew Kitchin (public/usenet) wrote: > > Amavisd could reject the mail. I was planning on using Spamassassin > (with a custom built rule) to examine the email for the names. We > would only use the names of our patients. The names would be dumped > out of our patient DB every night. If a patient has a a same name as a > friend, there would be a code we would put in the subject to bypass > the filter. I was thinking of a custom rule for that code that would > have a score of -20 or something like that. Basically, Spamassassin's > role would be deciding whether or not one of the names was in the > email and if the override code was in the subject. I'm not saying it > is the most brilliant idea in the world, but it is what I have been > told to implement.
My approach to doing something like this would be to have a rule that matches the names (however you implement it), and then have the MTA check for that particular rule hit and bounce the message if it exists. This is the same way you generally use the VBounce plugin. Then do the same thing for your "bypass" rule. > I know Amavisd well, so I can handle that part. I guess by main > question should be, could I have Spamassassin read a custom rule to > look for several thousand patient names in the format "John Smith" and > "Smith, John"? Spamassassin can use whatever custom rule you care to come up with. It will happily use a regex with hundreds of names listed. The question is whether the rule would cause a noticeable slowdown in processing speed. The only way to find out is to try it. Using compiled rules would probably help here. body BAD_NAMES /John Smith|Smith, John|Jane Doe|Doe, Jane|....../ Not the most efficient rule, but it would work. You would probably have to split it into multiple rules and combine them with a meta rule. body __BAD_NAMES1 ..... body __BAD_NAMES2 ..... body __BAD_NAMES3 ..... meta BAD_NAMES __BAD_NAMES1 || __BAD_NAMES2 || __BAD_NAMES3 Regexp::Optimizer would probably also help when creating the rules. -- Bowie