Skip to content
Permalink
Browse files

Update how to access mail file

  • Loading branch information
fredriklengstrand committed Oct 4, 2019
1 parent 3e9f60e commit 7009eef949444e2fa341e9ae50de32e1738e288d
@@ -2,9 +2,9 @@

Implementation of the Milter protocol v2. It's tested with [clamav-milter](http://www.clamav.net/), however minor changes may allow it to connect to other servers as well.

```
```java
$opts = ["host" => "1.1.1.1", "port" => 3381, "timeout_eod" => 15];
$fp = GetMailFile();
$fp = $arguments["mail"]->toFile(); // Or use "GetMailMessage()->toFile();" in a EOD "Per recipient" script
$result = milter_v2($opts, $senderip, $senderport, $senderhelo, $sender, $recipients, $fp);
if (is_array($result))
foreach ($result as $r)
@@ -29,7 +29,7 @@ Check if a message is spam or not.

**Params**

- fp `File` - file object such as return type of [GetMailFile()](http://docs.halon.se/hsl/data.html#data.GetMailFile). **Required**.
- fp `File` - file object such as return type of [toFile()](https://docs.halon.io/hsl/functions.html#MailMessage.toFile). **Required**.

**Returns**: associative array containing the result of the scan

@@ -40,7 +40,7 @@ Send a message to the controller for learning.

**Params**

- fp `File` - file object such as return type of [GetMailFile()](http://docs.halon.se/hsl/data.html#data.GetMailFile). **Required**.
- fp `File` - file object such as return type of [toFile()](https://docs.halon.io/hsl/functions.html#MailMessage.toFile). **Required**.
- type `string` - Specify a type, either spam or ham. **Required**.

**Returns**: associative array containing the result of the scan
@@ -4,7 +4,7 @@ Client for the [SpamAssassin (spamd) Network Protocol](https://github.com/apache
**Params**

- address `string` - IP-address to the spamd server. **Required**.
- mail `File` - file object such as return type of [GetMailFile()](http://docs.halon.se/hsl/data.html#data.GetMailFile). **Required**.
- mail `File` - file object such as return type of [toFile()](https://docs.halon.io/hsl/functions.html#MailMessage.toFile). **Required**.
- opts `array` - options array

**Returns**: class object.
@@ -26,7 +26,7 @@ Scans a message

**Params**

- fp `File` - file object such as return type of [GetMailFile()](http://docs.halon.se/hsl/data.html#data.GetMailFile). **Required**.
- fp `File` - file object such as return type of [toFile()](https://docs.halon.io/hsl/functions.html#MailMessage.toFile). **Required**.

**Returns**: associative array containing the result of the scan

@@ -44,7 +44,8 @@ Pings the Vade's service to check if it's responding
include "vade";
$vade = VADE("172.16.78.25", ["port" => 8080, "tls" => ["enabled" => true]]);
$result = $vade->scan(GetMailFile());
$fp = $arguments["mail"]->toFile(); // Or use "GetMailMessage()->toFile();" in a EOD "Per recipient" script
$result = $vade->scan($fp);
if (!$result["error"]) {
echo $result;
@@ -11,7 +11,7 @@ SMTP client class
**Returns**: class object.

## Example
```
```java
// Returns [success, isPermanent, lastError]
function SMTPDeliver($address, $sender, $recipients, $fp)
{
@@ -26,7 +26,9 @@ function SMTPDeliver($address, $sender, $recipients, $fp)
$smtp->disconnect();
return [true];
}
[$ok, $ispermanent, $lasterror] = SMTPDeliver("1.2.3.4", $sender, $recipients, GetMailFile());
$fp = $arguments["mail"]->toFile(); // Or use "GetMailMessage()->toFile();" in a EOD "Per recipient" script
[$ok, $ispermanent, $lasterror] = SMTPDeliver("1.2.3.4", $sender, $recipients, $fp);
```

### connect()

0 comments on commit 7009eef

Please sign in to comment.
You can’t perform that action at this time.