milter_v2(options, senderip, senderport, senderhelo, sender, recipients, fp)
Implementation of the Milter protocol v2. It's tested with clamav-milter, however minor changes may allow it to connect to other servers as well.
$opts = ["host" => "184.108.40.206", "port" => 3381, "timeout_eod" => 15]; $fp = GetMailFile(); $result = milter_v2($opts, $senderip, $senderport, $senderhelo, $sender, $recipients, $fp); if (is_array($result)) foreach ($result as $r) echo $r;
When using clamav-milter, you should use
AddHeader Replace in the clamav-mitler.conf and parse the
"h" response array item from
milter_v2 for viruses.