How to create a mail account using CLI with plesk

We sometimes need to know some commands to reduce our time managing a mail server.
Here, I'm going to type some commands to give you several tricks to work with.
For example, when you have to add a lot of information into your plesk mail server, like mail accounts, you can use a bash script to create a mail account for each name written into a file.

First: we need to connect via ssh

ssh root@mymailserverip

After that, we have to execute:

/usr/local/psa/bin/mail --create test@domain.com -passwd mypass -cp-access true -mailbox true -mbox_quota 10M -antivirus inout

Command above use several options:
-- create = create a mail account named test@domain.com
- passwd = set password as "mypass"
- cp-access = allow accessing to plesk GUI
- mailbox = create a mailbox
- mbox_quota = set the size of the mailbox
- antivirus = enable in out screening mails


In a few days I will add a script file

Updated: link_script

More information