spamassassin-users June 2011 archive
Main Archive Page > Month Archives  > spamassassin-users archives
spamassassin-users: Re: Sought rules

Re: Sought rules

From: Karsten Bräckelmann <guenther_at_nospam>
Date: Sat Jun 11 2011 - 19:53:49 GMT
To: users@spamassassin.apache.org

On Sat, 2011-06-11 at 06:45 -0400, Michael Scheidell wrote:
> On 6/10/11 1:14 PM, Karsten Bräckelmann wrote:
> > This merely requires a re-ordering hack, though. A symlink zzz_sought.cf
> > in your rule updates dir, pointing at the channel generated cf should
> > do. These channel cf files only hold include statements, to pull in the
> > actual cf files in the per-channel dir.

> ln -s /var/db/spamassassin/{ver}/sought_rules_yerp_org.cf
> /var/db/spamassassin/{ver}/updates_spamassassin_org.cf/zzz_sought.cf
                                                     ^^^
That's a file, not a directory.

For each update channel, there is an appropriately named directory and a
cf file. The per-channel sub-directories are not parsed for cf files.
The cf files in the updatedir itself are used -- and they consist of a
bunch of include directives, pulling in their channels contents.

  # cd /var/lib/spamassassin/$VERSION
  # ln -s sought_rules_yerp_org.cf z-INCLUDE-LATE.cf

See 'man sa-update' for the actual updatedir used by your OS / distro.
As a result, you'll get something like this.

  drwxr-xr-x sought_rules_yerp_org/
  -rw-r--r-- sought_rules_yerp_org.cf
  drwxr-xr-x updates_spamassassin_org/
  -rw-r--r-- updates_spamassassin_org.cf
  lrwxrwxrwx z-INCLUDE-LATE.cf -> sought_rules_yerp_org.cf

To verify the SOUGHT rules are indeed included a second time, after the
stock rule-set, have a look at the debug output.

  $ spamassassin --lint -D config 2>&1 | grep 'read file /var/' | less

You'll see the per-channel cf files for sought, stock, and the symlink.
Followed by their respective channel contents, included from these
files. So you'll see sought actually being read twice, before and after
stock.

The symlink needs to be created exactly once, after each SA upgrade,
since the updatedir is versioned.

Also, it should be possible to symlink from your site config dir, or
even use an include statement in a site config cf file. Didn't test
that, though. However, this too needs to be updated after each SA
upgrade.

-- char *t="\10pse\0r\0dtu\0.@ghno\x4e\xc8\x79\xf4\xab\x51\x8a\x10\xf4\xf4\xc4"; main(){ char h,m=h=*t++,*x=t+2*h,c,i,l=*x,s=0; for (i=0;i<l;i++){ i%8? c<<=1: (c=*++x); c&128 && (s+=h); if (!(h>>=1)||!t[s+h]){ putchar(t[s]);h=m;s=0; }}}