Skip to main content
MFARRAG
Staff
Staff
Sep 4, 2024 2:23 PM UTC

Technical Tip: Releasing System-Quarantined Emails via FortiMail API

Description

This article describes step-by-step instructions on how to release emails from the system quarantine on FortiMail using the API.

Scope FortiMail.
Solution
  1. Enable REST API on FortiMail.

By default, the REST API is disabled on FortiMail. To enable it, use the following commands:

 

config system web-service

    set rest-api-status enable

end

 

  1. Authenticate Using Postman.

    Use the Postman tool to interact with the FortiMail API. First, authenticate by sending a POST request to the following endpoint:


    curl -v -H "Content-Type: application/json" -X POST -d '{"name":"admin","password":""}'

    https://10.5.27.242/api/v1/AdminLogin

    -c cookie.txt

     

    Replace 'your password' with the actual admin password.

    Replace 'name' with the actual admin username.

     

     

  2. Retrieve Quarantined Emails.
    To view the system-quarantined emails in the 'Bulk' folder, send a request to the following endpoint.

    Run https://10.5.27.242/api/v1/QuarantineMailDisplay.

    Include the following parameters in the request body:

    {"reqAction":1,"type":"system","folder":"Bulk","startindex":"0","pageSize":"50"}

    API-TEST1.PNG

    This request will return the quarantined messages in the 'Bulk' folder. Note the MMKEY from the response, which will look similar to the following '1725455146.2441_128630_846749.011323#Q#484D5fff002991'.

     

  3. Release Quarantined Email.
    To release a specific email from quarantine, send a POST request to the following endpoint:

    https://10.5.27.242/api/v1/SystemQuarantineRelease

    Include the following parameters in the request body:

    {

      "folder": "Bulk",

      "mmkey": "1725455146.2441_128630_846749.011323#Q#484D5fff002991",

      "otherEmails": "",

      "reqAction": 7

    }

    API-TEST2.PNG

     

  4. Verification.
    After executing the release command, check the 'System Quarantine' section in FortiMail to ensure that the email has been successfully released.
                                                   

    released-api1.PNG

    released2.PNG

    Risk and Resilience in the Age of AI. An OT Thought Leadership Summit for Houston's Critical Infrastructure Leaders. Date: Thursday, December 3, 2026. Time: 8:30 am - 1:30 pm (CT). Location: The Westin Houston, Memorial City | 945 Gessner Road, Houston, TX 77024