spamd0.1.0SpamD Settings/pkg_edit.php?xml=spamd.xmlSpamD Whitelist/pkg_edit.php?xml=spamd_whitelist.xmlhttp://www.pfsense.com/packages/config/spamd.tgz['installedpackages']['spamd']['config']Provider Nameprovider_nameProvider Nameprovider_nameEnter the name of the sourceinputProvider Typeprovider_typeSelect the Provider TypeselectblackReject messagereject_messageEnter the message to display to emailing parties that are on this providers listinputProvider Methodprovider_methodSelect the Provider MethoselecthttpProvider URL or Filenameprovider_urlEnter the URL to the provider.textarea
function sync_package() {
global $config;
$fd = fopen("/usr/local/etc/spamd.conf","w");
/* all header */
fwrite($fd, "# this file was automatically generated by the pfSense\n");
fwrite($fd, "# package management system\n\n");
fwrite($fd, "all:whitelist:\\\n\t");
foreach($config['installedpackages']['spamd']['config'] as $spamd) {
fwrite($fd, ":" . $spamd['provider_name'];
}
fwrite($fd, "whitelist:\\ \n");
fwrite($fd, ":white:\\ \n");
fwrite($fd, ":file=/var/mail/whitelist.txt\n\n");
/* loop through each item and write out its configuration */
foreach($config['installedpackages']['spamd']['config'] as $spamd) {
fwrite($fd, $spamd['provider_name'] . ":\\ \n");
fwrite($fd, ":" . $spamd['provider_method'] . ":\\ \n");
fwrite($fd, ":msg=\"" . $spamd['reject_message'] . "\":\\ \n":
fwrite($fd, ":" . $spamd['provider_method'] . ":\\ \n");
fwrite($fd, ":file=" . $spamd['provider_url'] . ":\n\m");
}
fwrite($fd, ":\n\n");
fclose($fd);
$fd = fopen("/var/mail/whitelist.txt","w");
foreach($config['installedpackages']['spamd-greylist']['config'] as $spamd) {
fwrite($fd, $spamd['ip'] . "\n");
}
}
sync_package();
sync_package();
mwexc("touch /var/db/spammer-whitelist");
mwexec("/usr/libexec/spamd-setup &");
mwexec("/usr/libexec/spamlogd &");