[#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 (4794 days ago)
Updated 2008-03-05 (4792 days ago)
Resolved 2008-03-05 (4792 days ago)
Patch No

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 

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.


/* 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()), 

        $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 
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
Type ⇒ Enhancement
State ⇒ New
Priority ⇒ 1. Low
Summary ⇒ Training SpamAssassin, Horde, IMAP, Plesk user configuration
Queue ⇒ IMP
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 

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:


Saved Queries