Results 1 to 10 of 19

Thread: Rewrote zmtrainsa for DSPAM

Hybrid View

  1. #1
    Join Date
    Nov 2005
    Posts
    51
    Rep Power
    10

    Default Rewrote zmtrainsa for DSPAM

    I rewrote zmtrainsa to make it a bit more scalable as a training tool for spam filters. My version now grabs the spam or ham messages, and stores them temporarily so more then one spam trainer can take a look at it. Currently I have to split these functions up into two files because of fetchmail's limitations. Right now SA Bayes and DSPAM will be trained. If DSPAM is not installed it will ignore training DSPAM. Also I assumed that dspam was installed in /opt/dspam/bin. If your install is elsewhere change the DSPAMDIR variable in each file. Also, the temp location used is /tmp/sa. That can be changed with the TEMPDIR variable in zmtrainfilter. Run zmtrainsa with its normal usage, zmtrainfilter is really just a support file. Take a look at the files if you need them. The zmtrainsa script now needs zmtrainfilter to run. Although zmtrainfilter doesn't necessarily need zmtrainsa for single file input. I'll comment the code better when I get time. If you have any problems, or don't know why I did something let me know.

    -Ben

    Download latest fix on the second page of posts.
    The files are compressed and attached as zmtrainsa.tgz
    Attached Files Attached Files
    Last edited by unilogic; 12-06-2005 at 06:49 PM.

  2. #2
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,587
    Rep Power
    58

    Default

    Hi

    Unfortunately your scripts don't work for me. the first problem is that zmtrainsa doesn't recognise that zmtrainfilter is in the same directory and I've previously had a problem with zmtrainsa that was resolved by a new script from marcmac in this thread zmtrainsa

    Although the new zmtrainsa script was for a problem with spaces in folder names your script exhibits the same problem even if the folder has a single name i.e. Junk.
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  3. #3
    Join Date
    Nov 2005
    Posts
    51
    Rep Power
    10

    Default

    Try out this fix, it should fix the above problems. Although I have no idea why it can't filter zmtrainfilter, but I did change that around a bit so hopfully it'll work. The folders with spaces problem carried over from the orignal zmtrainsa that came with M2. Sorry about that. Let me know if it still doesn't work.

    Ben
    Attached Files Attached Files

  4. #4
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,587
    Rep Power
    58

    Default

    Tried that fix and it now finds the zmtrainfilter but gives the following error:

    Code:
    $ zmtrainsa server user password spam junk
    /opt/zimbra/bin/zmtrainsa: line 70: /opt/zimbra/.fetchmailrc: No such file or directory
    chmod: cannot access `/opt/zimbra/.fetchmailrc': No such file or directory
    Enter password for bpye@chinook:
    fetchmail: lock creation failed.
    
    Syncing SA bayes database
    
    Cleaning up DSpam, this may take a while
    dspam_clean starting
    PROCESSING USER: zimbra
    Processing sigs; age: 14
    Signature: 438f67a5116903652140007
        Created: Thu Dec  1 00:00:00 2005
    
    Signature: 438f67a5116911847784999
        Created: Thu Dec  1 00:00:00 2005
    
    ...... plus a lot more of the above messages.......
    I did enter the correct user password when asked.
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  5. #5
    Join Date
    Nov 2005
    Posts
    51
    Rep Power
    10

    Default

    Ah yes, the problem is that its trying to create a file as the zimbra user in the /opt/zimbra folder which zimbra actually has no rights to. So I can either put the .fetchmailrc file in a different place say $TMPDIR or you can chown zimbra:zimbra to /opt/zimbra. Sorry about these mistakes. I've done alot to my install so alot of things aren't at default anymore and I overlook them. I've attached the fixed scripts. Let me know if you have any problems.

    -Ben
    Attached Files Attached Files

  6. #6
    phoenix is offline Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,587
    Rep Power
    58

    Default

    Hi

    I'm not sure if you wanted me to make any changes for this test but I ran it 'as is' and got these results:

    Code:
    rm: cannot get current directory: Permission denied
    mkdir: cannot create directory `/tmp/sa': File exists
    fetchmail: lock creation failed.
    
    Syncing SA bayes database
    
    Cleaning up DSpam, this may take a while
    dspam_clean starting
    PROCESSING USER: zimbra
    Processing sigs; age: 14
    Signature: 438f67a5116903652140007
        Created: Thu Dec  1 00:00:00 2005
    
    .................. lots more of the above and then this 
    
    Processing probabilities; age: 0
    Processing unused; any: 90 quota: 30 nospam: 15 onehit: 15
    
    Cleaning up temp files
    rm: cannot get current directory: Permission denied
    Done!
    Thanks for your effort with this.
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

Similar Threads

  1. zmtrainsa ham learning error
    By lzmarine in forum Administrators
    Replies: 3
    Last Post: 10-10-2007, 12:41 PM
  2. How can I fix zmtrainsa?
    By ms2k in forum Administrators
    Replies: 11
    Last Post: 04-16-2007, 11:11 AM
  3. Replies: 3
    Last Post: 12-18-2006, 11:50 PM
  4. spamassassin not learn, zmtrainsa ignores junked mail
    By lukefilewalker in forum Administrators
    Replies: 0
    Last Post: 11-20-2006, 09:36 AM

Posting Permissions

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