Domain Spam (Rest API)

From Rackspace Email & Apps API
Jump to: navigation, search

v1 - Current

Spam Settings

Show Spam Setting

URL:

[GET] https://api.emailsrvr.com/v1/customers/(customer account number)/domains/(domain name)/spam/settings


Description:

This operation returns the spam settings associated with the domain.


Remarks:

The Show operation only supports the GET HTTP verb.


Example:

get '/customers/12345678/domains/example.com/spam/settings'


XML Result Example:

<?xml version="1.0" encoding="utf-8"?>
<domainSpamSettings xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xml:DomainSpamSettings">
  <filterLevel>on</filterLevel>
  <rsEmailSettings>
    <spamHandling>toAddress</spamHandling>
    <hasFolderCleaner>false</hasFolderCleaner>
    <spamFolderAgeLimit>0</spamFolderAgeLimit>
    <spamFolderNumLimit>0</spamFolderNumLimit>
    <spamForwardingAddress>someone@mail.com</spamForwardingAddress>
  </rsEmailSettings>
  <exchangeSettings>
    <forwardToDomainQuarantine>on</forwardToDomainQuarantine>
    <quarantineOwner>someone@mail.com</quarantineOwner>
    <defaultQuarantineOwner>someone@mail.com</defaultQuarantineOwner>
  </exchangeSettings>
</domainSpamSettings>


Json Result Example:

{"filterLevel":"on","rsEmailSettings":{"spamHandling":"toAddress","hasFolderCleaner":false,"spamFolderAgeLimit":0,"spamFolderNumLimit":0,"spamForwardingAddress":"someone@mail.com"},"exchangeSettings":{"forwardToDomainQuarantine":"on","quarantineOwner":"someone@mail.com","defaultQuarantineOwner":"someone@mail.com"}}

Edit Spam Setting

URL:

[PUT] https://api.emailsrvr.com/v1/customers/(customer account number)/domains/(domain name)/spam/settings


Description:

Edits the domain Spam Settings.


Field Name Data Type Description
filterLevel string Spam filter status, must be 'on' or 'off' or 'exclusive' (Required)
overrideUserSettings boolean Set this flag to "true" to override preferences for all users regardless of their own preferences. Otherwise, it sets preferences only for users who have not set their own.
rsEmail.spamHandling string Change settings for Rackspace Email Handling. For the options, see the table below.
rsEmail.hasFolderCleaner boolean Turns on/off Spam Folder Cleaner. Requires "rsEmail.spamHandling" to be set to "toFolder".
rsEmail.spamFolderAgeLimit int The number of days that email stays the "Spam" folder before being deleted. Requires "rsEmail.hasFolderCleaner" to be set to "true".
rsEmail.spamFolderNumLimit int The max number of emails that will be kept in the "Spam" folder. Requires "rsEmail.hasFolderCleaner" to be set to "true".
rsEmail.spamForwardingAddress string The address that spams will be forwarded to. Requires "rsEmail.spamHandling" to be set to "toAddress".
exchange.forwardToDomainQuarantine string Change settings for Exchange Handling. For the options, see the table below.
exchange.quarantineOwner string The address that domain quarantine notifications will be sent to.
exchange.removeQuarantineOwner boolean Set this flag to "true" to remove domain quarantine owner.
exchange.defaultQuarantineOwner string The address that quarantine notifications will be sent to. This applies to new users and users that have not changed their settings to override.
exchange.removeDefaultQuarantineOwner boolean Set this flag to "true" to remove default domain quarantine owner.


Rackspace Email Handling Options:

Value Description
toFolder Deliver to Spam folder
delete Delete the email immediately
labelSubject Include "[SPAM]" at the beginning of the subject line
toAddress Deliver to the email address that is specified by "rsEmail.spamForwardingAddress"


Exchange Handling Options:

Value Description
on Send all spam to domain quarantine
off Send spam to recipient's quarantine
nonuser Send non-user spam (Contacts, Resources, etc.) to domain quarantine


Example:

put '/customers/me/domains/example.com/spam/settings', 
{
  'filterLevel' => 'on',
  'rsEmail.spamHandling' => 'toFolder',
  'rsEmail.hasFolderCleaner' => 'true',
  'rsEmail.spamFolderAgeLimit' => '7',
  'rsEmail.spamFolderNumLimit' => '100',
}


Errors:

Description HTTP Response Code Sample Message
Invalid input for Filter Level 400 Invalid FilterLevel: high. Input must be: on/off/exclusive
Invalid input for RSEmail SpamHandling 400 Invalid RSEmail SpamHandling: nonuser. Input must be: toFolder/delete/labelSubject/toAddress
Invalid input for Exchange ForwardToDomainQuarantine 400 Invalid input for Exchange ForwardToDomainQuarantine: delete. Input must be: on/off/nonuser


Blacklist

Index Blacklist

URL:

[GET] https://api.emailsrvr.com/v1/customers/(customer account number)/domains/(domain name)/spam/blacklist


Description:

This operation returns the email address blacklist associated with the domain.


Remarks:

The Index operation only supports the GET HTTP verb.


Example:

get '/customers/12345678/domains/example.com/spam/blacklist'


XML Result Example:

<?xml version="1.0" encoding="utf-8"?>
<blacklist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xml:blacklist">
  <addresses>
    <address>name1@spam.com</address>
    <address>name2@spam.com</address>
  </addresses>
</blacklist>


Json Result Example:

{"addresses":["name1@spam.com","name2@spam.com"]}

Add Blacklist

URL:

[POST] https://api.emailsrvr.com/v1/customers/(customer account number)/domains/(domain name)/spam/blacklist/(email address)


Description:

Adds an email address or domain to the blacklist.


Example:

post '/customers/12345678/domains/example.com/spam/blacklist/anyone@spam.com'


Errors:

Description HTTP Response Code Sample Message
Entered invalid email or domain 400 invalid email address: abc
Entered current domain 400 Adding example.com would blacklist the current domain

Delete Blacklist

URL:

[DELETE] https://api.emailsrvr.com/v1/customers/(customer account number)/domains/(domain name)/spam/blacklist/(email address)


Description:

Removes an email address or domain from the blacklist.


Example:

delete '/customers/12345678/domains/example.com/spam/blacklist/anyone@yahoo.com'


Errors:

Description HTTP Response Code Sample Message
Entered invalid email or domain 400 invalid email address: abc
Entered email or domain is not on the current blacklist 400 abc@junkmail.com is not found on the list

Edit Blacklist

URL:

[PUT] https://api.emailsrvr.com/v1/customers/(customer account number)/domains/(domain name)/spam/blacklist


Description:

Edit email addresses on the blacklist.

Field Name Data Type Description
addList string Comma separated list of email addresses to add to the list
removeList string Comma separated list of email addresses to remove from the list

Note:

You can use a '%' as a wildcard in domains, but not in the TLD (.com, .net, etc). You cannot use wildcards in email addresses. For example, the following are allowed: @%.example.com, @examp%.com.

Example:

put '/customers/12345678/domains/example.com/spam/blacklist',
{
  'addList' => '@%.example.com,abc@example.com',
  'removeList' => '@examp%.com'
}

IP Blacklist

Index IP Blacklist

URL:

[GET] https://api.emailsrvr.com/v1/customers/(customer account number)/domains/(domain name)/spam/ipblacklist


Description:

This operation returns IP blacklist associated with the domain.


Remarks:

The Index operation only supports the GET HTTP verb.


Example:

get '/customers/12345678/domains/example.com/spam/ipblacklist'

XML Result Example':

<?xml version="1.0" encoding="utf-8"?>
<ipBlacklist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xml:ipBlacklist">
  <addresses>
    <ip>216.12.34.1</ip>
    <ip>216.12.34.2</ip>
  </addresses>
</ipBlacklist>


Json Result Example:

{"addresses":["216.12.34.1","216.12.34.2"]}

Add IP Blacklist

URL:

[POST] https://api.emailsrvr.com/v1/customers/(customer account number)/domains/(domain name)/spam/ipblacklist/(ip address)


Description:

Adds an IP to the blacklist.


Example:

post '/customers/12345678/domains/example.com/spam/blacklist/216.12.34.1'


Errors:

Description HTTP Response Code Sample Message
Entered invalid IP address 400 invalid ip address: 123

Delete IP Blacklist

URL:

[DELETE] https://api.emailsrvr.com/v1/customers/(customer account number)/domains/(domain name)/spam/ipblacklist/(ip address)


Description:

Removes an IP from the blacklist.


Example:

delete '/customers/12345678/domains/example.com/spam/ipblacklist/216.12.34.1'


Errors:

Description HTTP Response Code Sample Message
Entered invalid IP address 400 invalid ip address: 123
Entered IP is not on the current blacklist 400 216.12.34.1 is not found on the blacklist

Edit IP Blacklist

URL:

[PUT] https://api.emailsrvr.com/v1/customers/(customer account number)/domains/(domain name)/spam/ipblacklist


Description:

Edit IP addresses on the blacklist.

Field Name Data Type Description
addList string Comma separated list of IP addresses to add to the list
removeList string Comma separated list of IP addresses to remove from the list

Note:

You can use a '%' as a wildcard in the last octets to specify IP ranges. For example: 216.12.34.%, 216.12.%.%, 216.%.%.%.

Example:

put '/customers/12345678/domains/example.com/spam/ipblacklist',
{
  'addList' => '216.12.34.%,216.12.%.%',
  'removeList' => '216.%.%.%'
}

Safelist

Index Safelist

URL:

[GET] https://api.emailsrvr.com/v1/customers/(customer account number)/domains/(domain name)/spam/safelist


Description:

This operation returns email address safelist associated with the domain.


Remarks:

The Index operation only supports the GET HTTP verb.


Example:

get '/customers/12345678/domains/example.com/spam/safelist'


XML Result Example:

<?xml version="1.0" encoding="utf-8"?>
<safelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xml:safelist">
  <addresses>
    <address>name1@notspam.com</address>
    <address>name2@notspam.com</address>
  </addresses>
</safelist>


Json Result Example:

{"addresses":["name1@notspam.com","name2@notspam.com"]}

Add Safelist

URL:

[POST] https://api.emailsrvr.com/v1/customers/(customer account number)/domains/(domain name)/spam/safelist/(email address)


Description:

Adds an email address or domain to the safelist.


Example:

post '/customers/12345678/domains/example.com/spam/safelist/anyone@yahoo.com'


Errors:

Description HTTP Response Code Sample Message
Entered invalid email or domain 400 invalid email address: abc


Delete Safelist

URL:

[DELETE] https://api.emailsrvr.com/v1/customers/(customer account number)/domains/(domain name)/spam/safelist/(email address)


Description:

Removes an email address or domain from the safelist.


Example:

delete '/customers/12345678/domains/example.com/spam/safelist/anyone@yahoo.com'


Errors:

Description HTTP Response Code Sample Message
Entered invalid email or domain 400 invalid email address: abc
Entered email or domain is not on the current safelist 400 anyone@yahoo.com is not found on the list

Edit Safelist

URL:

[PUT] https://api.emailsrvr.com/v1/customers/(customer account number)/domains/(domain name)/spam/safelist


Description:

Edit email addresses on the safelist.

Field Name Data Type Description
addList string Comma separated list of email addresses to add to the list
removeList string Comma separated list of email addresses to remove from the list

Note:

You can use a '%' as a wildcard in domains, but not in the TLD (.com, .net, etc). You cannot use wildcards in email addresses. For example, the following are allowed: @%.example.com, @examp%.com.

Example:

put '/customers/12345678/domains/example.com/spam/safelist',
{
  'addList' => '@%.example.com,abc@example.com',
  'removeList' => '@examp%.com'
}


IP Safelist

Index IP Safelist

URL:

[GET] https://api.emailsrvr.com/v1/customers/(customer account number)/domains/(domain name)/spam/ipsafelist


Description:

This operation returns IP safelist associated with the domain.


Remarks:

The Index operation only supports the GET HTTP verb.


Example:

get '/customers/12345678/domains/example.com/spam/ipsafelist'


XML Result Example:

<?xml version="1.0" encoding="utf-8"?>
<ipSafelist xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="urn:xml:ipSafelist">
  <addresses>
    <ip>192.168.0.1</ip>
    <ip>192.168.0.2</ip>
  </addresses>
</ipSafelist>


Json Result Example:

{"addresses":["192.168.0.1","192.168.0.2"]}

Add IP Safelist

URL:

[POST] https://api.emailsrvr.com/v1/customers/(customer account number)/domains/(domain name)/spam/ipsafelist/(ip address)


Description:

Adds an IP to the safelist.


Example:

post '/customers/12345678/domains/example.com/spam/safelist/216.12.34.1'


Errors:

Description HTTP Response Code Sample Message
Entered invalid IP address 400 invalid ip address: 123

Delete IP Safelist

URL:

[DELETE] https://api.emailsrvr.com/v1/customers/(customer account number)/domains/(domain name)/spam/ipsafelist/(email address)


Description:

Removes an IP from the safelist.


Example:

delete '/customers/12345678/domains/example.com/spam/ipsafelist/216.12.34.1'


Errors:

Description HTTP Response Code Sample Message
Entered invalid IP address 400 invalid ip address: 123
Entered IP is not on the current safelist 400 216.12.34.1 is not found on the list

Edit IP Safelist

URL:

[PUT] https://api.emailsrvr.com/v1/customers/(customer account number)/domains/(domain name)/spam/ipsafelist


Description:

Edit IP addresses on the safelist.

Field Name Data Type Description
addList string Comma separated list of IP addresses to add to the list
removeList string Comma separated list of IP addresses to remove from the list

Note:

You can use a '%' as a wildcard in the last octets to specify IP ranges. For example: 216.12.34.%, 216.12.%.%, 216.%.%.%.

Example:

put '/customers/12345678/domains/example.com/spam/ipsafelist',
{
  'addList' => '216.12.34.%,216.12.%.%',
  'removeList' => '216.%.%.%'
}