A component providing support for e-mail virus filtering software should register implementation of the VirusFilter interface. For details on the registration, refer to the Registering Implementation of Interface section.
To store its own settings, the component should use private tables in the Plesk database. The component can add an event listener to react to events like creation and removal of mail accounts. For actual handling of mail, the component can include mail handlers. For info on mail handlers, refer to the Plesk Internal API and Implementing Event Listeners sections.
To add an antivirus filter, say my_filter_extension.php, it should be put to the <plesk_root_dir>/admin/plib/registry/VirusFilter directory (< stands for the full path to the directory where Plesk is installed).plesk_root_dir>
The source of my_filter_extension.php can look as follows:
<?php
class MyController extends VirusFilterController {
function handleForm($method, $readonly)
{
echo "<html>... static or dynamic page ...</html>";
// Checks the POST status
...
return TRUE;
}
function applyStatus($enabled)
{
// This method controls virus filter activity at the level of a specific user.
}
}
class MyVirusFilter implements VirusFilter
{
function getName()
{
return "My Antivirus Filter";
}
function getUserController(User $user)
{
// code that checks if a user has already initiated an instance of the
// MyController class
return $MyControllerInstance;
}
function applyStatus($enabled)
{
// This method controls global virus filter activity.
}
}
$MyFilterInstance= new MyVirusFilter;
return $MyFilterInstance;
?>