Difference between revisions of "Steps to recreate spam ham n quarantine accounts"
(→Solution) |
|||
Line 9: | Line 9: | ||
==Solution== | ==Solution== | ||
− | Steps to re-create spam,ham and quarantine accounts : | + | Steps to re-create spam,ham and quarantine accounts : |
− | 1). First we have to find out previous accounts' name from global config. | + | |
+ | '''1).''' First we have to find out previous accounts' name from global config. | ||
su - zimbra | su - zimbra | ||
zmprov -l gacf zimbraAmavisQuarantineAccount zimbraSpamIsSpamAccount zimbraSpamIsNotSpamAccount | zmprov -l gacf zimbraAmavisQuarantineAccount zimbraSpamIsSpamAccount zimbraSpamIsNotSpamAccount | ||
− | 2). Above command will give us previously configured accounts' name which we can use to re-create accounts. | + | '''2).''' Above command will give us previously configured accounts' name which we can use to re-create accounts. |
− | Spam Account | + | Spam Account: |
zmprov ca <SPAM-ACCOUNT@YOURDOMAIN.COM> <PASSWORD> amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE description 'System account for spam training.' | zmprov ca <SPAM-ACCOUNT@YOURDOMAIN.COM> <PASSWORD> amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE description 'System account for spam training.' | ||
− | Ham Account | + | Ham Account: |
zmprov ca <HAM-ACCOUNT@YOURDOMAIN.COM> <PASSWORD> amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE description 'System account for Non-Spam (Ham) training.' | zmprov ca <HAM-ACCOUNT@YOURDOMAIN.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 <VIRUS-QUARANTINE-ACCOUNT@YOURDOMAIN.COM> <PASSWORD> amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE zimbraMailMessageLifetime 30d description 'System account for Anti-virus quarantine.' | zmprov ca <VIRUS-QUARANTINE-ACCOUNT@YOURDOMAIN.COM> <PASSWORD> amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE zimbraMailMessageLifetime 30d description 'System account for Anti-virus quarantine.' | ||
Line 34: | Line 35: | ||
zmprov ca virus-quarantine.`strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c10`@YOURDOMAIN.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.' | zmprov ca virus-quarantine.`strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c10`@YOURDOMAIN.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.' | ||
− | 3). Now we have to set newly created accounts' name in global config, before this we have to check exact name of newly created accounts. | + | '''3).''' 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 mcf zimbraSpamIsSpamAccount <SPAM-ACCOUNT@YOURDOMAIN.COM> zimbraSpamIsNotSpamAccount <HAM-ACCOUNT@YOURDOMAIN.COM> zimbraAmavisQuarantineAccount <VIRUS-QUARANTINE-ACCOUNT@YOURDOMAIN.COM> | zmprov mcf zimbraSpamIsSpamAccount <SPAM-ACCOUNT@YOURDOMAIN.COM> zimbraSpamIsNotSpamAccount <HAM-ACCOUNT@YOURDOMAIN.COM> zimbraAmavisQuarantineAccount <VIRUS-QUARANTINE-ACCOUNT@YOURDOMAIN.COM> | ||
+ | |||
zmprov fc config | zmprov fc config | ||
− | OR | + | OR |
zmcontrol restart | zmcontrol restart | ||
− | '''Note:''' | + | '''Note:''' Replace '''YOURDOMAIN.COM''' with the actual primary domain name according to your environment. |
− | Replace | + | |
+ | |||
− | |||
− | |||
+ | Submitted by: Heera Singh Koranga | ||
{{Article Footer|ZCS 8.8, 8.7, 8.6|8/8/2017}} | {{Article Footer|ZCS 8.8, 8.7, 8.6|8/8/2017}} | ||
{{NeedSME|Heera|SME2|Copyeditor}} | {{NeedSME|Heera|SME2|Copyeditor}} | ||
[[Category:Troubleshooting MTA]] | [[Category:Troubleshooting MTA]] |
Revision as of 20:14, 21 August 2017
Steps to recreate spam, ham and quarantine accounts
Problem
Accidentally deleted spam,ham and quarantine accounts from the server and backup is not available.
Solution
Steps to re-create spam,ham and quarantine accounts :
1). First we have to find out previous accounts' name from global config.
su - zimbra zmprov -l gacf zimbraAmavisQuarantineAccount zimbraSpamIsSpamAccount zimbraSpamIsNotSpamAccount
2). Above command will give us previously configured accounts' name which we can use to re-create accounts.
Spam Account:
zmprov ca <SPAM-ACCOUNT@YOURDOMAIN.COM> <PASSWORD> amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE description 'System account for spam training.'
Ham Account:
zmprov ca <HAM-ACCOUNT@YOURDOMAIN.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@YOURDOMAIN.COM> <PASSWORD> amavisBypassSpamChecks TRUE zimbraAttachmentsIndexingEnabled FALSE zimbraIsSystemAccount TRUE zimbraIsSystemResource TRUE zimbraHideInGal TRUE zimbraMailMessageLifetime 30d description 'System account for Anti-virus quarantine.'
If you don't want to re-create accounts with old name then we can create new accounts in that format which is used by the installation script, like spam.<random number> and ham.<random number>.
Following command will create spam,ham and quarantine account with random password and will add random string in account name.
zmprov ca spam.`strings /dev/urandom | tr -dc _A-Z-a-z-0-9 | head -c10`@YOURDOMAIN.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`@YOURDOMAIN.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`@YOURDOMAIN.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.'
3). 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@YOURDOMAIN.COM> zimbraSpamIsNotSpamAccount <HAM-ACCOUNT@YOURDOMAIN.COM> zimbraAmavisQuarantineAccount <VIRUS-QUARANTINE-ACCOUNT@YOURDOMAIN.COM> zmprov fc config OR zmcontrol restart
Note: Replace YOURDOMAIN.COM with the actual primary domain name according to your environment.
Submitted by: Heera Singh Koranga