Skip to content

halon-extras/vade

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Vade(host, opts)

Scans a message with Vade's Content Filter REST API.

Params

  • host string - IP or hostname to the Vade service. Required.
  • opts array - options array

Returns: class object.

The following options are available in the opts array.

  • port number - TCP port. The default is 8080.
  • timeout number - Timeout in seconds. The default is 10 seconds.
  • tls array - TLS settings.
  • max_message_size number - The max message size in bytes. The default is 5 MiB.

The following options are available in the tls array.

  • enabled boolean - Enable TLS for the specific socket
  • opts array - All available options can be found on here

scan(fp, senderip, senderhelo, sender, recipients)

Scans a message

Params

  • fp File - file object such as return type of toFile(). Required.
  • senderip string - IP-address of the sender
  • senderhelo string - The HELO of the sender
  • sender string - The envelope sender
  • recipients array - The pre-defined $transaction["recipients"] object

Returns: associative array containing the result of the scan

Return type: array, when an error occur the "error" index is available.

ping()

Pings the Vade's service to check if it's responding

Returns: boolean

Example

import { Vade } from "vade";

$vade = Vade("172.16.78.25", ["port" => 8080, "tls" => ["enabled" => true]]);
$fp = $arguments["mail"]->toFile();
$result = $vade->scan($fp, $connection["remoteip"], $connection["helo"]["host"], $transaction["sender"], $transaction["recipients"]);

if (!$result["error"]) {
    echo $result;
} else {
    echo "Error - ".$result["error"];
}

About

Vade Secure anti-spam client

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published