help centre
For more info visit status.atmail.com

How can we help?


Search our knowledge base for answers to
common questions and latest updates.



My activities New request

Follow

Purging Inactive Users From Atmail

Stewart -

PROBLEM
I need the ability to purge inactive users from my Atmail installation.

ENVIRONMENT

  • On-Premise Server + WebMail Installations: Version 7.0 > Current Version
  • Webmail Only Installations: Version 7.0 > Current Version

CAUSE

  • Too many inactive users inflating the database

RESOLUTION

After running a mailserver for some time, especially those with larger user bases, you may find you want to purge the Atmail system of any inactive users. Included with Atmail is a script that allows you to do just that.

Purging Inactive Users From Atmail

You will find the script at /usr/local/atmail/webmail/utilities/tools/purge-users.php (the /usr/local/atmail part of the path may vary for webmail only installations) and it is used as such:

Usage: php purge-users.php [days-inactive] [--no-delete]
days-inactive    Delete users inactive for this many days or more
--no-delete    do not actually delete any users, just print them

For example: I want to delete all users whom have been inactive for 60 days. I want to double check the list first so I pass the --no-delete option:

# cd /usr/local/atmail/webmail/utilities/tools/
# php purge-users.php 60 --no-delete
TEST RUN -- no accounts actually deleted
Deleting brad@atmail.com, inactive since 2010-11-05 11:54:14
Deleting test@atmail.com, inactive since 2010-11-19 23:01:19

Once I confirm that I indeed wish to delete those accounts listed I re-issue the command, this time without the --no-delete option:

# php purge-users.php 60
Deleting brad@atmail.com, inactive since 2010-11-05 11:54:14
Deleting test@atmail.com, inactive since 2010-11-19 23:01:19

Now the inactive accounts have been deleted, that includes all email and other data associated with them.

Have more questions? Submit a request

Comments


Contact our support team


+61 (7) 5357 6605       support@atmail.com