pem.cqmail.addMailbox

This method is supported by Operations starting from version 2.4.

This method adds a Mailbox to a Mailname. There are the following use cases:

  • Create a new Mailname and add a Mailbox to it. In this case Operations creates a Mailname and adds a Mailbox to it.

    Notes:

    1. A Mailname password is required to create a Mailname, thus the password and password_crypted parameters are mandatory.

    2. Use the pem.cqmail.editMailname method to change the password of an existing Mailname.

  • Add a Mailbox to an existing Mailname. In this case Operations adds a Mailbox to an existing Mailname.

    Notes:

    1. The password of an existing Mailname is used to create a Mailbox, thus the password and password_crypted parameters are optional. These parameters are ignored, if they are specified.

    2. Use the pem.cqmail.editMailname method to change the password of an existing Mailname.

Additionally, if a new Mailname is created, Operations creates a Service User with the following properties:

  • Display Name – Local part (e-mail address before the @ sign) of a Mailname is assigned.
  • Login – Mailname is assigned. If an "All-Domains" Mailname is created, Operations generates the Service User Login in the <Local part of mailname>@sub<Subscription ID>.local form.
  • Password – Mailname password is assigned.

The E-mail Service is assigned to the Service User.

The method has the following input parameters:

Name

Type

Short Description

subscription_id

int

ID of a Subscription containing the E-mail service. The following use-cases are available:

  • The Subscription contains services in the subscription-local mode. The new Mailname and Service User are created. You must specify the identifier of the Subscription. The subscription-local E-Mail service from the Subscription will be used to create the Mailname, Service User, and Mailbox. The Service User will be bound to the Subscription.
  • The Subscription contains services in the account-wide mode. The new Mailname and Service User are created. You must specify the identifier of the Subscription. The account-wide E-Mail service from the Subscription will be used to create the Mailname, Service User, and Mailbox.
  • The Subscription contains services in the subscription-local mode. The existing Mailname and Service User are used to add the Mailbox. The Service User has been bound to the Subscription. You must specify the identifier of the Subscription. The subscription-local E-Mail service from the Subscription will be used to create the Mailbox for the Mailname and Service User.
  • The Subscription contains services in the subscription-local mode. The existing Mailname and Service User are used to create the Mailbox. The Service User has not been bound to any Subscription. The Service User does not have any services assigned. You must specify the identifier of the Subscription. The subscription-local E-Mail service from the Subscription will be used to create the Mailbox for the Mailname and Service User. The Service User will be bound to the Subscription.
  • The Subscription contains services in the account-wide mode. The existing Mailname and Service User are used to add the Mailbox. The Service User has not been bound to any Subscription. The Service User does not have any services assigned. You must specify the identifier of the Subscription. The account-wide E-Mail service from the Subscription will be used to create the Mailbox for the Mailname and Service User.
  • The Subscription contains services in the account-wide mode. The existing Mailname and Service User are used to add the Mailbox. The Service User has not been bound to any Subscription. The Service User has services from Subscriptions with services in the account-wide mode. You must specify the identifier of the Subscription. The account-wide E-Mail service from the Subscription will be used to create the Mailbox for the Mailname and Service User.

name

string

Local part (e-mail address before the @ sign).

[domain_name]

string

Name of the Domain to create a Mailname for. There are the following use cases:

  • This parameter is omitted. In this case Operations creates an "All-Domains" Mailname. For example: name@<all-domains>.
  • This parameter is specified. In this case Operations creates a Mailname for Domain specified. For example: name@domain.com.

If the domain_name parameter is specified, method checks that the following requirements are satisfied:

  • CQMail hosting is added to Domain.
  • CQMail hosting corresponds to Subscription specified.

Method returns error, if one of requirements is not satisfied.

[password]

string

Mailname password.

[password_crypted]

boolean

Whether the password is passed in the encrypted form (BSD MD5). There are the following possible values:

  • 0 – password is passed in the plain text form.
  • 1 – password is passed in the encrypted form.

quota

int

Mailbox quota (in Kilobytes). There are the following options:

  • If this parameter is 0, the Maximum quota for a mailbox in Kb Activation Parameter's value is used to set the Mailbox quota.
  • If the value of the quota parameter does not exceed the value of the Maximum quota for a mailbox in Kb Activation Parameter, the value of quota parameter is used to set the Mailbox quota.
  • If the value of the quota parameter exceeds the value of the Maximum quota for a mailbox in Kb Activation Parameter, an error is returned.

[mail_to_notify]

string

E-mail address to send notification messages when the Mailbox is created.

[antispam]

boolean

Defines whether mail sent to this Mailbox is filtered through SPAM protection system. There are the following options:

  • 0 – Filtering through a SPAM protection system is disabled. This is a default value.
  • 1 – Filtering through a SPAM protection system is enabled.

[antivirus]

struct

Defines whether mail of this Mailbox is filtered through an AntiVirus protection system.

  • check_in

boolean

Whether to check incoming mail. There are the following options:

  • 0 – Filtering of incoming mail through an AntiVirus protection system is disabled. This is a default value.
  • 1 – Filtering of incoming mail through an AntiVirus protection system is enabled.
  • check_out

boolean

Whether to check outgoing mail. There are the following options:

  • 0 – Filtering of outgoing mail through an AntiVirus protection system is disabled. This is a default value.
  • 1 – Filtering of outgoing mail through an AntiVirus protection system is enabled.
  • notify_sender

boolean

Whether a notification message is sent to the sender if a virus is found. There are the following options:

  • 0 – Sending of notification messages to the sender is disabled. This is the default value.
  • 1 – Sending of notification messages to the sender is enabled.
  • notify_recepients

boolean

Whether a notification is sent to the recipient(s) if a virus is found. There are the following options:

  • 0 – Sending of a notification message to the recipient(s) is disabled. This is a default value.
  • 1 – Sending of a notification message to the recipient(s) is enabled.

The method has no output parameters.

Note: Starting from Operations 2.6.4 this method can also be called under Reseller permissions.