Dovecot Anti-Abuse Shield (1.2)

Download OpenAPI specification:Download

License: GPL2

An API to the Dovecot Anti-Abuse Shield to prevent brute-force and abuse of mail systems

“addBLEntry”

post /?command=addBLEntry
http://doesnotexist.dovecot.fi/?command=addBLEntry

“Add a blacklist entry for an IP and/or login“

Request Body schema: application/json
expire_secs
integer
ip
string
login
string
reason
string

Responses

200

“addBLEntry response"

default

unexpected error

Request samples

application/json
Copy
Expand all Collapse all
{
  • "expire": 3600,
  • "ip": "127.0.0.1",
  • "reason": "“Too many bad passwords”"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "status": "ok"
}

allow

post /?command=allow
http://doesnotexist.dovecot.fi/?command=allow

Query whether a login should be allowed

Request Body schema: application/json
attrs
object (LTAttrs)
login
required
string
pwhash
required
string
remote
required
string

Responses

200

“allow response"

default

unexpected error

Request samples

application/json
Copy
Expand all Collapse all
{
  • "attrs":
    {
    },
  • "login": "joe.bloggs",
  • "pwhash": "cc04",
  • "remote": "192.168.1.2",
  • "success": true
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "msg": "string",
  • "r_attrs":
    {
    },
  • "status": 0
}

“delBLEntry”

post /?command=delBLEntry
http://doesnotexist.dovecot.fi/?command=delBLEntry

“Delete a blacklist entry for an IP and/or login“

Request Body schema: application/json
ip
string
login
string

Responses

200

“delBLEntry response"

default

unexpected error

Request samples

application/json
Copy
Expand all Collapse all
{
  • "ip": "127.0.0.1"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "status": "ok"
}

getBL

get /?command=getBL
http://doesnotexist.dovecot.fi/?command=getBL

Get the list of all blacklisted IPs and/or Logins

Responses

200

getBL response

default

unexpected error

Response samples

application/json
Copy
Expand all Collapse all
{
  • "bl_entries":
    [
    ]
}

getDBStats

post /?command=getDBStats
http://doesnotexist.dovecot.fi/?command=getDBStats

Get the db stats for an IP and/or login

Request Body schema: application/json
ip
string
login
string

Responses

200

getDBStats response

default

unexpected error

Request samples

application/json
Copy
Expand all Collapse all
{
  • "ip": "127.0.0.1"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "blacklisted": true,
  • "key_name": "string",
  • "stats":
    {
    }
}

ping

get /?command=ping
http://doesnotexist.dovecot.fi/?command=ping

Ping the server to ensure it is operational

Responses

200

ping response

default

unexpected error

Response samples

application/json
Copy
Expand all Collapse all
{
  • "status": "ok"
}

report

post /?command=report
http://doesnotexist.dovecot.fi/?command=report

Creates a new report about a login (successful or unsuccessful)

Request Body schema: application/json
attrs
object (LTAttrs)
login
required
string
policy_reject
boolean
pwhash
required
string
remote
required
string
success
required
boolean

Responses

200

report response

default

unexpected error

Request samples

application/json
Copy
Expand all Collapse all
{
  • "login": "joe.bloggs",
  • "pwhash": "cc04",
  • "remote": "192.168.1.2",
  • "success": true
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "status": "ok"
}

reset

post /?command=reset
http://doesnotexist.dovecot.fi/?command=reset

Reset the stats and any blacklist entry for an IP and/or login

Request Body schema: application/json
ip
string
login
string

Responses

200

reset response

default

unexpected error

Request samples

application/json
Copy
Expand all Collapse all
{
  • "ip": "127.0.0.1"
}

Response samples

application/json
Copy
Expand all Collapse all
{
  • "status": "ok"
}