Skip to content
This module is intended to be used on HostFact v5 in combination with Spamport. It can create, remove and modify domains.
PHP HTML
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
controllers
includes/languages
models
views
LICENSE
README.md
custom_spamfilter.sql
spamfilter.php

README.md

Spamport-HostFact

This module is intended to be used on HostFact 5 with Spamport. The module can create, remove and modify domains from the HostFact customer panel (klantenpaneel).

Spamport is a commercial spam filter created by Chamid Media.

After installing this module, your customers will be able to add and manage domains to Spamport themselves. All they need to do is add the domain name and change the MX records.

Installation

  1. Create a table by executing the SQL statement in custom_spamfilter.sql;
  2. Upload these files to klantenpaneel/custom/plugins/spamfilter or go to the klantenpaneel/custom/plugins folder and execute git clone https://github.com/CyberfusionNL/Spamport-HostFact spamfilter;
  3. Create a spamfilter product in /Pro and note the product code

Replace these two things in controllers/spamfilter_controller.php:

  1. Replace $this->Spamfilter = new Spamfilter_model("", ""); with $this->Spamfilter = new Spamfilter_model("yourresellerusername", "yourresellerpassword");
  2. Replace P083 with the product code for the product you created on line 99

If you have a custom menu, add the link <?php echo __SITE_URL . DIRECTORY_SEPARATOR . __('spamfilter', 'url'); ?>. If you use the default HostFact menu, a link with the name 'Spamfilter' will automatically be added.

Todos

  • Spamfilter on / off
  • Spamfilter strictness;
  • Greylisting

Known bug

When a domain name is added, a subscription is added with the product code you specified above. When a domain name is deleted in the module, the subscription will automatically be terminated. It's known that when the service is terminated outside of the module (so in the HostFact product view), it will still be active with Spamport.

By adding some code to the service view, you're able to work around this issue. We will simply not show the termination button in the conflicting service view if the product code matches your spamfilter product. Follow these steps:

  1. Copy the file klantenpaneel/core/views/service.view.phtml to the folder klantenpaneel/custom/views (create the path if it doesn't exist yet);
  2. Remove the line that currently reads $this->showElement('service.terminate'); and replace it with this code:
if ($service->Subscription['ProductCode'] !== 'P083') {
    $this->showElement('service.terminate');
}
  1. Replace 'P083' with spamfilter product code that you created during installation
You can’t perform that action at this time.