Educating the world

Our blog has over 10,000 readers a month

« Simon Pegg is doing awfully wellInstalled B2Evolution »

31 comments

Comment from: Sam [Visitor]
Sam

Great product…I was struggling with the same functionality (or lack there of).

Btw, I run FC6 with IMP and it works great. The only additions I have is to ensure you place the saver.sh and trainer.sh in the bin folder and

$ chmod popuser:popuser saver.sh trainer.sh
$ chmod +x saver.sh trainer.sh

Otherwise, fantastic work…you should offer this how-to up to the Horde-IMP folks…

19/11/07 @ 15:10
Comment from: Paul KPOGNON [Visitor]
Paul KPOGNON

This product is exactly what I was looking for since.

Now I can let my users themselves report their spam as well.

That is fantastic

28/03/08 @ 13:29
Comment from: Matt Earwicker [Visitor]
Matt Earwicker

Have successfully done this on RHEL4 and FC5 servers, but RHEL5 has no $conf[’spam’] settings in the /usr/share/psa-horde/config/conf.php file. If I add them, it doesn’t complain, but it doesn’t show up either.

I tried adding myself as an administrator, and changing it from there, but it doesn’t manage to save either, but suggests I edit the file manually. If I copy the suggested text into the conf.php file, it still doesn’t appear.

Any thoughts?

Matt

25/07/08 @ 16:38
Comment from: davidnewcomb [Member]  
admin

It looks like you have not added the options to the correct config file.
You state:
/usr/share/psa-horde/config/conf.php
but the article states the IMP config file:
/usr/share/psa-horde/imp/config/conf.php

Try adding the options to that instead.

25/07/08 @ 17:39
Comment from: Matt Earwicker [Visitor]
Matt Earwicker

Whoops! Too late at night. Thanks.

26/07/08 @ 07:16
Comment from: Matt Earwicker [Visitor]
Matt Earwicker

Ideal! Just what we needed.

Means that we can finally get our users to sort out their own spam settings a bit, rather than having to try and do them for them within Plesk (a step too far for many), which requires a bit of guesswork anyway.

Thanks for the walk-through, I had given up trying to sort something out myself.

27/07/08 @ 06:17
Comment from: Michael [Visitor]
Michael

Another thing you may want to look at is MagicSpam for Plesk. This works at the SMTP layer before filtering, and helps to reduce the overhead normally associated with Spam Assassin checking, but knocking the bulk off before hand. It also helps to greatly reduce backscatter, keeping you off those blacklists.

02/09/08 @ 22:58
Comment from: Matt Earwicker [Visitor]
Matt Earwicker

Just to add to Sam’s first post:

First command should be:

$ chown popuser:popuser saver.sh trainer.sh

Matt

28/01/09 @ 09:29
Comment from: Adam H [Visitor]
Adam H

Thanks for this Matt! Just one thing - is it possible to get Horde to set mails to “deleted” as & when they are reported as spam? I followed the steps above, but while I see the temp mail files appearing in “train", the original emails seem to remain in the user mailbox?

04/02/09 @ 18:33
Comment from: Christine [Visitor]
Christine

Sounds like a lot of work to add in all these configurations. Why not use an antispam that can tie into the plesk interface and provide simple on/off controls. MagicSpam doesn’t require manual configurations and stops bouncing emails.
Adam - Why not try something that blocks email rather than accepting and filtering it?

19/03/09 @ 18:48
Comment from: davidnewcomb [Member]  
admin

Thanks Christine, MagicSpam is not free whereas the above solution is.
Also there are some companies that go through their captured spam to check for false positives, which blocking it would prevent.

20/03/09 @ 10:04
Comment from: Mini [Visitor]  
Mini

Hey guys I need your help! I’ve got the Plesk server recently and every time I try to access the webmail of any of the mails created inside it appears this:

A fatal error has occurred
Failed to import Horde configuration: Strict Standards: Non-static method Horde::getTempDir() should not be called statically, assuming $this from incompatible context in /etc/psa-horde/horde/conf.php on line 81 Strict Standards: Non-static method Util::getTempDir() should not be called statically, assuming $this from incompatible context in /usr/share/psa-horde/lib/Horde.php on line 987
Strict Standards: Assigning the return value of new by reference is deprecated in /usr/share/psa-pear/PEAR.php on line 563

Where do i find this: /usr/share/psa-horde/ in the Plesk Panel.. I have no clue..Please Help!!

22/07/09 @ 21:52
Comment from: davidnewcomb [Member]  
admin

Does this have anything to do with the article “Training SpamAssassin, Horde, IMAP, Plesk user configuration” or is it a general Plesk enquiry?

23/07/09 @ 02:00
Comment from: DeadSet [Visitor]  
DeadSet

I did the following:

Edit the configuration file (/usr/share/psa-horde/imp/config/conf.php) to tell Horde how to do the training, and when to show the “Report as Spam” and “Report as Innocent” links.

But where should this “Report as Spam” and “Report as Innocent” links be displayed in Horde?

26/09/09 @ 15:30
Comment from: davidnewcomb [Member]  
admin

In the message index page:

Delete | Blacklist | Whitelist | Forward | Report as Spam | Report as Innocent | View Messages

and on the view message page:

Delete | Reply | Forward | Redirect | View Thread | Blacklist | Whitelist | Message Source | Save as | Print | Report as Spam | Report as Innocent

27/09/09 @ 19:35
Comment from: Mark Foster [Visitor]  
Mark Foster

Does this work with Plesk 8.6.0?

Thanks,

Mark Foster

26/05/10 @ 22:45
Comment from: davidnewcomb [Member]  
admin

Yes, I was using it for Plesk 9.x. The line numbers can be slightly different but it should be fine.

27/05/10 @ 09:46
Comment from: HDi [Visitor]
HDi

Great! it’s what we plan to implement with j-chkmail. Has someone tried to do same thing in thunderbird?
Thanks.

02/07/10 @ 21:25
Comment from: krick [Visitor]  
krick

Have you tried using the SpamAssassin module for Horde (Sam)?…

http://git.horde.org/horde/-/browse/sam/

It’s kind of old, and I’m wondering if it’s still a viable path for Horde-SpamAssassin integration.

10/11/10 @ 15:58
Comment from: Daniel Stefanovski [Visitor]
Daniel Stefanovski

Hi,

thx for this great tutorial, this is exactly what I was looking for.

Now I got some Problems getting this running.

When I try to run the trainer.sh as popuser or root it says:

# sudo -u popuser ./trainer.sh
ls: cannot access /var/qmail/popuser/train/*.done: No such file or directory

How can I test this if it’s working correct?

I already had the “mark as spam” links and everything available in horde so i see no difference compared to before. It just does nothing…

Should’t the mails i mark as spam go the train folder somehow? the filesystem didnt change since creating the folders as described above.

So looks like it’s not working huh?

My Plesk Install is customized to hell. I use procmail to write Messages marked as ***SPAM*** by Spamassassin to a Spam-Folder in each user dir. (Method described on huschi.net). Does this generate any potential problems?

13/12/10 @ 16:59
Comment from: davidnewcomb [Member]  
admin

If you already had the “mark as spam” links then you better make sure that the spam-program variables in your conf.php are not redefined.

When you check messages and click “mark as spam” the messages are piped into the train folder via saver.sh and given a special filename which records the username/ham/etc. The email is then moved into the Trash folder or deleted depending on your configuration.

The cron runs the trainer.sh program which runs sa-learn for each email and deletes it.

You can tell that it is working because files appear in the train folder then disappear.

If you have customised the installation then you should be able to trace what is happening yourself because you are basically on your own!

14/12/10 @ 11:20
Comment from: Daniel Stefanovski [Visitor]
Daniel Stefanovski

Hi, thx for your quick reply.

It looks like the saver.sh isn’t triggered from horde UI. When I try to run it manually, it creates those encrypted filenames inside the train dir but theyre not processed until the filename gets the .done ending. When I use bash -x it seems to stop at “cat” and then exit. The encrypted files remain without .done at the end.

But after your last reply I understand what should happen and how this should be working so I think I’ll get this working somehow and then report back with what the problem was.

Thanks alot!

14/12/10 @ 13:21
Comment from: Daniel Stefanovski [Visitor]
Daniel Stefanovski

Sorry for spamming your Blog:P

This is what I get from horde.log

Dec 14 13:11:52 HORDE [error] [imp] Error reporting spam: sh: /saver.sh: not found
[on line 114 of “/usr/share/psa-horde/imp/lib/Spam.php"]
Dec 14 13:15:58 HORDE [error] [imp] Error reporting spam: sh: /saver.sh: not found
[on line 114 of “/usr/share/psa-horde/imp/lib/Spam.php"]
Dec 14 13:51:55 HORDE [error] [imp] Error reporting spam: sh: /saver.sh: not found
[on line 114 of “/usr/share/psa-horde/imp/lib/Spam.php"]
Dec 14 13:53:14 HORDE [error] [imp] Error reporting spam: sh: /saver.sh: not found
[on line 114 of “/usr/share/psa-horde/imp/lib/Spam.php"]

14/12/10 @ 13:37
Comment from: Daniel Stefanovski [Visitor]
Daniel Stefanovski

Ok, I’m stuck at this point.

No matter what I enter as a external spam program, the horde log always shows that it couldn’t find it.

If I use just ‘ls’ or ‘top’ instead of calling the saver.sh it tells me that ‘/ls’ or ‘/top’ couldn’t be found.

It aways adds a ‘/’ before the script or program. Seems like a bug to me.

When I give it ‘/var/qmail/popuser/bin saver.sh’
the log tells me:

Dec 14 15:15:02 HORDE [error] [imp] Error reporting spam: sh: /bin: Permission denied
[on line 114 of “/usr/share/psa-horde/imp/lib/Spam.php"]

Seems there’s something messed up with the ability to launch external programs.

I did a fresh install of imp before so I dindn’t change anything that could cause this.

Any ideas on this?

14/12/10 @ 14:40
Comment from: davidnewcomb [Member]  
admin

The saver.sh program is run as part of a pipe from inside horde. The spam/ham email is piped into saver.sh which saves with the magic file name. If you run it from the shell then the “cat > $FILE” line will return or hang because there is no input pipe.
The issue with “sh /command.sh” looks like a new imp security “feature". Plesk 9.5.3 runs psa-imp-4.3.6 on horde-3.3.6 so not sure what you are running if you have freshly installed it. Anyway it looks like it might be chrooting it, so you could try moving the saver.sh and trainer.sh to the home directory instead of the bin folder. Otherwise you’ll have to trace through the php code to find out what it’s doing.
In mine the lines around 114 are dealing with setting up the pipe to run the command, so you ought to check that the command isn’t being manipulated before it’s being run.

14/12/10 @ 17:18
Comment from: Daniel Stefanovski [Visitor]
Daniel Stefanovski

I got it working now. Workaround is to put saver.sh directly in servers “/"-Directory.

I didn’t find a way to fix the imp action trigger yet and I’m still waiting for an answer in the official support forum regarding this strange behavior.

But after all your solution works great! Thx alot for this!

My next issue is that ingo’s filters do not work. Do you know a good tutorial / howto for configuring any kind of webmail vacation functionality under a plesk / horde setup?

15/12/10 @ 18:13
Comment from: davidnewcomb [Member]  
admin

Sorry I don’t

15/12/10 @ 18:25
Comment from: free hd movies online [Visitor]
free hd movies online

My brother suggested that I might like Training SpamAssassin, Horde, IMAP, Plesk user configuration. He was totally right. This post truly made my day. You can not believe just how much time I had spent on it! Thanks!

03/09/11 @ 23:16
Comment from: Rob [Visitor]
Rob

Hi,

Thanks for the useful post!

I tried to install this and I did everything, but I can’t see the links “Report as spam” or “Report as innocent". I did edit the file /usr/share/psa-horde/imp/config/conf.php,

so I’m not sure what’s wrong. Any advice? I’m on Plesk 8.3

Thank you,
Rob

18/01/12 @ 11:40
Comment from: Rob [Visitor]
Rob

Update: problem solved, not sure how.
Kind of stupid, but maybe I forgot to actually enable the Spam Filter from Plesk on the account that I using to test the script.

18/01/12 @ 16:55
Comment from: bojan [Visitor]
bojan

thanks!

15/10/13 @ 19:14

Leave a comment


Your email address will not be revealed on this site.

Your URL will be displayed.
  
(For my next comment on this site)
(Allow users to contact me through a message form -- Your email will not be revealed!)