You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by mouss <mo...@ml.netoyen.net> on 2010/08/14 23:51:16 UTC

controlling channel order (Was: JM_SOUGHT_FRAUD)

  Le 12/08/2010 00:37, Karsten Bräckelmann a écrit :
> On Wed, 2010-08-11 at 17:30 -0400, Bowie Bailey wrote:
>> In case anyone else is following this...
>>
>> The sa-update process made things a bit more complex than simply
>> renaming the file after updates.  If that's all you do, then sa-update
>> loses track of the file and will download a new copy on every run.  What
>> I had to do is this:
>>
>> 1) Rename the .cf file back to the original name so sa-update can find it
>> 2) Run sa-update
>> 3) Rename the .cf file to z_sought_rules_yerp_org.cf
>> 4) Restart spamd
>>
>> You don't have to mess with the directory, just rename the main
>> sought_rules_yerp_org.cf file.
> Hmm, a simple symlink, albeit (once) manually set-up, should do, too.
>
>    ln -s sought_rules_yerp_org.cf zzz.cf
>
> This would parse anything from the more recent dedicated channel, after
> the stock rules (and sought itself) have been parsed. Again.
>
> Yes, this overwrites the sought rules' meta definitions a third time.
> But that shouldn't be much of a problem, really. Also, any stale, unused
> sub-rules (see my other follow-up) will be ignored by SA prior to
> compiling the REs.
>
> This should work as a do-it-once-and-forget workaround to the issue,
> rather than relying on ghastly file renaming in the sa-updating cron
> job. The latter even is prone to race errors, in rare and specific
> circumstances.
>

or one can use two different directories:
- one for sa-update
- one for spamassassin (and sa-compile): keep the default

and create symlinks in the latter. This way one can
- select the order of inclusion of all channels.
- disable channels without (re)moving their (downloaded) files.
- add ones own rules in the same directory










Re: controlling channel order (Was: JM_SOUGHT_FRAUD)

Posted by mouss <mo...@ml.netoyen.net>.
  Le 16/08/2010 15:53, Bowie Bailey a écrit :
>   On 8/14/2010 5:51 PM, mouss wrote:
>>   Le 12/08/2010 00:37, Karsten Bräckelmann a écrit :
>>> On Wed, 2010-08-11 at 17:30 -0400, Bowie Bailey wrote:
>>>> In case anyone else is following this...
>>>>
>>>> The sa-update process made things a bit more complex than simply
>>>> renaming the file after updates.  If that's all you do, then sa-update
>>>> loses track of the file and will download a new copy on every run.
>>>> What
>>>> I had to do is this:
>>>>
>>>> 1) Rename the .cf file back to the original name so sa-update can
>>>> find it
>>>> 2) Run sa-update
>>>> 3) Rename the .cf file to z_sought_rules_yerp_org.cf
>>>> 4) Restart spamd
>>>>
>>>> You don't have to mess with the directory, just rename the main
>>>> sought_rules_yerp_org.cf file.
>>> Hmm, a simple symlink, albeit (once) manually set-up, should do, too.
>>>
>>>     ln -s sought_rules_yerp_org.cf zzz.cf
>>>
>>> This would parse anything from the more recent dedicated channel, after
>>> the stock rules (and sought itself) have been parsed. Again.
>>>
>>> Yes, this overwrites the sought rules' meta definitions a third time.
>>> But that shouldn't be much of a problem, really. Also, any stale, unused
>>> sub-rules (see my other follow-up) will be ignored by SA prior to
>>> compiling the REs.
>>>
>>> This should work as a do-it-once-and-forget workaround to the issue,
>>> rather than relying on ghastly file renaming in the sa-updating cron
>>> job. The latter even is prone to race errors, in rare and specific
>>> circumstances.
>>>
>> or one can use two different directories:
>> - one for sa-update
>> - one for spamassassin (and sa-compile): keep the default
>>
>> and create symlinks in the latter. This way one can
>> - select the order of inclusion of all channels.
>> - disable channels without (re)moving their (downloaded) files.
>> - add ones own rules in the same directory
> That could work, but you would have to symlink both the .cf file and the
> directory for each channel due to the includes in the .cf files.
>

Let me clarify what I meant:

- you define a channel file which contains "first" channels. for these, 
you symlink the .cf files with a 010_name, 020_name, ... etc
- for all the rest (be that other channel files or directories included 
by the above cited .cf files), you symlink "blindly"

let me explain this with /bin/sh:

cd $sa_up_dir
for f in *; do
     ln -s ${sa_up_dir}/$f  ${sa_dir}/$f || true
done
cd $sa_dir
i=0
for f in `grep -v "^#" /path/to/channel.conf; do
     i=`expr $i + 1`
     mv $f ${i}_${f}
done

(this is intended to explain what I mean, now what I do...)




Re: controlling channel order (Was: JM_SOUGHT_FRAUD)

Posted by Bowie Bailey <Bo...@BUC.com>.
 On 8/14/2010 5:51 PM, mouss wrote:
>  Le 12/08/2010 00:37, Karsten Bräckelmann a écrit :
>> On Wed, 2010-08-11 at 17:30 -0400, Bowie Bailey wrote:
>>> In case anyone else is following this...
>>>
>>> The sa-update process made things a bit more complex than simply
>>> renaming the file after updates.  If that's all you do, then sa-update
>>> loses track of the file and will download a new copy on every run. 
>>> What
>>> I had to do is this:
>>>
>>> 1) Rename the .cf file back to the original name so sa-update can
>>> find it
>>> 2) Run sa-update
>>> 3) Rename the .cf file to z_sought_rules_yerp_org.cf
>>> 4) Restart spamd
>>>
>>> You don't have to mess with the directory, just rename the main
>>> sought_rules_yerp_org.cf file.
>> Hmm, a simple symlink, albeit (once) manually set-up, should do, too.
>>
>>    ln -s sought_rules_yerp_org.cf zzz.cf
>>
>> This would parse anything from the more recent dedicated channel, after
>> the stock rules (and sought itself) have been parsed. Again.
>>
>> Yes, this overwrites the sought rules' meta definitions a third time.
>> But that shouldn't be much of a problem, really. Also, any stale, unused
>> sub-rules (see my other follow-up) will be ignored by SA prior to
>> compiling the REs.
>>
>> This should work as a do-it-once-and-forget workaround to the issue,
>> rather than relying on ghastly file renaming in the sa-updating cron
>> job. The latter even is prone to race errors, in rare and specific
>> circumstances.
>>
>
> or one can use two different directories:
> - one for sa-update
> - one for spamassassin (and sa-compile): keep the default
>
> and create symlinks in the latter. This way one can
> - select the order of inclusion of all channels.
> - disable channels without (re)moving their (downloaded) files.
> - add ones own rules in the same directory

That could work, but you would have to symlink both the .cf file and the
directory for each channel due to the includes in the .cf files.

-- 
Bowie