Message Storage

Message storage defines how many messages can be stored before mail before messages are recycled. Messages that are sent to a Custom Domain, Private Email Addresses, or starred messages count towards message storage.

When are Messages Recycled?

Messages sent to non-private addresses and domains will be recycled at times to ensure capacity for new messages.

Messages sent to private domains, private addresses, and starred messages associated with Mailsac are recycled once the storage limit is reached.

Examples

  1. If your storage limit is 100 messages and you have starred 125 messages, the oldest 25 messages will be recycled.
  2. If your storage limit is 100 messages and you have 75 messages in your private domain. No messages will be recycled.
  3. If your storage limit is 100 messages and you have 150 messages in your private domain, the oldest 50 messages will be recycled.
  4. 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

Message storage can be purchased on a per-message basis in blocks listed on the pricing page.

Starred Messages

When you star a message, it counts towards your overall storage.

Use the star symbol ★

Your user Dashboard has links to all inboxes where you starred messages.

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

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.

../../_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

Examples require the Inbox to be a Private Address

../../_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
'''

Purge 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