Author Topic: MarkAsJunk2 bad interpreter, permission denied  (Read 4877 times)

Offline redirect

  • Newbie
  • *
  • Posts: 1
MarkAsJunk2 bad interpreter, permission denied
« on: May 01, 2013, 07:18:46 AM »
I'm having issues configuring MarkAsJunk2 with cmd_learn as driver.

Messages are being moved from/to the Junk folder when pressing the (Not) Junk button, yet sa-learn won't add those messages to the Bayes db. SELinux is disabled, I've tried to set my bayes_path in local.cf (http://www.roundcubeforum.net/index.php/topic,6544.0.html), tested different sa-learn spam/ham commands in config.inc.php.

I'm able to execute sa-learn commands from shell when pointing to a message in maildir:

Code: [Select]
[redirect@test cur]$ pwd
/home/redirect/Maildir/cur

[redirect@test cur]$ sa-learn --ham --showdots hammsg
.
Learned tokens from 1 message(s) (1 message(s) examined)

Markasjunk2 errorlog:

Code: [Select]
[01-May-2013 13:05:48 +0200]: sa-learn -D --spam --username=redirect /var/www/html/roundcubemail-0.9.0/temp/rcmSALearnBRwh6r 2>&1
[01-May-2013 13:05:48 +0200]: array (
  0 => 'sh: /usr/bin/sa-learn: /usr/bin/perl: bad interpreter: Permission denied',
)
[01-May-2013 13:05:50 +0200]: sa-learn -D --spam --username=redirect /var/www/html/roundcubemail-0.9.0/temp/rcmSALearnMyT9jc 2>&1
[01-May-2013 13:05:50 +0200]: array (
  0 => 'sh: /usr/bin/sa-learn: /usr/bin/perl: bad interpreter: Permission denied',
)
[01-May-2013 13:05:52 +0200]: sa-learn -D --spam --username=redirect /var/www/html/roundcubemail-0.9.0/temp/rcmSALearnlyZ87w 2>&1
[01-May-2013 13:05:52 +0200]: array (
  0 => 'sh: /usr/bin/sa-learn: /usr/bin/perl: bad interpreter: Permission denied',
)
[01-May-2013 13:05:54 +0200]: sa-learn -D --ham --username=redirect /var/www/html/roundcubemail-0.9.0/temp/rcmSALearny8G9Pj 2>&1
[01-May-2013 13:05:54 +0200]: array (
  0 => 'sh: /usr/bin/sa-learn: /usr/bin/perl: bad interpreter: Permission denied',
)
[01-May-2013 13:05:54 +0200]: sa-learn -D --ham --username=redirect /var/www/html/roundcubemail-0.9.0/temp/rcmSALearnQGJVBo 2>&1
[01-May-2013 13:05:54 +0200]: array (
  0 => 'sh: /usr/bin/sa-learn: /usr/bin/perl: bad interpreter: Permission denied',
)
[01-May-2013 13:05:55 +0200]: sa-learn -D --ham --username=redirect /var/www/html/roundcubemail-0.9.0/temp/rcmSALearn0wjMxu 2>&1
[01-May-2013 13:05:55 +0200]: array (
  0 => 'sh: /usr/bin/sa-learn: /usr/bin/perl: bad interpreter: Permission denied',
)

Code: [Select]
[root@test plugins]# php -v
PHP 5.3.24 (cli) (built: Apr 15 2013 11:40:08)
Copyright (c) 1997-2013 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2013 Zend Technologies

[root@test plugins]# cat /etc/centos-release
CentOS release 6.4 (Final)

[root@test tmp]# dovecot --version
2.1.16

[root@test tmp]# exim --version
Exim version 4.76 #1 built 19-Jul-2011 02:56:59
Copyright (c) University of Cambridge, 1995 - 2007
Berkeley DB: Berkeley DB 4.7.25: (November 12, 2010)
Support for: crypteq IPv6 Perl OpenSSL move_frozen_messages Content_Scanning DKIM Old_Demime
Lookups (built-in): lsearch wildlsearch nwildlsearch iplsearch cdb dbm dbmnz
Authenticators: cram_md5 plaintext
Routers: accept dnslookup ipliteral manualroute queryprogram redirect
Transports: appendfile/maildir/mailstore/mbx autoreply lmtp pipe smtp
Size of off_t: 8
Configuration file is /etc/exim.conf


Code: [Select]
<?php

/**
 * MarkAsJunk2 configuration file
 */

// Learning driver
// Use an external process such as sa-learn to learn from spam/ham messages. Default: null.
// Please see the README for more information
$rcmail_config['markasjunk2_learning_driver'] = 'cmd_learn';

// Ham mailbox
// Mailbox messages should be moved to when they are marked as ham. null = INBOX
// set to FALSE to disable message moving
$rcmail_config['markasjunk2_ham_mbox'] = null;

// Spam mailbox
// Mailbox messages should be moved to when they are marked as spam.
// null = the mailbox assigned as the spam folder in Roundcube settings
// set to FALSE to disable message moving
$rcmail_config['markasjunk2_spam_mbox'] = null;

// Mark messages as read when reporting them as spam
$rcmail_config['markasjunk2_read_spam'] = true;

// Mark messages as unread when reporting them as ham
$rcmail_config['markasjunk2_unread_ham'] = false;

// Add flag to messages marked as spam (flag will be removed when marking as ham)
// If you do not want to use message flags set this to null
$rcmail_config['markasjunk2_spam_flag'] = 'Junk';

// Add flag to messages marked as ham (flag will be removed when marking as spam)
// If you do not want to use message flags set this to null
$rcmail_config['markasjunk2_ham_flag'] = null;

// Write output from spam/ham commands to the log for debug
$rcmail_config['markasjunk2_debug'] = true;

// Show icon on mailbox toolbar
// The mark as spam/ham icon can either be displayed on the toolbar or as part of the mark messages menu
$rcmail_config['markasjunk2_mb_toolbar'] = true;

// Show icon on compose toolbar
// The mark as spam/ham icon can either be displayed on the toolbar or as part of the mark messages menu
$rcmail_config['markasjunk2_cp_toolbar'] = true;

// cmd_learn Driver options
// ------------------------
// The command used to learn that a message is spam
// The command can contain the following macros that will be expanded as follows:
//      %u is replaced with the username (from the session info)
//      %l is replaced with the local part of the username (if the username is an email address)
//      %d is replaced with the domain part of the username (if the username is an email address or default mail domain if not)
//      %i is replaced with the email address from the user's default identity
//      %xds is replaced with the X-DSPAM-Signature header
//      %f is replaced with the path to the message file
// If you do not want run the command set this to null
$rcmail_config['markasjunk2_spam_cmd'] = 'sa-learn -D --spam --username=%u %f 2>&1';

// The command used to learn that a message is ham
// The command can contain the following macros that will be expanded as follows:
//      %u is replaced with the username (from the session info)
//      %l is replaced with the local part of the username (if the username is an email address)
//      %d is replaced with the domain part of the username (if the username is an email address or default mail domain if not)
//      %i is replaced with the email address from the user's default identity
//      %xds is replaced with the X-DSPAM-Signature header
//      %f is replaced with the path to the message file
// If you do not want run the command set this to null
$rcmail_config['markasjunk2_ham_cmd'] = 'sa-learn -D --ham --username=%u %f 2>&1';


I'm quite stuck, so I hope anyone could help me figure this out.

Offline twisterbr

  • Jr. Member
  • **
  • Posts: 26
Re: MarkAsJunk2 bad interpreter, permission denied
« Reply #1 on: May 15, 2013, 12:49:15 PM »
check if safe_mode directive is disabled, and disable it if not.