add_mailaccount()
Create a mail account.
Signature
add_mailaccount(array $parameters): mixedParameters
Pass these parameters as KasRequestParams. Every request also requires kas_login, kas_auth_type, and kas_auth_data, as shown in SOAP with PHP.
| Name | Description | Requirement |
|---|---|---|
mail_password |
The mailbox password | Required |
webmail_autologin |
Automatic login from the KAS to webmail: Y|N |
Optional
Default: Y
|
local_part |
The local part, RFC 2822 | Required |
domain_part |
FQDN, RFC 2822 | Required |
responder |
Autoresponder: N|Y or start|end, with start and end as timestamps separated by "|" |
Optional
Default: N
|
mail_responder_frequency |
Block interval per identical sender in days (0 to 4294967295); 0 answers every email |
Optional
Default: 0
|
mail_responder_content_type |
The content type of the autoresponder text: html|text |
Optional
Default: text
|
mail_responder_displayname |
The sender display name of the autoresponder, e.g. "John Doe autoresponder" |
Optional
Default: empty
|
responder_text |
The autoresponder text |
Optional
Default: empty
|
copy_adress |
The copy recipient addresses, RFC 2822; separate multiple addresses with commas |
Optional
Default: empty
|
mail_sender_alias |
Allowed alias addresses that can be used as the FROM address |
Optional
Default: empty
|
mail_xlist_enabled |
XLIST is active: Y|N |
Optional
Default: Y
|
mail_xlist_sent |
XLIST name of the sent items folder |
Optional
Default: Sent
|
mail_xlist_drafts |
XLIST name of the drafts folder |
Optional
Default: Drafts
|
mail_xlist_trash |
XLIST name of the trash folder |
Optional
Default: Trash
|
mail_xlist_spam |
XLIST name of the spam folder |
Optional
Default: Spam
|
mail_xlist_archiv |
XLIST name of the archive folder |
Optional
Default: Archiv
|
mail_allow_nets |
Allow access only for specific clients (optional, e.g. 1.2.3.4, 12.34.0.0/16, webmail) | Optional |
PHP example
<?php
// $sessionToken is returned by KasAuth, see SOAP with PHP.
$parameters = [
'mail_password' => 'mail_password',
'local_part' => 'contact',
'domain_part' => 'example.com',
'responder' => '1230764400|1259622000',
'responder_text' => 'I am away until 01.12.2013.',
'copy_adress' => 'copy@example.com',
'mail_sender_alias' => 'alias@example.org',
];
try {
$client = new SoapClient('https://kasapi.kasserver.com/soap/wsdl/KasApi.wsdl');
$response = $client->KasApi(json_encode([
'kas_login' => 'w0123456',
'kas_auth_type' => 'session',
'kas_auth_data' => $sessionToken,
'kas_action' => 'add_mailaccount',
'KasRequestParams' => $parameters,
]));
print_r($response);
} catch (SoapFault $fault) {
echo 'Error: ' . $fault->faultstring;
}
Responses and error codes
-
TRUEthe action was carried out -
missing_parametera required parameter is missing -
copy_adress_like_mailaccount -
copy_adress_syntax_incorrect -
couldnt_get_kas_ressources -
email_already_exists -
email_domain_doesnt_exist -
email_syntax_incorrect -
mail_loop_detected -
max_emails_reached -
max_sender_alias_reached -
password_syntax_incorrect -
responder_contentype_syntax_incorrect -
responder_displayname_syntax_incorrect -
responder_not_allowed_for_catchall_adresses -
responder_frequency_syntax_incorrect -
responder_startdate_gt_enddate -
responder_syntax_incorrect -
responder_text_is_empty -
sender_alias_domain_in_kas -
sender_alias_syntax_incorrect -
mail_xlist_enabled_syntax_incorrect -
mail_xlist_sent_syntax_incorrect -
mail_xlist_drafts_syntax_incorrect -
mail_xlist_trash_syntax_incorrect -
mail_xlist_spam_syntax_incorrect -
mail_xlist_archiv_syntax_incorrect -
mail_xlist_duplicate_folder -
webmail_autologin_syntax_incorrect