You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by ML mail <ml...@yahoo.com> on 2014/07/08 21:48:58 UTC

SA on a backup MX

Hello,

I would like to run SpamAssassin on my backup MX as well in order to avoid spam and backscatter. My backup MX will have a similar setup and configuration as my main MX, that would be Postfix+amavisd-new+ClamAV+SpamAssassin. 


Now I have all my user configuration including SpamAssassin Bayes and AWL stored in PostgreSQL and my backup MX will have a read-only replica of that PostgreSQL database. So my plan would be to have SA on the backup MX to use the Bayes+AWL data from the PostgreSQL in read-only mode meaning that it would not write any new Bayes+AWL info but just read it. So my question here is: is it possible to tell SA through its config to use Bayes+AWL data in read-only mode?

If that's not possible then I was thinking I could still use SA on my backup MX but I would then disable Bayes+AWL. What do you think?

Regards
ML


Re: SA on a backup MX

Posted by ML mail <ml...@yahoo.com>.
The reason for read-only is that I am using PostgreSQL with hot standby streaming replication. The main MX server will use the master PostgreSQL server and the backup MX will use its own local PostgreSQL slave server. The slave server of a PostgreSQL hot standby pair is only available in read-only for queries, this is how PostgreSQL works for streaming replication as such the SQL queries on my slave server (the backup MX server) must be only SELECTs and such but no INSERTs.

Thanks for pointing out the use_learner parameter, which I will definitely want to 1. I guess I will have to test and see if this is doable. In the worst case the INSERT queries would fail but maybe SA can handle that properly and still work or else I simply disable Bayes on the backup MX. 





On Wednesday, July 9, 2014 12:40 AM, RW <rw...@googlemail.com> wrote:
On Tue, 8 Jul 2014 12:48:58 -0700



ML mail wrote:

> Hello,
> 
> I would like to run SpamAssassin on my backup MX as well in order to
> avoid spam and backscatter.
> ...
> Now I have all my user configuration including SpamAssassin Bayes and
> AWL stored in PostgreSQL and my backup MX will have a read-only
> replica of that PostgreSQL database. So my plan would be to have SA
> on the backup MX to use the Bayes+AWL data from the PostgreSQL in
> read-only mode meaning that it would not write any new Bayes+AWL info
> but just read it. So my question here is: is it possible to tell SA
> through its config to use Bayes+AWL data in read-only mode?

I can see why you'd want to use a copy, but why does it matter that it's
not written to?



On Tue, 08 Jul 2014 22:53:47 +0200
Axb wrote:


> use_bayes 1
> use_bayes_rules 1
> use_learner 0


   use_learner ( 0 | 1 )         (default: 1)
        Whether to use any machine-learning classifiers with
   SpamAssassin, such as the default 'BAYES_*' rules.  Setting this to
   0 will disable use of any and all human-trained classifiers.


> bayes_auto_learn  0
> 
> that will use BAyes in read only mode.

Aside from use_learner, it wouldn't turn-off atime updates.

> Afaik, this will not control AWL - maybe disable that on the backup MX

> 


Re: SA on a backup MX

Posted by Axb <ax...@gmail.com>.
On 07/09/2014 12:40 AM, RW wrote:
>> use_learner 0
>
>     use_learner ( 0 | 1 )         (default: 1)
>          Whether to use any machine-learning classifiers with
>     SpamAssassin, such as the default 'BAYES_*' rules.  Setting this to
>     0 will disable use of any and all human-trained classifiers.

iirc, I've used use_learner 0 while testing different Bayes backend read 
speeds/file locking to avoid any learning intereference.

It seemed to have done what I needed.
(I did not review the code to confirm this)


You can also use

use_bayes_rules 0
use_learner 1

to tell SA to only feed Bayes yet NOT apply Bayes rules to msgs (as in 
the case of feeding trap data to Bayes via highscored dummy poison pill 
rules and autolearn_force)

Re: SA on a backup MX

Posted by RW <rw...@googlemail.com>.
On Tue, 8 Jul 2014 12:48:58 -0700
ML mail wrote:

> Hello,
> 
> I would like to run SpamAssassin on my backup MX as well in order to
> avoid spam and backscatter.
> ...
> Now I have all my user configuration including SpamAssassin Bayes and
> AWL stored in PostgreSQL and my backup MX will have a read-only
> replica of that PostgreSQL database. So my plan would be to have SA
> on the backup MX to use the Bayes+AWL data from the PostgreSQL in
> read-only mode meaning that it would not write any new Bayes+AWL info
> but just read it. So my question here is: is it possible to tell SA
> through its config to use Bayes+AWL data in read-only mode?

I can see why you'd want to use a copy, but why does it matter that it's
not written to?



On Tue, 08 Jul 2014 22:53:47 +0200
Axb wrote:


> use_bayes 1
> use_bayes_rules 1
> use_learner 0


   use_learner ( 0 | 1 )         (default: 1)
        Whether to use any machine-learning classifiers with
   SpamAssassin, such as the default 'BAYES_*' rules.  Setting this to
   0 will disable use of any and all human-trained classifiers.


> bayes_auto_learn  0
> 
> that will use BAyes in read only mode.

Aside from use_learner, it wouldn't turn-off atime updates.
 
> Afaik, this will not control AWL - maybe disable that on the backup MX
> 

Re: SA on a backup MX

Posted by Axb <ax...@gmail.com>.
On 07/08/2014 09:48 PM, ML mail wrote:
> Hello,
>
> I would like to run SpamAssassin on my backup MX as well in order to
> avoid spam and backscatter. My backup MX will have a similar setup
> and configuration as my main MX, that would be
> Postfix+amavisd-new+ClamAV+SpamAssassin.
>
>
> Now I have all my user configuration including SpamAssassin Bayes and
> AWL stored in PostgreSQL and my backup MX will have a read-only
> replica of that PostgreSQL database. So my plan would be to have SA
> on the backup MX to use the Bayes+AWL data from the PostgreSQL in
> read-only mode meaning that it would not write any new Bayes+AWL info
> but just read it. So my question here is: is it possible to tell SA
> through its config to use Bayes+AWL data in read-only mode?
>
> If that's not possible then I was thinking I could still use SA on my
> backup MX but I would then disable Bayes+AWL. What do you think?

on your backup MX local.cf set:

use_bayes 1
use_bayes_rules 1
use_learner 0
bayes_auto_learn  0

that will use BAyes in read only mode.

Afaik, this will not control AWL - maybe disable that on the backup MX


Re: SA on a backup MX

Posted by ML mail <ml...@yahoo.com>.
My backup MX will be on located on another continent this is the main reason (latency) why I would like a local read-only replica of my database on the backup MX server.




On Tuesday, July 8, 2014 9:57 PM, Antony Stone <An...@spamassassin.open.source.it> wrote:
On Tuesday 08 July 2014 at 21:48:58, ML mail wrote:




> Hello,
> 
> I would like to run SpamAssassin on my backup MX as well in order to avoid
> spam and backscatter. My backup MX will have a similar setup and
> configuration as my main MX, that would be
> Postfix+amavisd-new+ClamAV+SpamAssassin.
> 
> Now I have all my user configuration including SpamAssassin Bayes and AWL
> stored in PostgreSQL and my backup MX will have a read-only replica of
> that PostgreSQL database. So my plan would be to have SA on the backup MX
> to use the Bayes+AWL data from the PostgreSQL in read-only mode meaning
> that it would not write any new Bayes+AWL info but just read it. So my
> question here is: is it possible to tell SA through its config to use
> Bayes+AWL data in read-only mode?
> 
> If that's not possible then I was thinking I could still use SA on my
> backup MX but I would then disable Bayes+AWL. What do you think?

Why not provide r/w access to PostgreSQL on the main server from the MX 
machine?  They both presumably have static IPs, so securing that connection 
shouldn't be a problem?


Antony.

-- 
The idea that Bill Gates appeared like a knight in shining armour to lead all 
customers out of a mire of technological chaos neatly ignores the fact that it 
was he who, by peddling second-rate technology, led them into it in the first 
place.

- Douglas Adams in The Guardian, 25th August 1995

                                                   Please reply to the list;
                                                         please *don't* CC me.