Results 1 to 5 of 5

Thread: Webapp spam integration plugin

  1. #1
    Junior Member
    Join Date
    Jul 2012
    Posts
    9

    [SOLVED] Webapp spam integration plugin

    Hej there,

    I tried to bring up the Webapp spam integration plugin together with Spamassassin and Amavis.

    The setup is: Amavis is called by Postfix, and thus Spamassassin is called by Amavis if needed. If in the end a mial is marked as spam it is moved to the junk folder dagent.

    To improve the spam filter I added the Webapp spam integration plugin, and configured it as:

    Code:
    define('PLUGIN_SPAMTRAIN_TRAIN_SPAM_CMD', '/usr/bin/sa-learn -D --mbox --spam --dbpath /var/spool/amavisd/.spamassassin/');
    define('PLUGIN_SPAMTRAIN_TRAIN_HAM_CMD', '/usr/bin/sa-learn -D --mbox --ham --dbpath /var/spool/amavisd/.spamassassin/');
    The dbpath is altered due to the fact that amavis has its own path and database for that.

    This looks good:
    Code:
    DEBUG: Command '/usr/bin/sa-learn -D --spam --mbox --dbpath /var/spool/amavisd/.spamassassin/' finished with status 0
    DEBUG: Deleting message...
    DEBUG: Message deleted
    DEBUG: exit::trainspam (result=true)
    But the bayes tokens do not change, the message is not learned! There are no new tokes added to the Bayes DB.

    To further analyze the problem I extraceted the mail from the /tmp/ spamtrain-log and fed it to sa-learn manually:
    Code:
    cat spammessge.txt|/usr/bin/sa-learn --spam  --dbpath /var/spool/amavisd/.spamassassin
    Learned tokens from 1 message(s) (1 message(s) examined)
    There I realized that I have to omit the --mobx, because the message would not have been detected correctly.

    Given that, I changed the plugin configuration and removed the --mbox. However, that resulted in:

    Code:
    ERROR: Command '/usr/bin/sa-learn -D --spam --dbpath /var/spool/amavisd/.spamassassin/' finished with status 13
    DEBUG: exit::trainspam (result=false)
    (Taken from /tmp/spamtrain.log)

    So I do wonder: is the message transformed into mbox before it is fed to sa-learn? And if so, what is wrong with the plugin, because nothing is learned?

    Cheers,

    liquidat
    Last edited by liquidat; 17-12-2012 at 07:19 PM. Reason: Added [SOLVED] tag.

  2. #2
    Hi liquidat,

    the plugin feeds the message to the command exactly as it is written to the log file. So your test to invoke sa-learn manually is the best way to analyze the problem. You have to make sure that you use the same user as the httpd process. Googling for "sa-learn error code 13" indicates a "permission denied" error. I guess this is due to the httpd user not having the necessary access rights.

    Please report back if this was the actual cause of the issue. I derived the sa-learn command line from the SA docs, because I am using DSPAM for myself. If the sa-learn command line is incorrect in the plugin howto I will update it accordingly.

    Kind Regards,
    Holger

  3. #3
    Junior Member
    Join Date
    Jul 2012
    Posts
    9
    Hej Holger,
    thanks for the input! You were right, the problem were with the rights:
    Code:
    su -s /bin/bash apache -c 'cat spammessge.txt|/usr/bin/sa-learn --forget --dbpath /var/spool/amavisd/.spamassassin'
    bayes: expire_old_tokens: locker: safe_lock: cannot create tmp lockfile /var/spool/amavisd/.spamassassin/bayes.lock.sinoda.bayz.de.11456 for /var/spool/amavisd/.spamassassin/bayes.lock: Keine Berechtigung
    plugin: eval failed: bayes: (in forget) locker: safe_lock: cannot create tmp lockfile /var/spool/amavisd/.spamassassin/bayes.lock.sinoda.bayz.de.11456 for /var/spool/amavisd/.spamassassin/bayes.lock: Keine Berechtigung
    Forgot tokens from 0 message(s) (1 message(s) examined)
    ERROR: the Bayes learn function returned an error, please re-run with -D for more information at /usr/bin/sa-learn line 493.
    The folder /var/spool/amavisd/.spamassassin was owned by amavis:amavis and rwx------ . So in the end there are the two simple options to either add apache to the group amavis or to hand over the files to the user apache. In any case, the files need to be accessible and writable by the group-owner.

    I went for the second solution, changed the group owner to apache. After the changes were made everything worked fine =)

    Cheers,
    liquidat
    Last edited by liquidat; 17-12-2012 at 07:20 PM. Reason: Removed request to modify the subject - I realized I can do that on my own. =)

  4. #4

  5. #5
    Hi,

    Does anyone know if this plugin works with Kopano or webapp 3.1.1?

    I have tried it today and when I select something to Junk it comes up with:

    ERROR: Unable to retrieve message headers


    Thanks.

Similar Threads

  1. MDM 2.1 plugin does not seem to work with Webapp 1.1.35262
    By oliverd in forum Zarafa WebApp Plugins
    Replies: 2
    Last Post: 30-08-2013, 12:59 PM
  2. install plugin WebApp sample code
    By zapp in forum Zarafa WebApp Plugins
    Replies: 1
    Last Post: 15-07-2012, 09:43 AM
  3. Skype Integration with WebApp
    By caldwell in forum WebApp
    Replies: 2
    Last Post: 15-04-2012, 12:53 PM
  4. Help Developing Plugin WebApp
    By dragem in forum WebApp
    Replies: 3
    Last Post: 04-03-2012, 12:20 PM
  5. rules to move spam to public spam folder
    By thomasjohansen in forum Installation and Configuration Archives
    Replies: 2
    Last Post: 17-12-2010, 03:27 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •