Articles in this section

How to create mail accounts in bulk using CLI in Plesk for Linux?

kb: how-to Plesk for Linux

Applicable to:

  • Plesk for Linux

Question

How to create mail accounts in bulk using CLI in Plesk for Linux?

Answer

The following command can iterate through a list of email addresses and create them using the command-line Mail utility:

  1. Connect to the server via SSH

  2. Create a list of mail addresses to be created with one mail address per line as in the following example:

    # cat maillist.txt
    jane_doe@example.com
    john_doe@example.com
    mike_doe@example.com

    Note: In this example, maillist.txt is the name of the file containing the mail address list.

  3. Run the following command on the same directory where the file is located. This will iterate the list and create the accounts included in the file:

    # for i in `cat maillist.txt`; do plesk bin mail --create $i -mailbox true; done

    The output should look like the following:

    CONFIG_TEXT: SUCCESS: Creation of mailname 'jane_doe@example.com' complete
    SUCCESS: Creation of mailname 'john_doe@example.com' complete
    SUCCESS: Creation of mailname 'mike_doe@example.com' complete

  4. Once accounts are created, each email owner will have to set a password at Domains > example.com > Mail > Email Addresses > john_doe@example.com > Password.

Additional Information

Was this article helpful?

Comments

2 comments
Date Votes
  • It has no advantages, it would be helpful if a password for each email account could be added

    1
  • mail with password import please

    0

Please sign in to leave a comment.