• If you are still using CentOS 7.9, it's time to convert to Alma 8 with the free centos2alma tool by Plesk or Plesk Migrator. Please let us know your experiences or concerns in this thread:
    CentOS2Alma discussion

How to add multiple email accounts

Pagemakers

Silver Pleskian
We need to add about 1000 email accounts to a domain. They will be in the format [email protected] with a unique password.

Is there a quick way of doing this - eg some sort of csv file import, or much we enter every single on of them manually?
 
I have a small shell script to add user's through the unix api. You will need to upload a file email.txt to the same directory of the script. The email.txt file should have the email address followed by a space or tab, and then the password on each line.

example:
[email protected] password
[email protected] pass2

You can then run the script sh <yourfilename>.sh

**Note
I am an advanced begginer when it comes to shell scripting I do not claim this script is the easiest/fastest/etc., but it should work. Please use at your own risk. I'm not responsible for your data, server, etc.

***** copy below this line for the script*******
#!/bin/sh

awk '{ print "/usr/local/psa/bin/mail.sh -c " $1 " -cp_access false -mailbox true -passwd " $2}' ./email.txt >> ./setup.sh;

sh setup.sh;
 
Back
Top