/API

Analysis

The Analysis API allows you to analyse messages in more detail. For example, running a SpamAssassin report.

Perform a deliverability check

Generates a a deliverability report for the specified email. The domain of the sender is checked to ensure the deliverability of the email. Content of the email is also checked to highlight issues that may cause the email to be marked as illegitimate. Content is also checked via SpamAssassin which is one of the most common spam checkers on the market, these results can be used to understand how common spam checkers will view your email.

Path parameters

  • Name
    id
    Type
    string
    Required
    required
    Description
    The identifier of the email to be analyzed.
Postman iconInsomnia icon
GET /api/analysis/deliverability/:id
curl \
  -u api:YOUR_API_KEY \
  https://mailosaur.com/api/analysis/deliverability/MESSAGE_ID
const result = await mailosaur.analysis.deliverability(message.id)

console.log(result.spf.result) // "Pass"

result.spamAssassin.forEach(r => {
  console.log(r.rule)
  console.log(r.description)
  console.log(r.score)
})
cy.mailosaurGetDeliverabilityReport().then(result => {
  cy.log(result.spf.result) // "Pass"

  result.spamAssassin.forEach(r => {
    cy.log(r.rule)
    cy.log(r.description)
    cy.log(r.score)
  })
})
result = mailosaur.analysis.deliverability(message.id)

print(result.spf.result) // "Pass"

for r in result.spam_assassin:
  print(r.rule)
  print(r.description)
  print(r.score)
DeliverabilityReport result = client.analysis().deliverability(message.id());

System.out.println(result.spf().result()); // "Pass"

for (SpamAssassinRule rule : result.spamFilterResults().spamAssassin()) {
    System.out.println(rule.rule());
    System.out.println(rule.description());
}
var result = mailosaur.Analysis.Deliverability(message.Id);

Console.WriteLine(result.spf.result) // "Pass"

foreach (var r in result.SpamAssassin) {
  Console.WriteLine(r.Rule);
  Console.WriteLine(r.Description);
  Console.WriteLine(r.Score);
}
result = mailosaur.analysis.deliverability(message.id)

puts(result.spf.result) // "Pass"

for r in result.spam_assassin do
  puts(r.rule)
  puts(r.description)
  puts(r.score)
end
$result = $mailosaur->analysis->deliverability($message->id);

print($result->spf->result) // "Pass"

foreach ($result->spamAssassin as &$r) {
  print($r->rule);
  print($r->description);
  print($r->score);
}
result, _ := m.Analysis.Deliverability(message.Id)
fmt.Println(result.Spf.Result) // "Pass"

for _, r := range result.SpamAssassin {
  fmt.Println(r.Rule)
  fmt.Println(r.Description)
  fmt.Println(r.Score)
}
let result = try await EmailsTestsSetup.client.analysis.deliverability(email: message.id)

print(result.spf?.result) // "Pass"

for rule in result.spamAssassin {
    print(rule.rule)
    print(rule.description)
    print(rule.score)
}
{
    "spf": {
        "result": "Pass",
        "description": null,
        "rawValue": null,
        "tags": {}
    },
    "dkim": [
        {
            "result": "Pass",
            "description": null,
            "rawValue": null,
            "tags": {}
        }
    ],
    "dmarc": {
        "result": "Pass",
        "description": null,
        "rawValue": "v=DMARC1; p=reject; rua=mailto:dmarc@abc1234.mailosaur.net;",
        "tags": {
            "v": "DMARC1",
            "p": "reject",
            "rua": "mailto:dmarc@abc1234.mailosaur.net"
        }
    },
    "blockLists": [
        {
            "id": "ABC123",
            "name": "ABC",
            "result": "Pass"
        },
        {
            "id": "DEF123",
            "name": "DEF",
            "result": "Warning"
        },
        {
            "id": "GHI123",
            "name": "GHI",
            "result": "Fail"
        },
    ],
    "content": {
        "embed": false,
        "iframe": false,
        "object": false,
        "script": false,
        "shortUrls": false,
        "textSize": 123,
        "totalSize": 3456,
        "missingAlt": false,
        "missingListUnsubscribe": false
    },
    "dnsRecords": {
        "a": [
            "mailosaur.net. 30 IN A 192.168.1.1"
        ],
        "mx": [
            "mailosaur.net. 30 IN MX 0 mailosaur.net."
        ],
        "ptr": []
    },
    "spamAssassin": {
        "score": 0,
        "result": "Pass",
        "rules": [
            {
                "score": 0.0,
                "rule": "ABC123",
                "description": "ABC123"
            }
        ]
    }
}

Perform a spam test

Perform spam testing on the specified email.

Path parameters

  • Name
    id
    Type
    string
    Description
    The identifier of the email to be analysed.
Postman iconInsomnia icon
GET /api/analysis/spam/:id
curl \
  -u api:YOUR_API_KEY \
  https://mailosaur.com/api/analysis/spam/MESSAGE_ID
const result = await mailosaur.analysis.spam(message.id)

console.log(result.score) // 0.5

result.spamFilterResults.spamAssassin.forEach(r => {
  console.log(r.rule)
  console.log(r.description)
  console.log(r.score)
})
cy.mailosaurGetSpamAnalysis().then(result => {
  cy.log(result.score) // 0.5

  result.spamFilterResults.spamAssassin.forEach(r => {
    cy.log(r.rule)
    cy.log(r.description)
    cy.log(r.score)
  })
})
result = mailosaur.analysis.spam(message.id)

print(result.score) # 0.5

for r in result.spam_filter_results.spam_assassin:
  print(r.rule)
  print(r.description)
  print(r.score)
SpamAnalysisResult result = mailosaur.analysis().spam(message.id());

System.out.println(result.score()); // 0.5

result.spamFilterResults().spamAssassin().forEach(r ->
{
  System.out.println(r.rule());
  System.out.println(r.description());
  System.out.println(r.score());
});
var result = mailosaur.Analysis.Spam(message.Id);

Console.WriteLine(result.Score); // 0.5

foreach (var r in result.SpamFilterResults.SpamAssassin) {
  Console.WriteLine(r.Rule);
  Console.WriteLine(r.Description);
  Console.WriteLine(r.Score);
}
result = mailosaur.analysis.spam(message.id)

puts(result.score) # 0.5

for r in result.spam_filter_results.spam_assassin do
  puts(r.rule)
  puts(r.description)
  puts(r.score)
end
$result = $mailosaur->analysis->spam($message->id);

print($result->score); // 0.5

foreach ($result->spamFilterResults->spamAssassin as &$r) {
  print($r->rule);
  print($r->description);
  print($r->score);
}
result, _ := m.Analysis.Spam(message.Id)
fmt.Println(result.Score)

for _, r := range result.SpamFilterResults.SpamAssassin {
  fmt.Println(r.Rule)
  fmt.Println(r.Description)
  fmt.Println(r.Score)
}
{
  "spamFilterResults": {
  "spamAssassin": [
    {
      "score": 0,
      "rule": "ABC123",
      "description": "ABC123"
    }
  ]},
  "score": 0
}

Previous

Files

Next

Usage