Author Topic: Markasjunk2 Problem  (Read 6431 times)

Offline NebuK

  • Newbie
  • *
  • Posts: 2
Markasjunk2 Problem
« on: December 08, 2009, 05:02:09 PM »
Hi fellow roundcubers,

i've having some trouble with the Markasjunk2 plugin. I've configured it to do sa-learn on both ham an spam, without the --usersname= flag. Now, the mark as spam icon is in the toolbar, marking as spam works, invokes sa-learn just fine. Just when i go to the Junk folder and try to mark something as Ham i get the red alert box saying "SERVER OK (Internal Server Error)" with nothing written in both, roundcube and apache logfiles. A real internal server error would at least go to the apache logs, so i'm a bit confused where to look for whats wrong right now... :/

Any help would be greatly appreciated.

Kind Regards and Thanks in Advance
- NebuK

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Markasjunk2 Problem
« Reply #1 on: December 09, 2009, 03:15:17 AM »
i suggest checking a couple of little things first, check the rc/logs dir is actually writable by the web server and also check what version of the plugin you have.

assuming both those are fine then you'll need to add some logging into markasjunk2.php and drivers/cmd_learn.php. coz its only ever called as an AJAX script you cant just print the output to the screen. If you look in cmd_learn you'll see some lines like `write_log(.....` this is how to make RC write something to a logfile, 1st param is the name of the log file, second is the text to write.

good luck
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…

Offline NebuK

  • Newbie
  • *
  • Posts: 2
Markasjunk2 Problem
« Reply #2 on: December 09, 2009, 09:00:47 AM »
Tracked down the error more or less thanks to your help.

In line 176 of markasjunk2.php:
Code: [Select]
               write_log('markasjunk2', 'FooBar');
                if ($rcmail->config->get('markasjunk2_spam_flag', false))
                        $imap->unset_flag($uids, $this->spam_flag, $mbox_nam);
                write_log('markasjunk2', 'FooBar');


the first log gets executed, the second does not. It can be fixed by setting SpamFlag to from "Junk" null. Could this be related to SA flagging with "X-Spam-Flag: YES" instead of "Junk"?

Thanks for your help so far
- NebuK

Offline JohnDoh

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2,845
Markasjunk2 Problem
« Reply #3 on: December 10, 2009, 02:58:50 AM »
I tried it on my test server and it doesnt error for me. Can you dig a little more into that function call, check the content of the variables being passed to it? Also look in program/include/rcube_imap.php to make sure the function is there.
Roundcube Plugins: Contextmenu, SpamAssassin Prefs, and more…