King0770-Notes-Export And Import Spamassassin Rules: Difference between revisions

(Created page with "The following is to export your existing Spamassassin Baye rules from one machine to another:<br> <strong>Note:</strong> For the context of this article, a <strong>machine</s...")
 
 
(2 intermediate revisions by the same user not shown)
Line 15: Line 15:


<strong>Possible scenarios</strong><br>
<strong>Possible scenarios</strong><br>
* Retiring an existing machine, with a new machine -
* Retiring an existing machine, with a new machine  
* Adding a new machine
* Adding a new machine


Line 22: Line 22:
/opt/zimbra/common/bin/sa-learn --dbpath /opt/zimbra/data/amavisd/.spamassassin --backup >> /tmp/sa.db
/opt/zimbra/common/bin/sa-learn --dbpath /opt/zimbra/data/amavisd/.spamassassin --backup >> /tmp/sa.db
</pre></code>
</pre></code>
Then copy the /tmp/sa.db to the new machine.
Then copy the /tmp/sa.db file to the new machine.


==Restore/Import==
==Restore/Import==
<code><pre>
<code><pre>
/opt/zimbra/common/bin/sa-learn --dbpath /opt/zimbra/data/amavisd/.spamassassin —restore /tmp/sa.db
/opt/zimbra/common/bin/sa-learn --dbpath /opt/zimbra/data/amavisd/.spamassassin --restore /tmp/sa.db


zmcontrol restart
zmcontrol restart

Latest revision as of 22:30, 27 June 2019

The following is to export your existing Spamassassin Baye rules from one machine to another:

Note: For the context of this article, a machine is running MTA and Amavis services.

zmcontrol status
Host mta.example.com
	amavis                  Running
	antispam                Running
	antivirus               Running
	mta                     Running
	opendkim                Running
	zmconfigd               Running

Possible scenarios

  • Retiring an existing machine, with a new machine
  • Adding a new machine

How to export

/opt/zimbra/common/bin/sa-learn --dbpath /opt/zimbra/data/amavisd/.spamassassin --backup >> /tmp/sa.db

Then copy the /tmp/sa.db file to the new machine.

Restore/Import

/opt/zimbra/common/bin/sa-learn --dbpath /opt/zimbra/data/amavisd/.spamassassin --restore /tmp/sa.db

zmcontrol restart

**OR**

zmamavisdctl restart

More articles written by me, https://wiki.zimbra.com/wiki/King0770-Notes

Jump to: navigation, search