/mail/lists/import
0.2.30Unchanged since publicationImport entries into a server-wide mail sender list
mailallChoose allow, block or nogreylist in kind and supply an entries array with 1 to 10,000 items, one entry per item. An invalid kind or an entries value that fails this requirement returns 400. UrbeStack replaces ASCII control characters with spaces, truncates each line to 400 characters and treats null and nonscalar items as blank lines. It skips blank lines and lines whose first non-whitespace character is #.
The selected list applies to every recipient domain. The allow and block lists accept email addresses such as someone@example.net, domains such as example.net and wildcard domains such as *.example.net. A wildcard matches subdomains at any depth. Both lists match envelope and header senders. UrbeStack rejects blocked senders during SMTP and skips spam scoring for allowed senders. Block entries take precedence. Allowing a major provider's entire domain lets forged senders from that domain bypass spam scoring. UrbeStack already trusts those providers when DKIM or DMARC verifies their mail.
The nogreylist list skips greylisting while keeping spam scoring active. A plain or wildcard domain entry matches when SPF passes for the envelope sender or a DKIM signature from the sender domain verifies. A sending IP address or CIDR network, such as 203.0.113.5, 203.0.113.0/24 or 2001:db8::/32, matches by sending IP address alone.
Entries already on the list and duplicates in the request count as already present. UrbeStack refuses invalid entries and entries that would exceed the list's 50,000-entry capacity individually. The 200 response returns kind and the total, added, already and refused counts. It includes the first 200 already present entries in already_entries and the first 200 refused lines with their reasons in refused_lines. Requires an administrator token with the mail scope.
As a command
Run as root on the serverentriesarray of stringRequiredkindstring, one of allow, block, nogreylistRequiredExample
See the API overview for how to set $API and $TOKEN.curl -sS -X POST "$API/mail/lists/import" \
-H "Authorization: Bearer $TOKEN" \
-H "Content-Type: application/json" \
-d '{
"entries": [
"text"
],
"kind": "allow"
}'200 OK{
"added": 1,
"already": 1,
"already_entries": [
"text"
],
"kind": "profile",
"refused": 1,
"refused_lines": [
{
"error": "Domain 'example.com' already exists",
"line": 1,
"text": "text"
}
],
"total": 1
}Errors
19 errors, each a status and a sentence400<what> must be text without control characters, 1 to <max> characters400At most 10000 lines at once; this one has 400At most <LIST_LINES_MAX> lines at once; this one has 400Domain name required400Domain name too long400Give --allow ENTRY, --block ENTRY or --nogreylist ENTRY, one of them400Give --domain DOMAIN or --server400Invalid IPv4 address400Invalid IPv6 address400Invalid domain name400Invalid port400Invalid setting key400List type must be allow, block, or nogreylist.400That list holds at most <max> entries400With --stdin, specify --kind allow, block, or nogreylist, and omit the entry argument.400entries must be a list of sender entries.401Authentication required404Setting '<key>' not found409<entry> is already on that <kind> listurbestack.com/docs/api/post-mail-lists-import/