| Solution | - 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 -
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. -
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"}
 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'.
-
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 }
 -
Verification. After executing the release command, check the 'System Quarantine' section in FortiMail to ensure that the email has been successfully released.   |