Fluxmail

Test an IMAP connection

Test IMAP and SMTP settings without saving an account. Requires admin.accounts.

POST /api/v1/admin/imap/tests

Test IMAP and SMTP settings without saving an account. Requires admin.accounts.

Authentication

Pass a Fluxmail API key as a bearer token. The key owner must be an administrator, and the key must include the administrative capability named in the endpoint description.

Remote administrative requests require HTTPS. Requests from the local computer can use HTTP.

Request

curl 'http://localhost:8977/api/v1/admin/imap/tests' \
  -X POST \
  -H "Authorization: Bearer $FLUXMAIL_API_KEY" \
  -H "Content-Type: application/json" \
  --data '{
  "email": "you@example.com",
  "imap": {
    "host": "imap.example.com",
    "port": 993,
    "security": "tls",
    "user": "you@example.com",
    "password": "app-password"
  },
  "smtp": {
    "host": "smtp.example.com",
    "port": 465,
    "security": "tls",
    "user": "you@example.com",
    "password": "app-password"
  }
}'

Request body

Content type: application/json

{
  "type": "object",
  "properties": {
    "email": {
      "type": "string",
      "maxLength": 320,
      "format": "email"
    },
    "displayName": {
      "type": "string",
      "minLength": 1,
      "maxLength": 200
    },
    "imap": {
      "type": "object",
      "properties": {
        "host": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "port": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        "security": {
          "type": "string",
          "enum": [
            "tls",
            "starttls"
          ]
        },
        "user": {
          "type": "string",
          "minLength": 1,
          "maxLength": 320
        },
        "password": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        }
      },
      "required": [
        "host",
        "port",
        "security",
        "user",
        "password"
      ],
      "additionalProperties": false
    },
    "smtp": {
      "type": "object",
      "properties": {
        "host": {
          "type": "string",
          "minLength": 1,
          "maxLength": 255
        },
        "port": {
          "type": "integer",
          "minimum": 1,
          "maximum": 65535
        },
        "security": {
          "type": "string",
          "enum": [
            "tls",
            "starttls"
          ]
        },
        "user": {
          "type": "string",
          "minLength": 1,
          "maxLength": 320
        },
        "password": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        }
      },
      "required": [
        "host",
        "port",
        "security",
        "user",
        "password"
      ],
      "additionalProperties": false
    },
    "saveSent": {
      "type": "boolean"
    },
    "folderOverrides": {
      "type": "object",
      "properties": {
        "sent": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "drafts": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "trash": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "archive": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        },
        "spam": {
          "type": "string",
          "minLength": 1,
          "maxLength": 1024
        }
      },
      "additionalProperties": false
    }
  },
  "required": [
    "email",
    "imap",
    "smtp"
  ],
  "additionalProperties": false,
  "example": {
    "email": "you@example.com",
    "imap": {
      "host": "imap.example.com",
      "port": 993,
      "security": "tls",
      "user": "you@example.com",
      "password": "app-password"
    },
    "smtp": {
      "host": "smtp.example.com",
      "port": 465,
      "security": "tls",
      "user": "you@example.com",
      "password": "app-password"
    }
  }
}

Responses

StatusDescriptionContent type
200Connection test resultapplication/json
400Invalid requestapplication/json
401Authentication requiredapplication/json
403Administrative access deniedapplication/json
404Resource not foundapplication/json
409Request conflictapplication/json
413Request body too largeapplication/json
415Unsupported media typeapplication/json
500Internal errorapplication/json
502License could not be verifiedapplication/json

200 response

{
  "type": "object",
  "properties": {
    "data": {
      "type": "object",
      "additionalProperties": {}
    }
  },
  "required": [
    "data"
  ],
  "additionalProperties": false
}

Last updated