Hello,
ADD ON / MOD for checking emails against spamassassin for easier filtering of spam
To install this mod you need
-spamd daemon running
-SpamAssasin PHP API from http://ppadron.blog.br/2010/05/04/php-api-to-spamassassin-spamd-protocol(http://ppadron.blog.br/2010/05/04/php-api-to-spamassassin-spamd-protocol) place SpamAssassin directory in /include/
/include/class.mailfetch
replace this
require_once(INCLUDE_DIR.'class.mailparse.php');
require_once(INCLUDE_DIR.'class.ticket.php');
require_once(INCLUDE_DIR.'class.dept.php');
with this
require_once(INCLUDE_DIR.'class.mailparse.php');
require_once(INCLUDE_DIR.'class.ticket.php');
require_once(INCLUDE_DIR.'class.dept.php');
require_once(INCLUDE_DIR.'SpamAssassin/Client.php');
after this
$var=$mailinfo;
place this
$orig_email = imap_fetchheader($this->mbox,$mid).imap_body($this->mbox,$mid);
$params = array(
"hostname" => "localhost",
"port" => "783",
"user" => "nobody",
);
$sa = new SpamAssassin_Client($params);
if ($sa->isSpam($orig_email) == 1)
{
$var = " ".$var;
}
this will simply add in front of the subject line to easier identify the spam. If you want the spam email to be deleted then simply use in the if clause
return 1;
With "return 1;" the email will be deleted (if set for pop3 checking) and no ticket is created.