Author Topic: movespam moves all inbox to Junk folder  (Read 3495 times)

Offline Mark Foley

  • Newbie
  • *
  • Posts: 6
movespam moves all inbox to Junk folder
« on: March 22, 2015, 11:48:43 AM »
I recently downloaded the movespam 1.0 plugin. My spam message subject is of the form "Subject: 4.7 [SPAM] the rest of the subject". So, I changed config.inc.php.dist to: $rcmail_config['movespam_subject'] = '[SPAM]';

and I changed line 40 in movespam.php from

 if (strpos($message->subject, $this->spam_text) === 0){

  to

if (strpos($message->subject, $this->spam_text) >= 0){
 
That's all I did. When I log into roundcube it sends every inbox message to the Junk folder. Can someone tell me what I did wrong?

Offline Mark Foley

  • Newbie
  • *
  • Posts: 6
Re: movespam moves all inbox to Junk folder
« Reply #1 on: March 22, 2015, 12:34:39 PM »
In fact, does this plugin work for anyone at all? I set everything to the vanilla download and it didn't work at all. It didn't test positive for on:

if (strpos($message->subject, $this->spam_text) === 0)

even when I used the as-shipped spam string "***SPAM***". When I changed the === to >= I got the error

[22-Mar-2015 11:27:41 America/New_York] PHP Fatal error:  Call to undefined method rcube_imap::messagecount() in /user/util/src/roundcubemail-1.0.4/plugins/movespam/movespam.php on line 51

browsing on this forum suggested changing messagecount() to count(), which I did. At that point it once again moved ALL messages from inbox to junk, regardless of whether "***SPAM***" was in the subject line or not.

I don't think this plugin is ready for prime time yet.

Has anyone gotten it to work successfully? If so, how?

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,856
Re: movespam moves all inbox to Junk folder
« Reply #2 on: March 22, 2015, 02:05:27 PM »
When using strpos you should use '!== false' rather than '>= 0' because the Boolean value false can be evaluated as 0. Also you said you set your text in config.inc.php.dist did you rename this file to config.inc.php? I've not seen this plugin myself but that is normally what you need to do.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and moreā€¦