5.3.0-git
2014-10-02

[#6364] Training SpamAssassin, Horde, IMAP, Plesk user configuration
Summary Training SpamAssassin, Horde, IMAP, Plesk user configuration
Queue IMP
Queue Version HEAD
Type Enhancement
State Resolved
Priority 1. Low
Owners selsky (at) columbia (dot) edu
Requester david.newcomb (at) bigsoft (dot) co (dot) uk
Created 2008-03-03 (2404 days ago)
Due
Updated 2008-03-05 (2402 days ago)
Assigned
Resolved 2008-03-05 (2402 days ago)
Milestone
Patch No

History
2008-03-05 17:57:21 Matt Selsky Comment #6
Assigned to Matt Selsky
State ⇒ Resolved
Reply to this comment
This will be in the next RC for IMP 4.2.



To see the conf.xml changes, you need to visit 
http://yoursite/horde/admin/setup/  If you have further questions 
about using the setup screens, please ask on the mailing list.
2008-03-05 10:59:35 david (dot) newcomb (at) bigsoft (dot) co (dot) uk Comment #5 Reply to this comment
Your patch is a far more elegant way of doing it.

Will this go into the main release?



I have been unable to make the contents of conf.xml appear anyway via 
web interface. I can see that the file contains instructions for the 
different options in the conf.php file, but how is it supposed to be 
read.

Nothing in that directory references it.


2008-03-04 18:13:31 Matt Selsky Comment #4
New Attachment: more-spam-parameters.patch Download
Reply to this comment
The program parameters are already in conf.xml.  Can you see if this 
patch makes things easier for you?
2008-03-04 17:26:51 david (dot) newcomb (at) bigsoft (dot) co (dot) uk Comment #3 Reply to this comment
The problem with Spam.php is that spam programs typically need to know 
the user name and domain in order to run properly (this is especially 
true when running virtual hosts or co-location).



Horde-IMP supports %u for the whole email address. I have added %l for 
user name and %d for domain.



horde/imp/lib/Spam.php:



/* If a (not)spam reporting program has been provided, use

        * it. */

        if (!empty($GLOBALS['conf'][$action]['program'])) {

        $raw_msg = $imp_contents->fullMessageText();

        /* Use a pipe to write the message contents. This should

        * be secure. */

        $email_address = explode("@", Auth::getAuth());



        $prog = str_replace('%u', escapeshellarg(Auth::getAuth()), 
$GLOBALS['conf'][$action]['program']);

        $prog = str_replace('%l', escapeshellarg($email_address[0]), $prog);

        $prog = str_replace('%d', escapeshellarg($email_address[1]), $prog);

        $proc = proc_open($prog,



So that my command lines are:



SPAM="/usr/bin/sa-learn -u %u --dbpath 
/var/qmail/mailnames/%d/%l/.spamassassin -L --spam"

HAM="/usr/bin/sa-learn -u %u --dbpath 
/var/qmail/mailnames/%d/%l/.spamassassin -L --ham"



In imp/config/conf.php the only related options are:



$conf['spam']['reporting'] = false;

$conf['notspam']['reporting'] = false;



It took ages hunting through the source code to find that filtering 
programs were supported and have config options. Please can you add 
these to imp/config/conf.php



$conf['spam']['program'] = '';

$conf['notspam']['program']  = '';





The rest of the article talks about the fact that the web service runs 
under a different user to the email subsystem and there are permission 
conflicts that need to be resolved so that the web user can submit 
work to the spam engine. I think these issues are beyond the scope of 
Horde.
2008-03-04 16:29:33 Matt Selsky Comment #2
State ⇒ Feedback
Reply to this comment
Can you attach your patch here?
2008-03-03 17:21:21 david (dot) newcomb (at) bigsoft (dot) co (dot) uk Comment #1
State ⇒ New
Queue ⇒ IMP
Summary ⇒ Training SpamAssassin, Horde, IMAP, Plesk user configuration
Type ⇒ Enhancement
Priority ⇒ 1. Low
Reply to this comment
I wrote an article on how to configure Horde to do user specific 
on-demand spam learning under a plesk environment. Had a comment from 
someone to say they were trying to do this and there was no 
documentation for it.



It would be nice if you could incorporate some of it into the real 
application.

In particular it shows how to patch imp/lib/Spam.php so that it 
correctly obtains the user name to be handled, and gives an example of 
what $conf['notspam']['program'] and $conf['spam']['program'] 
variables may be set to.





Full article at:

http://www.bigsoft.co.uk/blog/index.php/2007/08/30/horde_spamassassin_imap_plesk_user_confi