Steps to recreate spam ham n quarantine accounts: Difference between revisions
mNo edit summary |
No edit summary |
||
Line 3: | Line 3: | ||
<div class="col-md-12 ibox-content"> | <div class="col-md-12 ibox-content"> | ||
=Steps to recreate spam, ham and quarantine accounts= | =Steps to recreate spam, ham and quarantine accounts= | ||
<hr> | |||
{{KB|{{ZC}}|{{ZCS 8.8}}|{{ZCS 8.7}}|{{ZCS 8.6}}|}} | {{KB|{{ZC}}|{{ZCS 8.8}}|{{ZCS 8.7}}|{{ZCS 8.6}}|}} | ||
==Problem== | ====Problem==== | ||
Accidentally deleted spam,ham and quarantine accounts from the server and backup is not available. | Accidentally deleted spam, ham and quarantine accounts from the server and no backup is not available. | ||
==Solution== | ====Solution==== | ||
Steps to re-create spam,ham and quarantine accounts | =====Steps to re-create existing spam,ham and quarantine accounts===== | ||
* First find the previous account names from the global configuration: | |||
su - zimbra | su - zimbra | ||
zmprov -l gacf zimbraAmavisQuarantineAccount zimbraSpamIsSpamAccount zimbraSpamIsNotSpamAccount | zmprov -l gacf zimbraAmavisQuarantineAccount zimbraSpamIsSpamAccount zimbraSpamIsNotSpamAccount | ||
* Now recreate the account using the name obtained in the previous step: | |||
Spam Account: | Spam Account: | ||
zmprov ca < | zmprov ca <spam-account@example.com> <PASSWORD> amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE description 'System account for spam training.' | ||
Ham Account: | Ham Account: | ||
zmprov ca < | zmprov ca <ham-account@example.com> <PASSWORD> amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE description 'System account for Non-Spam (Ham) training.' | ||
Quarantine Account: | Quarantine Account: | ||
zmprov ca < | zmprov ca <virus-quarantine-account@example.com> <PASSWORD> amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE zimbraMailMessageLifetime 30d description 'System account for Anti-virus quarantine.' | ||
=====Steps to create new spam, ham and quarantine accounts===== | |||
The above recreates existing accounts. If there is a need to recreate accounts with a random name, like spam.<random number> and ham.<random number>, run the following commands. | |||
It will create spam, ham and quarantine accounts with random passwords and will add a random string in account name.: | |||
zmprov ca ham.`strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c10`@ | zmprov ca spam.`strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c10`@example.com "`strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c10`" amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE description 'System account for spam training.' | ||
zmprov ca ham.`strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c10`@example.com "`strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c10`" amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE description 'System account for Non-Spam (Ham) training.' | |||
zmprov ca virus-quarantine.`strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c10`@example.com "`strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c10`" amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount: TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE zimbraMailMessageLifetime 30d description 'System account for Anti-virus quarantine.' | |||
* Now we have to set newly created accounts' name in global config, before this we have to check exact name of newly created accounts. | |||
zmprov -l gaa | egrep -i 'spam|ham|virus-quarantine' | zmprov -l gaa | egrep -i 'spam|ham|virus-quarantine' | ||
zmprov | zmprov mcf zimbraSpamIsSpamAccount <spam-account@example.com> zimbraSpamIsNotSpamAccount <ham-account@example.com> zimbraAmavisQuarantineAccount <virus-quarantine-account@example.com> | ||
zmcontrol restart | zmcontrol restart | ||
'''Note:''' Replace ''' | '''Note:''' Replace '''example.com''' with the actual primary domain name. | ||
Revision as of 12:29, 22 May 2018
Steps to recreate spam, ham and quarantine accounts
Problem
Accidentally deleted spam, ham and quarantine accounts from the server and no backup is not available.
Solution
Steps to re-create existing spam,ham and quarantine accounts
- First find the previous account names from the global configuration:
su - zimbra zmprov -l gacf zimbraAmavisQuarantineAccount zimbraSpamIsSpamAccount zimbraSpamIsNotSpamAccount
- Now recreate the account using the name obtained in the previous step:
Spam Account:
zmprov ca <spam-account@example.com> <PASSWORD> amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE description 'System account for spam training.'
Ham Account:
zmprov ca <ham-account@example.com> <PASSWORD> amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE description 'System account for Non-Spam (Ham) training.'
Quarantine Account:
zmprov ca <virus-quarantine-account@example.com> <PASSWORD> amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE zimbraMailMessageLifetime 30d description 'System account for Anti-virus quarantine.'
Steps to create new spam, ham and quarantine accounts
The above recreates existing accounts. If there is a need to recreate accounts with a random name, like spam.<random number> and ham.<random number>, run the following commands. It will create spam, ham and quarantine accounts with random passwords and will add a random string in account name.:
zmprov ca spam.`strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c10`@example.com "`strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c10`" amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE description 'System account for spam training.' zmprov ca ham.`strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c10`@example.com "`strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c10`" amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE description 'System account for Non-Spam (Ham) training.' zmprov ca virus-quarantine.`strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c10`@example.com "`strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c10`" amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount: TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE zimbraMailMessageLifetime 30d description 'System account for Anti-virus quarantine.'
- Now we have to set newly created accounts' name in global config, before this we have to check exact name of newly created accounts.
zmprov -l gaa | egrep -i 'spam|ham|virus-quarantine' zmprov mcf zimbraSpamIsSpamAccount <spam-account@example.com> zimbraSpamIsNotSpamAccount <ham-account@example.com> zimbraAmavisQuarantineAccount <virus-quarantine-account@example.com> zmcontrol restart
Note: Replace example.com with the actual primary domain name.
Submitted by: Heera Singh Koranga