Create or update AKMTA sender
Description
Creates or updates Altcraft message transfer agent instances.
caution
When the relay is enabled (enable_relay = "on" in akmta_obj.relay_options), selecting a Sending strategy is required in the web interface. In the API the strategy_id field is optional: without it the request is accepted, but until a strategy is selected, sending falls back to the default speed rules with a warning in the logs.
Request URLs
Method: POST
Create AKMTA sender:
https://example.com/api/v1.1/admin/senders/add
Update AKMTA sender:
https://example.com/api/v1.1/admin/senders/update
Use with "id":"%senderID%" property.
Request parameters
| Parameter | Type | Example | Required | Description |
|---|---|---|---|---|
| token | string | "abcdefghijklmnqrstuvwxyz" | Yes | API token |
| name | string | "AKMTA mail sender" | Yes | Sender name |
| type | string | "akmta" | Yes | Sender type |
| assigned_accounts | JSON array | [123, 456] | Yes | Accounts assigned to the sender |
| verified_domains | JSON array | ["mail.roo", "rambler.roo"] | Yes | Verified email damains |
| akmta_obj | JSON object | Yes | Sender options | |
| akmta_obj.relay_options.enable_relay | string | "on" | Yes | Enable SMTP relay. Values: "on", "off" |
| akmta_obj.relay_options.host | string | "relay.example.com" | Yes* | Relay network address. Required if enable_relay = "on" |
| akmta_obj.relay_options.port | int | 587 | Yes* | Relay port. Required if enable_relay = "on" |
| akmta_obj.relay_options.type | string | "login" | Yes* | Authentication method: noAuth, login, plain, cram-md5. Required if enable_relay = "on" |
| akmta_obj.relay_options.auth.user | string | "relayuser" | Yes* | Username. Required if type ≠ "noAuth" |
| akmta_obj.relay_options.auth.password | string | "relaypass" | No | Password. Not specified when type = "noAuth" |
| akmta_obj.relay_options.start_tls | bool | true | Yes* | Enable Start TLS. Required if enable_relay = "on" |
| akmta_obj.relay_options.strategy_id | int | 7 | No | Sending strategy ID. Required in the web interface when the relay is enabled; optional in the API |
| id | int | 16 | Required for update requests | Sender ID for update requests |
Request example
- JSON
- XML
{
"token": "abcdefghijklmnqrstuvwxyz",
"id": 3,
"name": "AK MTA mail sender",
"type": "akmta",
"channel_type": "email",
"verified_domains": [],
"akmta_obj": {
"dkim_id": 0,
"dkim_selector": "hello",
"ips": [
{
"ip": "192.168.111.111",
"node": 10
}
],
"lock_rules_obj": {
"common_rules": [],
"isp_rules": []
},
"relay_options": {
"enable_relay": "on",
"host": "relay.example.com",
"port": 587,
"type": "login",
"auth": {
"user": "relayuser",
"password": "relaypass"
},
"start_tls": true,
"strategy_id": 7
},
"redirect_email": "blackhole@altcraft.com",
"retry_rules_obj": {
"common_rules": [],
"isp_rules": []
},
"sender_dkim_id": 0,
"sender_dkim_selector": "altcraft",
"sending_rules_obj": {
"common_rules": [
{
"isps": [
0
],
"strategy": 2
}
],
"ip_rules": []
},
"users": [
{
"domain": "example.org",
"pop3_pass": "jkhdsbasdb",
"redirect_email": "redirect@example.org"
}
]
},
"assigned_accounts": [
306
]
}
<xml>
<token>abcdefghijklmnqrstuvwxyz</token>
<id>3</id>
<name>AK MTA mail sender</name>
<type>akmta</type>
<channel_type>email</channel_type>
<verified_domains/>
<akmta_obj>
<dkim_id>0</dkim_id>
<dkim_selector>hello</dkim_selector>
<ips>
<ip>192.168.111.111</ip>
<node>10</node>
</ips>
<lock_rules_obj>
<common_rules/>
<isp_rules/>
</lock_rules_obj>
<relay_options>
<enable_relay>on</enable_relay>
<host>relay.example.com</host>
<port>587</port>
<type>login</type>
<auth>
<user>relayuser</user>
<password>relaypass</password>
</auth>
<start_tls>true</start_tls>
<strategy_id>7</strategy_id>
</relay_options>
<redirect_email>blackhole@altcraft.com</redirect_email>
<retry_rules_obj>
<common_rules/>
<isp_rules/>
</retry_rules_obj>
<sender_dkim_id>0</sender_dkim_id>
<sender_dkim_selector>altcraft</sender_dkim_selector>
<sending_rules_obj>
<common_rules>
<isps>0</isps>
<strategy>2</strategy>
</common_rules>
<ip_rules/>
</sending_rules_obj>
<users>
<domain>example.org</domain>
<pop3_pass>jkhdsbasdb</pop3_pass>
<redirect_email>redirect@example.org</redirect_email>
</users>
</akmta_obj>
<assigned_accounts>306</assigned_accounts>
</xml>
Response example
- JSON
- XML
{
"data": {
"saved_id": 7
},
"error": 0,
"error_text": "Successful operation"
}
<xml>
<data>
<saved_id>7</saved_id>
</data>
<error>0</error>
<error_text>Successful operation</error_text>
</xml>
Response parameters
| Parameter | Type | Description |
|---|---|---|
| error | int | Error code |
| error_text | string | Error text |