Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I had a Debian Sarge server running Plesk 8.1 and moved to a CentOS server running cPanel. I do not remember how many email accounts were there. Using the terminal, how can I see how many active email accounts there are on the old server?

Also is there any way to backup the email data for each account and to move the data to my new CentOS installation?

share|improve this question

closed as off-topic by masegaloeh, fukawi2, EEAA, mdpc, HopelessN00b Mar 10 '15 at 13:37

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions should demonstrate reasonable business information technology management practices. Questions that relate to unsupported hardware or software platforms or unmaintained environments may not be suitable for Server Fault - see the help center." – masegaloeh, EEAA
If this question can be reworded to fit the rules in the help center, please edit the question.

For your original Debian Plesk server, list all email accounts like this.

To migrate accounts from Plesk to cPanel follow this guide. You'll want to migrate entire accounts, not just email accounts. The wizard in cPanel is actually surprisingly good for migrating things in from other control panel endowed servers.

share|improve this answer

I'm going to assume you mean, locally. That is, I assume you don't mean you're trying to figure out if has a GMail account. Instead you're trying to figure out, of the people who can log into the machine, which of them have email accounts.

Quite simply, all of them.

On Unix, all users by default can receive mail. So the "names of the email accounts" is the same as "all users". You presumably know how many local users there are because you just migrated them all from Debian to CentOS.

If, instead, you're talking about remote mail users who receive email via IMAP or POP, then you just need to check your IMAP/POP service; it will, presumably, find a way to enumerate the mailboxes. If you're using mbox-format mailboxes you can figure out which of the valid mailboxes are non-empty by looking in /var/spool/mail. If you want to figure out which empty mailboxes are still valid, you will need to check your IMAP/POP server configuration. It's hard to help you more on this part because you didn't state what method was being used to send/receive email.

This answer was perhaps less helpful that it could have been because your question was vague. What, specifically, are you trying to achieve? What do you mean precisely by "active email accounts" and what are you trying to do with them?

share|improve this answer
You are correct in everything you say, although you missed the crux of the question slightly. The OP is on cPanel and Plesk servers, both of which manage email outside of Unix accounts. This is really just a Plesk to cPanel migration. – SimonJGreen Mar 4 '12 at 17:32

What the command line tool It puts out a list with all email adresses and the passwords

root@server:~# /usr/local/psa/admin/sbin/mail_auth_view
Authentication database contents:
|             address                  |flags|               password               |
|                 |     |                             password |
share|improve this answer

Not the answer you're looking for? Browse other questions tagged or ask your own question.