Hexamail API Documentation

JSON REST API for email services

Accounts

Manage accounts

List account(s)

GET
accounts

Parameters

name type description allowed default
status string Status of user activeonly,disabled activeonly
email string Email address of user

Response

[
    {
        "id": "Administrator",
        "username": "Administrator",
        "nb_messages": "44",
        "email_addresses": "admin@hexamail.com",
        "last_login": "0",
        "ip": "0.0.0.0",
        "quota": "0",
        "display": "",
        "active": "true",
        "licensed": "true",
        "forward": "false",
        "forward_deliver": "false",
        "spam_review": "false",
        "spam": "0",
        "spam_date": "0"
    },
    {
        "id": "testuser",
        "username": "testuser",
        "nb_messages": "8",
        "email_addresses": "test@hexamail.com",
        "last_login": "1390826421",
        "ip": "127.0.0.1",
        "quota": "0",
        "display": "Test User",
        "active": "true",
        "licensed": "true",
        "forward": "false",
        "forward_deliver": "false",
        "spam_review": "true",
        "spam": "0",
        "spam_date": "0"
    }
]				
			

Get account

GET
accounts
/

Response

{
    "id": "test",
    "username": "test",
    "nb_messages": "8",
    "email_addresses": "test@hexamail.com",
    "last_login": "1390826421",
    "ip": "127.0.0.1",
    "quota": "0",
    "display": "Test User",
    "active": "true",
    "licensed": "true",
    "forward": "false",
    "forward_deliver": "false",
    "spam_review": "true",
    "spam": "0",
    "spam_date": "0"
}				
			

Delete an account

DELETE
accounts
/

Response

HTTP 200 OK
			

Modify an account

POST/PUT
accounts
/

Parameters

name type description allowed default
email string Email address of user
active boolean Active or deleted
licensed boolean Licensed or unlicensed
first_name string First name of user
last_name string Last name of user
display string Full name or Display name of user

Response

HTTP 200 OK				
			

Add an account

POST/PUT
accounts

Parameters

name type description allowed default
userid string Add a user with this ID if not already existing
password string Initial password for user
email string Email address of user
active boolean Active or deleted
licensed boolean Licensed or unlicensed
first_name string First name of user
last_name string Last name of user
display string Full name or Display name of user

Response

HTTP 200 OK					
			

Email Delivery

Email sending and delivery

Send an email via SMTP or deliver locally

POST
deliver

Parameters

name type description allowed default
process boolean Process email through modules before sending/delivering true,false false
trusted boolean Trust this email and do not spam block true,false false
sender string Email address of sender
recip list Email addresses of recipients as a comma separated list
message string The full MIME content of the message
<posted file> <posted file>string MIME content of email to send as a posted file
subject string The subject of the message
from string The displayed MIME From field of the message
text string The text content of the message
html string The html content of the message
to string The displayed MIME To field of the message
cc string The displayed MIME CC field of the message
bcc string The blind copy recipients of the message

Response

          {
          uid:"uidofemail"
          }
        

Developer

Get list of hooks

hooks

Response

[
    {
        "uid": "5329AC1918CA",
        "When": "Process",
        "URL": "http://myappserver.domain.com/mywebapp.php",
        "Name": "Trigger web app",
        "Rule0Content": "",
        "Rule0Subject": "",
        "Rule0From": "*@google.com",
        "Rule0To": "*@hexamail.com",
        "Rule0Enable": "1",
        "Rule0SizeMax": "0",
        "Rule0SizeMin": "0",
        "Rule0DateSource": "Headers",
        "Rule0DateEnd": "1/1/1970",
        "Rule0DateStart": "1/1/1970",
        "Rule0TimeEnd": "12:00",
        "Rule0TimeStart": "12:00",
        "Rule0Days": "Sunday+Monday+Tuesday+Wednesday+Thursday+Friday+Saturday+",
        "Rule0Name": "From Google To Hexamail",
        "OutFile": "C:\\hexamailserver\\logs\\webdev.txt"
    },
	...
]
				

Get a hook

hooks
/
uid

Response

    {
        "uid": "5329AC1918CA",
        "When": "Process",
        "URL": "http://myappserver.domain.com/mywebapp.php",
        "Name": "Trigger web app",
        "Rule0Content": "",
        "Rule0Subject": "",
        "Rule0From": "*@google.com",
        "Rule0To": "*@hexamail.com",
        "Rule0Enable": "1",
        "Rule0SizeMax": "0",
        "Rule0SizeMin": "0",
        "Rule0DateSource": "Headers",
        "Rule0DateEnd": "1/1/1970",
        "Rule0DateStart": "1/1/1970",
        "Rule0TimeEnd": "12:00",
        "Rule0TimeStart": "12:00",
        "Rule0Days": "Sunday+Monday+Tuesday+Wednesday+Thursday+Friday+Saturday+",
        "Rule0Name": "From Google To Hexamail",
        "OutFile": "C:\\hexamailserver\\logs\\webdev.txt"
    }
	

Delete a hook

hooks
/
uid

Response

1
				

Add/Set a hook

hooks
/
uid
Add a new hook (no UID specified) or set the parameters of an existing hook

Parameters

name type description allowed default
Action string For existing hooks merge will set only the parameters specified, replace will replace the entire hook with the hook supplied merge,replace merge
Name string A name for the hook
Verb string HTTP Verb to use GET,POST,PUT,PATCH,DELETE POST
Template string
URL string URL to trigger
AuthUser string Login username
AuthPass string Login password
AuthType string Login type None,WWWBASIC,WWWDIGEST
DateFormat string
Headers string
When string When to trigger the hook. Process triggers during email processing Off,Process Process
OutFile string File to output the hook request to for debugging
Rule[0...N]Name text A name for the rule
Rule[0...N]Enable bool Enable the rule true
Rule[0...N]From text emails from any of these addresses will be routed. Leave blank to match for all emails (equivalent to *)
Rule[0...N]To text emails to these email addresses will be rerouted
Rule[0...N]Subject text
Rule[0...N]Content text
Rule[0...N]IP text emails from any of these IP addresses will be routed. Leave blank to match for all emails (equivalent to *)
Rule[0...N]Attach text emails with these attachment types will be routed. Use * to mean any attachment, leave blank not match on attachments, or specify attachment types like *.pdf
Rule[0...N]Header text emails with these header lines will be routed.
Rule[0...N]Days flag only emails sent on a day that match the selected days will be routed Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday Sunday+Monday+Tuesday+Wednesday+Thursday+Friday+Saturday
Rule[0...N]TimeStart text only emails sent between the start and end times will be routed
Rule[0...N]TimeEnd text only emails sent between the start and end times will be routed
Rule[0...N]DateStart text only emails sent between the start and end dates will be routed
Rule[0...N]DateEnd text only emails sent between the start and end dates will be routed
Rule[0...N]SizeMin text only emails sent between the min and max sizes will be routed 0
Rule[0...N]SizeMax text only emails sent between the min and max sizes will be routed 0
Rule[0...N]DateSource text get the date from the email MIME headers or the email arrival time Headers,Arrival Headers
Rule[0...N]Enable bool on

Response

1
				

Archiver

Email Archive access

Query the archive for email

GET
archive

Parameters

name type description allowed default
limit integer Maximum to retrieve
offset integer Starting offset of the first email to retrieve
subject string Subject search string
content string Content search string
rcpt string Recipient search string
sender string Sender search string
sizemin integer Minimum size of email KBytes
sizemax integer Maximum size of email KBytes
datemin integer Minimum date of email seconds since EPOCH
datemax integer Maximum date of email seconds since EPOCH
sort string Results attribute to sort by date,-date,size,-size,subject,-subject,sender,-sender,rcpt,-rcpt

Response

{
    "start": "0",
    "number": "5",
    "total": "5",
    "data": [
        {
            "ref": "0_3",
            "size": "27066",
            "date": "1351063075",
            "time": "1351063075",
            "datestr": "Wed, 24 Oct 2012 07:17:55 GMT",
            "subject": "FW: commande d'un container",
            "from": "chantal@france.com",
            "rcpt": "rcpt1@hexamail.com",
            "sndr": "chantal@france.com"
        },
        {
            "ref": "0_3287",
            "size": "25198",
            "date": "1351072018",
            "time": "1351072018",
            "datestr": "Wed, 24 Oct 2012 09:46:58 GMT",
            "subject": "RE: commande d'un container surg",
            "from": "test@hexamail.com",
            "rcpt": "rcpt1@hexamail.com",
            "sndr": "test@hexamail.com"
        },
        {
            "ref": "0_11693",
            "size": "3426",
            "date": "1322482107",
            "time": "1322482107",
            "datestr": "Mon, 28 Nov 2011 12:08:27 GMT",
            "subject": "FW: commande de chambre froide 645",
            "from": "maurice@france.com",
            "rcpt": "rcpt1@hexamail.com",
            "sndr": "maurice@france.com"
        },
        ...
		]
}					
				

Retrieve an email from the archive

GET
archive
/
ref

Parameters

name type description allowed default
include_body string Include the email content in the retrieved results MIME,text,html

Response

{
	"sbj":"RE: commande d'un container surgele",
	"to":
		[
			{"email":"kevin@france.com","name":"kevin@france.com"}
		],
	"cc":
		[
			{"email":"Luc@france.com","name":"Luc@france.com"}
		],
	"message_id":"",
	"date":"Wed, 24 Oct 2012 09:46:58",
	"body":"Content-Type: multipart/mixed;\r\n
	...
	"
}
				

Stores

Manage email stores

List of stores

GET
store

Response

[
    "error",
    "sent",
    "spam",
    "undeliverable"
]					
				

GET
store
/

Response

{
    "total": "21",
    "time": "0",
    "ready": "true",
    "array": [
        {
            "del": "0",
            "store": "error",
            "uid": "1@#MDAgXzVFOEEwNTg5MzMzQ0FBNDVCODE3MEFEMzczMTMxRDAwNzE5QTI2QkE3OV9CQ1RF__Mks3Q01TMDFfYmN0aDAxMzgwMTc1MzI4___copy_5243cde85a03",
            "date": "1380127135",
            "size": "119839",
            "rcpt": "test@test.com",
            "from": {
                "value": "tom@hexamail.com",
                "data": "Tom Gents"
            },
            "sndr": {
                "value": "tom@hexamail.com",
                "data": "tom@hexamail.com"
            },
            "subj": "RE: Curious one...",
            "remoteuid": "",
            "error": "Error: delivery failed\r\n  \ttest@test.com - Failed (comms): Communicating with server 84.38.159.242:25 (The connection has been dropped because of a network failure or because the peer system failed to respond.)",
            "action": "",
            "reason": "",
            "data": "",
            "ipcode": "",
            "match": "",
            "ip": ""
        },
        {
            "del": "0",
            "store": "error",
            "uid": "1@#MDAgXzQ3OTQ5NDFfMTM3OTg5ODgzNzk5OV9KYXZhTWFpbF9hcHBzX29sdWFwcDA5MTEz__ODAxNzU0NDI____copy_5243ce561f62",
            "date": "1379898637",
            "size": "2421",			
			...
		},
		...
	]
}

GET
store
/

Parameters

name type description allowed default
uid string UID of email to retrieve

Response

        {
        "total": "1",
        "time": "0",
        "ready": "true",
        "array": [
        {
        "del": "0",
        "store": "error",
        "uid": "1@#MDAgXzVFOEEwNTg5MzMzQ0FBNDVCODE3MEFEMzczMTMxRDAwNzE5QTI2QkE3OV9CQ1RF__Mks3Q01TMDFfYmN0aDAxMzgwMTc1MzI4___copy_5243cde85a03",
        "date": "1380127135",
        "size": "119839",
        "rcpt": "test@test.com",
        "from": {
        "value": "tom@hexamail.com",
        "data": "Tom Gents"
        },
        "sndr": {
        "value": "tom@hexamail.com",
        "data": "tom@hexamail.com"
        },
        "subj": "RE: Curious one...",
        "remoteuid": "",
        "error": "Error: delivery failed\r\n  \ttest@test.com - Failed (comms): Communicating with server 84.38.159.242:25 (The connection has been dropped because of a network failure or because the peer system failed to respond.)",
        "action": "",
        "reason": "",
        "data": "",
        "ipcode": "",
        "match": "",
        "ip": ""
        }
        ]
        }
      

DELETE
store
/

Parameters

name type description allowed default
uid string UID of email to delete
action string Whether to delete, undelete or remove delete,undelete,remove

Response

       HTTP 200 OK
      

Configuration

Get the entire configuration

GET
config

Parameters

name type description allowed default
commit string Commit action apply,cancel

Response

[
    {
        "section": "Default",
        "params": {
            "AdminVersion": "5.0.0.001",
            "LogLevel": "Debug",
            "LogFlushPeriod": "0",
            "LogFlushSize": "0",
            "LogMaxSize": "5000",
            "LogTypes": "Error,Message,Config,Service,Licence",
            "ServiceVersion": "5.0.0.001",
            "ConfigUpdated": "Mon, 27 Jan 2014 16:37:56",
            "Enable": "1",
            "LogHistory": "8",
            "ConfigUpdatedIP": "127.0.0.1",
            "ConfigUpdatedApp": "Admin",
        }
    },
    {
        "section": "Server",
        "params": {
            "MaxConnections": "164",
            "GreetWithCompanyName": "TRUE",
            "AutoCompleteAddresses": "FALSE",
            "Enable": "on",
            "Domains": "hexamail.com,hexamail.net",
            "PrimaryDomain": "hexamail.com",
            "AllowAuthentication": "TRUE",
            "UserRestrictSend": "FALSE",
            "DomainRestrictSend": "FALSE",	
			...
	},
	...
]
				

Get a section of the configuration

GET
config
/

Parameters

name type description allowed default
commit string Commit action apply,cancel

Response

{
    "section": "Server",
    "params": {
        "MaxConnections": "164",
        "GreetWithCompanyName": "TRUE",
        "AutoCompleteAddresses": "FALSE",
        "Enable": "on",
		"Domains": "hexamail.com,hexamail.net",
        "PrimaryDomain": "hexamail.com",
        "AllowAuthentication": "TRUE",
        "UserRestrictSend": "FALSE",
        "DomainRestrictSend": "FALSE",
        "RelayIPRestrictDomainSend": "TRUE",
        "RelayIPRestrictInternal": "TRUE",
        "DisallowRelayIPList": "*.*.*.*",
        "PreventAddressProbing": "Off",
        "UserRestrictRecipient": "TRUE",
        "AutoAllowOutBoundRecipients": "TRUE",
        "MaxEmailLinesCheck": "FALSE",
        "MaxEmailSize": "96000",
        "SSLPortEnable": "FALSE",
        "PortEnable": "TRUE",
        "DomainKeyDebug": "1",
        "DomainKeyEnable": "1",
        "DomainKeyRequiredDomains": "btinternet.com,e-mail.egg.com,gmail.com,yahoo.co.uk,yahoo.com",
        "SPFEnable": "1",
        "SPFDebug": "1",
        "OpenRelayDataBaseServers": "",
        "AllowedIPList": "",
        "MaxRecipients": "100",
        "GreetWithProductVersion": "TRUE",
        "AuthRestrict": "FALSE",
        "LogSMTP": "TRUE",
        "IP Source": "FALSE",
        "RHSBL": "",
        "DNSWhitelistServers": "",
        "SPFMIMEFrom": "0",
        "DNSBLAction": "Block",
        "DNSLAllow": "dnswl.hexamail.com",
        "DNSLWeight": "",
        "DNSLMark": "",
        "DNSLBlock": "dnsbl.hexamail.com",
        "DNSLReject": "",
        "RHSAllow": "",
        "RHSWeight": "",
        "RHSMark": "",
        "RHSBlock": "OFF(rhsbl.hexamail.com)",
        "RHSReject": "",
        "IPSourceIPList": "",
        "STARTTLS": "FALSE",
        "AuthMethods": "PLAIN+LOGIN+NTLM+CRAMMD5+DIGESTMD5+",
        "SecureAuthentication": "0",
        "SPFSkipAddr": "",
        "AuthRelay": "TRUE",
        "RelayIPRestrict": "TRUE",
        "AuthDomainSend": "TRUE",
        "AuthInternal": "TRUE",
        "SPFFail": "Block",
        "SpecialSMTPGoodbye": "",
        "MaxSendersAction": "Block IP",
        "MaxSenders": "6",
        "MaxRecipientsAction": "Off",
        "PreventAddressProbingAddresses": "32",
        "PreventAddressProbingDelay": "5",
        "AllowAuthenticationUsers": "TRUE",
        "TimeOut": "240",
        "MaxRecvBandwidth": "1000000",
        "MaxSendBandwidth": "1000000",
        "MaxEmailLines": "1000",
        "LogLevel": "General",
        "Port": "25",
        "SSLPort": "465",
        "LogTypes": "Error,Message,Config,Service,Licence"
    }
}					
				

Delete a section of the configuration

DELETE
config
/

Parameters

name type description allowed default
commit string Commit action apply,cancel

Response

HTTP 200 OK						
				

Modify a section of the configuration

POST
config
/

Parameters

name type description allowed default
commit string Commit action apply,cancel
section string The contents of the section
action string Modification action merge,delete,replace merge

Response

HTTP 200 OK						
				

Log

List of logs

GET
log

Response

{
	"log":"application",
	"log":"webui",
	"log":"developer",
	"log":"webui",
	"log":"reports",
	"log":"pop3reader",
	"log":"smtpsender",
	"log":"emailprocessor",
	"log":"spamblocker",
	"log":"antivirus",
	"log":"blocker",
	"log":"censor",
	"log":"responder",
	"log":"router",
	"log":"groupdistributer",
	"log":"alerter",
	"log":"attach",
	"log":"imappush",
	"log":"webfolders",
	"log":"archiver",
	"log":"legitimizer",
	"log":"market",
	"log":"advert",
	"log":"secure"
}
				

Log lines

GET
log
/
id

Parameters

name type description allowed default
lines integer Number of lines to retrieve 100
filter integer Filter to match log

Response

[
	{
		"date":"28/01/2014",
		"time":"09:47:52",
		"Config: Log configuration (Level Debug, Types [Error|Message|Config|Service|License], MaxSizeKBytes 5000, History 8, FlushSizeKBytes 0, Flush Period 0)"
	},
	{
		"date":"28/01/2014",
		"time":"09:47:52",
		"Config: Resume log switched to debug"
	},
	...
]
				

Clear a log

DELETE
log
/
id

Response

HTTP 200 OK