Mail Accounts: mail.exe

The mail.exe utility serves to manage mail accounts. The utility allows the following operations:

Location

%plesk_cli%

Usage

mail.exe <command> [[<mail name>@]<domain name>] [
<option 1> <param 1>[,<param 2>,...,<param n>]
[<option 2> <param 1>[,<param 2>,...,<param n>]]
... [<option N> <param 1>[,<param 2>,...,<param n>]]
]

 

Example

The following command creates the JohnDoe@example.com mail account, sets the password MyPass for it, restricts the size of the mailbox to 10240 KB, and enables bidirectional mail checkup for viruses.

>mail.exe --create JohnDoe@example.com -passwd MyPass -mbox_quota 10240K -antivirus inout

 

Commands

Command

Parameter

Description

Example

--create or -c

<mail name>@<domain name>

Creates a mail account with a specified name.

To create a mail account with the name JohnDoe on the domain example.com:

>mail.exe --create JohnDoe@example.com

or

>mail.exe -c JohnDoe@example.com

--update or -u

<mail name>@<domain name>

Updates mail account settings.

To set the size of the mailbox for JohnDoe@example.com:

>mail.exe --update JohnDoe@example.com -mbox_quota 20480K

or

>mail.exe -u JohnDoe@example.com -mbox_quota 20480K

--update-service

<domain_name>

Switches mail service on or off on a subscription.

Requires the -status option.

To enable mail service on the subscription example.com:

>mail.exe --update-service example.com -status enabled

--rename

<email>

Renames a mail account.

Required option -new.

To rename mail account JDoe@example.com to roy@example.com:

>mail.exe --rename JDoe@example.com -new roy

--remove or -r

<mail name>@<domain name>

Removes a specified mail account from a domain.

To remove the mail account with the name JohnDoe from example.com:

>mail.exe --remove JohnDoe@example.com

or

>mail.exe -r JohnDoe@example.com

--on

<domain name>

Enables mail service on a subscription.

To enable the mail service on the subscription example.com:

>mail.exe --on example.com

--off

<domain name>

Disables mail service on a subscription.

To disable the mail service on the subscription example.com:

>mail.exe --off example.com

--info or -i

<mail name>@<domain name>

Retrieves info about a specified mail account.

To retrieve info about the mail account JohnDoe@example.com:

>mail.exe --info JohnDoe@example.com

or

>mail.exe -i JohnDoe@example.com

--help or -h

 

Displays help on the use of the utility.

To see the help info on the use of the utility:

>mail.exe --help

or

>mail.exe -h

Options

Option

Parameter

Description

Example

-mailbox

true|false

Creates/Removes a mailbox.

Is false by default.

To create a mailbox for JohnDoe@example.com mail account:

>mail.exe --update JohnDoe@example.com -mailbox true

-passwd

<password>

Sets a password.

To set the 12345 password for JohnDoe@example.com mail account:

>mail.exe --update JohnDoe@example.com -passwd 12345

-mbox_quota

<number>[K|M|G]

Limits the size of the mailbox.

To restrict the size of the mailbox for JohnDoe@example.com mail account to 10240 KB:

>mail.exe --update JohnDoe@example.com -mbox_quota 10240K

-aliases

add|del:<name1[,name2]>

Adds/Deletes mail aliases.

To add JD, JohnD mail aliases to JohnDoe@example.com mail account:

>mail.exe --update JohnDoe@example.com -aliases add:JD,JohnD

-forwarding

true|false

Enables/Disables mail forwarding for a mail account.

Is false by default.

To enable mail forwarding from John_Doe@example.com to John_Doe@sample.com:

>mail.exe --update John_Doe@example.com -forwarding true -forwarding-addresses add:John_Doe@sample.com

 

-forwarding-addresses

add|del: <address 1>, <address 2>

Specifies e-mail addresses to which incoming mail should be forwarded.

It is required when enabling the -forwarding option for a mail account.

-status

enabled|disabled

Enables/Disables mail service on a subscription (the enabled or disabled parameters, respectively).

To enable mail service on the subscription example.com:

>mail.exe --update-service example.com -status enabled

-new

<string>

Specifies new mail account name.

Used with --rename only.

To rename mail account JDoe@example.com to rroy@example.com:

>mail.exe --rename JDoe@example.com -new rroy

-antivirus

off|inout|in|out

Sets an antivirus checkup of the mail traffic. One can disable this option, or enable this checkup for the incoming mail only, or for the outgoing mail only, or for both.

To enable the antivirus checkup for all mail messages sent to JohnDoe@example.com:

>mail.exe --update JohnDoe@example.com -antivirus in

 

Leave your comments on this page