Message Storage

Message storage defines how many messages can be stored before the oldest messages are recycled. Messages in Custom Domains, Private Email Addresses, and starred messages count towards message storage.

When are Messages Recycled?

The oldest messages in a Custom Domain and Private Address are recycled once the storage limit is reached.

Messages sent to non-private addresses and unverified domains are kept for a maximum of 4 days, though messages may be recycled earlier to ensure capacity for customers on a paid subscription. There is a limit of 6 messages per inbox.

Examples

  • If your storage limit is 100 messages and you have starred 125 messages, the oldest 25 messages will be recycled.
  • If your storage limit is 100 messages and you have 75 messages in your private domain. No messages will be recycled.
  • If your storage limit is 100 messages and you have 150 messages in your private domain, the oldest 50 messages will be recycled.
  • If your storage limit is 100 messages and you have 50 messages in 3 private inboxes (total 150 messages), the oldest 50 messages will be recycled.

Getting More Storage

Additional message storage can be purchased in the quantities listed on the pricing page.

Starred (saved) Messages

Starred messages in a mailsac.com inbox (ie example@mailsac.com) are not visible to other customers. Starred messages count towards your overall storage, but will not be recycled when your storage limit is reached.

You can star messages on any address, including those you own or other public addresses.

When viewing an inbox on the website, messages can be starred by selecting the star symbol next to the message.

../../_images/star_a_message.png

Messages can be starred using Star Message Endpoint using the REST API.

Managing Storage

Most customers will never need to manage message storage, since emails are automatically recycled.

Messages can proactively be deleted:

  • Per message
  • Per private inbox
  • Per private domain

Delete a Message

REST API examples require the messageId parameter. messageId can be found using the List Inbox Email Messages Endpoint, a WebSocket Frame, and Webhook POST.

Additional code examples are available in the REST API Documentation.

../../_images/delete_message_website.gif

Delete message using the Mailsac Website

../../_images/delete_message_unified_inbox.gif

Delete using the Unified Inbox (requires Private Address)

Delete using curl (requires messageId)
curl -s -H "Mailsac-Key: YOUR_API_KEY_HERE" \
    -X DELETE https://mailsac.com/api/addresses/bclinton@mailsac.com/messages/fkwhpdnzsQ81MdllcqfqCd3jQq-0 
# curl output
{"message":"Message was deleted.","_id":"fkwhpdnzsQ81MdllcqfqCd3jQq-0","inbox":"bclinton@mailsac.com"}
Delete message using Node.js. requires npm install superagent
const superagent = require('superagent')
const mailsac_api_key = 'YOUR_API_KEY_HERE'
const messageId = 'YOUR_MESSAGE_ID'

superagent
  .delete('https://mailsac.com/api/addresses/bclinton@mailsac.com/messages/' + messageId)
  .set('Mailsac-Key', mailsac_api_key)
  .then((data) => {
      console.log(data.body)
  })
  .catch(err => {
      console.error(err.message);
  })

/*
{
    message: 'Message was deleted.',
    _id: 'sepjrPlPJsJEm6F8_cHeuCAcs-0',
    inbox: 'bclinton@mailsac.com'
}
*/
Read message using Python
import requests
from pprint import pprint

message_id = 'YOUR_MESSAGE_ID'
headers = {'Mailsac-Key': 'YOUR_API_KEY_HERE'}
url = 'https://mailsac.com/api/addresses/bclinton@mailsac.com/messages/' + message_id
r = requests.delete(url, headers=headers)
pprint(r.json())

'''
{'_id': '4xnxBtJpZxLQTU2MvcIPD65cdWQC-0',
 'inbox': 'bclinton@mailsac.com',
 'message': 'Message was deleted.'}
'''

Purge Inbox

The Purge Inbox features requires the Inbox to be a Private Address.

Additional code examples are available in the REST API Documentation.

../../_images/purge_inbox_website.gif

Purge inbox using the Mailsac Website

Purge inbox using curl (requires messageId)
curl -s -H "Mailsac-Key: YOUR_API_KEY_HERE" \
    -X DELETE https://mailsac.com/api/addresses/bclinton@mailsac.com/messages

# Return Code 204 No Content
Purge inbox using Node.js. requires npm install superagent
const superagent = require('superagent')
const mailsac_api_key = 'YOUR_API_KEY_HERE'

superagent
  .delete('https://mailsac.com/api/addresses/bclinton@mailsac.com/messages/')
  .set('Mailsac-Key', mailsac_api_key)
  .then((res) => {
      console.log(res.status)
  })
  .catch(err => {
      console.error(err.message);
  })

/*
204
*/
Purge inbox using Python
import requests

headers = {'Mailsac-Key': 'YOUR_API_KEY_HERE'}
url = 'https://mailsac.com/api/addresses/bclinton@mailsac.com/messages'
r = requests.delete(url, headers=headers)
print(r.status_code)

'''
204
'''

Delete All Messages in a Domain

All messages in a verified domain can be deleted.

From the Dashboard, select Custom Domains, select manage next to the domain, click on the advanced tab, and click on the button “Irreversibly Delete Emails”.

../../_images/purge_domain_website.png

Use the route api/domains/{domain}/delete-all-domain-mail to delete all messages in a verified domain using the REST API