• 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

Bulk import email accounts from csv

H

haaronl

Guest
These are instructions for bulk importing or migrating email accounts from an old server to your new Plesk control panel. These instructions are for Plesk Panel 8.6.

1. Create a spreadsheet with the switches as the headings
2. Populate with data from your old server export function or copy-paste
3. Fill in switch data that may not have been exported
4. Write script (example at bottom) to import data from csv

from www.tres.ca

[root@274680-www1 bin]# ./mail.sh --help

Usage: mail.sh command <mail_name> [options]

Available commands:
--create or -c <mail>@<domain> creates mail account
--update or -u <mail>@<domain> updates mail account parameters
--remove or -r <mail>@<domain> removes mail account
--info or -i <mail>@<domain> retrieves mail account information
--on <domain> enables mail service for domain
--off <domain> disables mail service for domain
--update-service <domain> Update mail service for domain
--rename <mail>@<domain> Rename mail
--help or -h displays this help page

Available options:
-cp-access <true|false> enables control panel access (default:
true)
-cp_access <true|false> enables control panel access (default:
true) [deprecated]
-manage-virusfilter <true|false> allows or prohibits managing antivirus
-manage-drweb <true|false> allows or prohibits managing antivirus
[deprecated]
-manage-spamfilter <true|false> allows or prohibits managing spam
filter
-mailbox <true|false> creates/removes mailbox
-passwd <passwd> sets mailbox password [see the note
below for details]
-boxpass <passwd> obsolete alias for option "passwd"
(this option may be removed from
future releases)
-passwd_type <plain|encrypted> specifies the type of mailbox
password, ignored if no password
specified [see the note below for
details]
-mbox_quota <number>[K|M|G] limits the mailbox quota to the
desired amount in bytes ("-1" -
Default quota for domain)
-boxquota <number>[K|M|G] obsolete alias for option "mbox_quota"
(this option may be removed from
future releases)
-aliases<add|del>:<name1[,name2]> adds or deletes mail alias(es) to/from
mailname
-mgroups<add|del>:<list1[,list2]> adds or removes mail name to/from mail
group
-redirect <true|false> switches mail redirect on/off
-rediraddr <addr> sets redirect to address (required if
redirect is enabled)
-group <true|false> switches mail group on/off
-groupmem <add|del>:<addr1[,addr2]>
adds/removes address(-es) to/from
mail group
-repo <add|del>:<file1[,file2]> adds/removes file to/from attachments
repository [deprecated, use
autoresponder.sh]
-autorsp <true|false> switches all autoresponders on/off
[deprecated, use autoresponder.sh]
-autoname <name> autoresponder name (required for all
autoresponder options) [deprecated,
use autoresponder.sh]
-autostatus <true|false> switches on/off autoresponder with
specified name (true) [deprecated, use
autoresponder.sh]
-autoreq <subj|body>:<string> or <always>
defines the condition for the
autoresponder to be activated whether
the specified pattern is encountered
in the subject or body, or to respond
always [deprecated, use
autoresponder.sh]
-autosubj <original|string> the subject line to be set up into
autoresponder ("Re: <incoming
subject>") or a custom string
[deprecated, use autoresponder.sh]
-auto_replyto <string> return address that will be set up
into the autoresponder's messages
[deprecated, use autoresponder.sh]
-autotext <string> autoresponder message text
[deprecated, use autoresponder.sh]
-autoatch <add|del>:<file1[,file2]>
adds/removes autoresponder attachment
files [deprecated, use
autoresponder.sh]
-autofrq <number> defines the maximum number of
responses to a unique e-mail address
per day [deprecated, use
autoresponder.sh]
-autostor <number> defines the number of unique addresses
to be stored for autoresponder
[deprecated, use autoresponder.sh]
-autored <addr> defines the e-mail address to forward
all incoming mail to [deprecated, use
autoresponder.sh]
-multiple-sessions <true|false> allows/prohibits concurrent control
panel sessions for a mail user
-locale <string> set interface language (e.g. "it-IT"
for Italian)
-lines-per-page <int> display lines per page (not 0)
[deprecated]
-max-button-length <int> button label length
-skin <string> set interface skin (e.g. "WinXP
Reloaded")
-lock-screen <true|false> prevent users from working with the
control panel until interface screens
are completely loaded
-status <enabled|disabled|admin,domadm,parent,client>
Enables or disables status for domain
mail service
-new <mail> Specifies new email
-antivirus <off|inout|in|out> manages antivirus filtering for mail
traffic. "Off" disables antivirus
filtering, "Inout" enables it for mail
traffic going in any direction, "In"
enables it for incoming mail only, and
"Out" for outgoing mail only.
* Antivirus is not installed!

Note:
* For security reasons, you can transfer not encrypted passwords via
environment variable PSA_PASSWORD, by specifying the empty value in the command
line for the passwd arguments (like " -passwd ''") and setting the password
value in the PSA_PASSWORD variable.
Similarly, you can transfer the encrypted password via the environment
variable PSA_CRYPTED_PASSWORD, by specifying the empty value in the command
line for the passwd arguments (like " -passwd ''") and by setting the password
value in the PSA_CRYPTED_PASSWORD variable.

Version: psa v8.6.0_build86080822.20 os_RedHat el5


Here is an example script that would be run to create the accounts with aliases:

for i in `cat list`; do
/usr/local/psa/bin/mail.sh --create [email protected] -passwd -mailbox true
done
 
Back
Top