Steps to recreate spam ham n quarantine accounts: Difference between revisions

(Created page with "=== <h1>Steps to recreate spam, ham and quarantine accounts</h1> === <hr> <br> <h3>Problem: </h3> Accidentally deleted spam,ham and quarantine accounts from the server and...")
 
 
(7 intermediate revisions by 3 users not shown)
Line 1: Line 1:
===  <h1>Steps to recreate spam, ham and quarantine accounts</h1>  ===
{{BC|Certified}}
__FORCETOC__
<div class="col-md-12 ibox-content">
=Steps to recreate spam, ham and quarantine accounts=
<hr>
<hr>
<br>
{{KB|{{ZC}}|{{ZCS 8.8}}|{{ZCS 8.7}}|{{ZCS 8.6}}|}}
<h3>Problem: </h3>


Accidentally deleted spam,ham and quarantine accounts from the server and backup is not available.
====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=====


<h3>Solution: </h3>
* Get the previous account names from the global configuration:
 
  su - zimbra
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
  zmprov -l gacf zimbraAmavisQuarantineAccount zimbraSpamIsSpamAccount zimbraSpamIsNotSpamAccount


* Now recreate the account using the name obtained in the previous step:


2). Above command will give us previously configured accounts' name which we can use to re-create accounts.
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.'
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.'
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.'


  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.'
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.'


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.'


=====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>, follow these steps.
* First create spam, ham and quarantine accounts with random passwords and add a random string in account name.:


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 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.'


* Get the new account names:
  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>
* Now add these to the global configuration, and restart for the changes to take effect:
 
  zmprov mcf zimbraSpamIsSpamAccount <spam-account@example.com> zimbraSpamIsNotSpamAccount <ham-account@example.com> zimbraAmavisQuarantineAccount <virus-quarantine-account@example.com>
  zmprov fc config
   
 
OR
 
  zmcontrol restart
  zmcontrol restart
'''Note:'''  Replace '''example.com''' with the actual primary domain name.


'''Note:'''
Replace DOMAIN.COM with the actual primary domain name according to your environment.




Heera Singh Koranga


"Heera Singh" <hsingh@zimbra.com>
Submitted by:  Heera Singh Koranga
{{Article Footer|ZCS 8.8, 8.7, 8.6|8/8/2017}}
{{NeedSME|Heera|SME2|Copyeditor}}
[[Category:Troubleshooting MTA]]

Latest revision as of 09:26, 22 February 2022

Steps to recreate spam, ham and quarantine accounts


   KB 23281        Last updated on 2022-02-22  




0.00
(0 votes)

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
  • Get 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>, follow these steps.

  • First create spam, ham and quarantine accounts with random passwords and 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.'
  • Get the new account names:
zmprov -l gaa | egrep -i 'spam|ham|virus-quarantine'
  • Now add these to the global configuration, and restart for the changes to take effect:
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

Verified Against: ZCS 8.8, 8.7, 8.6 Date Created: 8/8/2017
Article ID: https://wiki.zimbra.com/index.php?title=Steps_to_recreate_spam_ham_n_quarantine_accounts Date Modified: 2022-02-22



Try Zimbra

Try Zimbra Collaboration with a 60-day free trial.
Get it now »

Want to get involved?

You can contribute in the Community, Wiki, Code, or development of Zimlets.
Find out more. »

Looking for a Video?

Visit our YouTube channel to get the latest webinars, technology news, product overviews, and so much more.
Go to the YouTube channel »


Wiki/KB reviewed by Heera SME2 Copyeditor Last edit by Barry de Graaff
Jump to: navigation, search