Sending Profiles

A "Sending Profile" is the SMTP configuration that tells Gophish how to send emails.

Sending profiles support authentication and ignoring invalid SSL certificates.

Sending Profiles have the following structure:

{
  id                 : int64
  name               : string
  username           : string (optional)
  password           : string (optional)
  host               : string
  interface_type     : string
  from_address       : string
  ignore_cert_errors : boolean (default:false)
  modified_date      : string(datetime)
  headers            : array({key: string, value: string}) (optional)
}

Get Sending Profiles

GET https://localhost/api/smtp/

Gets a list of the sending profiles created by the authenticated user.

Headers

NameTypeDescription

Authorization

string

A valid API key

[
  {
    "id" : 1,
    "name":"Example Profile",
    "interface_type":"SMTP",
    "from_address":"John Doe <john@example.com>",
    "host":"smtp.example.com:25",
    "username":"",
    "password":"",
    "ignore_cert_errors":true,
    "modified_date": "2016-11-20T14:47:51.4131367-06:00",
    "headers": [
      {
        "key": "X-Header",
        "value": "Foo Bar"
      }
    ]
  }
]

Get Sending Profile

GET https://localhost:3333/api/smtp/:id

Returns a sending profile given an ID, returning a 404 error if no sending profile with the provided ID is found.

Path Parameters

NameTypeDescription

id

integer

The sending profile ID to return

Headers

NameTypeDescription

Authorization

string

A valid API key

{
  "id" : 1,
  "name":"Example Profile",
  "interface_type":"SMTP",
  "from_address":"John Doe <john@example.com>",
  "host":"smtp.example.com:25",
  "username":"",
  "password":"",
  "ignore_cert_errors":true,
  "modified_date": "2016-11-20T14:47:51.4131367-06:00",
  "headers": [
    {
      "key": "X-Header",
      "value": "Foo Bar"
    }
  ]
}

Create Sending Profile

POST https://localhost:3333/api/smtp

Creates a sending profile.

Headers

NameTypeDescription

Authorization

string

A valid API key

Request Body

NameTypeDescription

Payload

object

The body of the request is a JSON representation of a sending profile. Refer to the introduction for the valid format of a sending profile.

{
  "id" : 1,
  "name":"Example Profile",
  "interface_type":"SMTP",
  "from_address":"John Doe <john@example.com>",
  "host":"smtp.example.com:25",
  "username":"",
  "password":"",
  "ignore_cert_errors":true,
  "modified_date": "2016-11-20T14:47:51.4131367-06:00",
  "headers": [
    {
      "key": "X-Header",
      "value": "Foo Bar"
    }
  ]
}

This method expects the sending profile to be provided in JSON format. You must provide a sending profile name, the from_address which emails are sent from, and the SMTP relay host.

Sending Profiles support authentication by setting the username and password.

Additionally, many SMTP server deployments leverage self-signed certificates. To tell Gophish to ignore these invalid certificates, set the ignore_cert_errors field to true.

This method returns the JSON representation of the sending profile that was created.

Modify Sending Profile

PUT https://localhost:3333/api/smtp/:id

Modifies an existing sending profile.

Path Parameters

NameTypeDescription

id

integer

The sending profile ID to modify

Headers

NameTypeDescription

Authorization

string

A valid API key

Request Body

NameTypeDescription

Payload

object

The body of the request is a JSON representation of a sending profile. Refer to the introduction for the valid format of a sending profile.

{
  "id" : 1,
  "name":"Example Profile",
  "interface_type":"SMTP",
  "from_address":"John Doe <john@example.com>",
  "host":"smtp.example.com:25",
  "username":"",
  "password":"",
  "ignore_cert_errors":true,
  "modified_date": "2016-11-20T14:47:51.4131367-06:00",
  "headers": [
    {
      "key": "X-Header",
      "value": "Foo Bar"
    }
  ]
}

This method expects the sending profile to be provided in JSON format. You must provide a full sending profile, not just the fields you want to update.

This method returns the JSON representation of the sending profile that was modified.

Delete Sending Profile

DELETE https://localhost:3333/api/smtp/:id

Deletes a sending profile by ID.

Path Parameters

NameTypeDescription

id

integer

The ID of the sending profile to delete

Headers

NameTypeDescription

Authorization

string

A valid API key

{
  "message": "SMTP deleted successfully!",
  "success": true,
  "data": null
}

Returns a 404 error if the specified sending profile isn't found.

This method returns a status message indicating the sending profile was deleted successfully.

Last updated