I did not realize you were talking about whitelisting when I replied. The whitelist_from and related commands use filename globbing. You can use '?' to represent one character or '*' to represent any number of characters, but that is the extent of it.
The rule that I listed below can be used as an effective whitelist/blacklist if you give it an appropriate score. You can set 'allow_user_rules 1' in local.cf to allow the rule to be defined in ~/.spamassassin/user_prefs. If you do not want to allow user rules, you can define the rule in local.cf and give it a 0 score. The individual users would then be able to activate the rule by changing the score in user_prefs. local.cf: header MY_NUMBER_EMAIL To:addr =~ /^\d[0-9a-f\....@mydomain/i score MY_NUMBER_EMAIL 0 ~/.spamassassin/user_prefs: score MY_NUMBER_EMAIL -100 (or set it to 100 for a blacklist effect) Bowie Linda Walsh wrote: > Does the below apply to the > ~/.spamassassin/userprefs > whitelisting (command, keyword or feature)... > > Sorry...it was the whitelisting in the userpref file that I > was talking about the "primitive pattern matching".... > > At one point it was limited to DOS-like file-matching patterns, > not the full perlregexp set (which they below example you gave > me would be an excellent example!) ... > > I don't see 'header' as a usable line in "userprefs". > > > thanks, > -linda > > > Bowie Bailey wrote: > > Linda Walsh wrote: > > > I get many emails addressed to internal sendmail <id>'s. > > > 123...@mydomain, 1abd56.ef7...@mydomain > > > (seem to fit a basic pattern but don't know how to specify the > > > pattern (or I don't have it right)): > > > <(start of an email-address)>[0-9][0-9a-fa-f\....@mydomain > > > > > > by start of an email, addr, I mean inside or outside literal '<>'. > > > I try matching to '<' as a start char to look for anything > > > starting with a number, but that fails if they don't use the > > > "name <x...@yy>" format, but just use "x...@yy". Don't know how to > > > root at beginning of any email address looking thing. > > > > I think this is what you are looking for (untested): > > > > header MY_NUMBER_EMAIL To:addr =~ /^\d[0-9a-f\....@mydomain/i > > > > Look in the "Rule Definition" section of the man page for > > Mail::SpamAssassin::Conf for more info on the ':addr' option. > > > > > I know the pattern matcher in the userprefs file is primitive > > > though -- like DOS level file matching, so I don't know how to > > > write > > > it in userprefs... > > > > user_prefs uses the exact same pattern matching as the rest of SA > > (Perl regexps). It is anything but primitive. > > > > The caveat being that rule definitions are not allowed in user_prefs > > files unless you allow it by putting this in your local.cf: > > > > allow_user_rules 1 > > > > > any hints would be appreciated... > > > running slightly older SA 3.1.7 on perl 5.8.8.... > > > > > > intending to update ... eventually but don't know that this would > > > solve any pattern help.... > > > > Shouldn't make any difference for this.