Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

Thread: Rewrote zmtrainsa for DSPAM

  1. #11
    unilogic is offline Senior Member
    Join Date
    Nov 2005
    Posts
    51
    Rep Power
    9

    Default

    Alright I think this should do it. The problem was fetchmail wants to make its lock file, .fetchmail.pid, in zimbra's home directory /opt/zimbra. Since /opt/zimbra is owned by root it didn't have write premissions. What I did was just set the enviroment variable HOME to the temp directory, so now fetchmail thinks zimbra's home directory is the temp directory. I wasn't catching this error again since I had /opt/zimbra chowned to zimbra, which is probably a security risk. Give this new copy a try it should work.

    -Ben
    Attached Files Attached Files

  2. #12
    phoenix is online now Zimbra Consultant & Moderator
    Join Date
    Sep 2005
    Location
    Vannes, France
    Posts
    23,480
    Rep Power
    56

    Default

    Many thanks for that, it worked a treat. The only thing that looks a bit odd is the 'training' message, it start at zero and I guess the formatting is slightly out.

    Code:
    Training SA with message: 1000000000000000 as spam
    .
    Learned from 1 message(s) (1 message(s) examined).
    
    Training DSpam with message: 1000000000000000 as spam
    Regards


    Bill


    Acompli: A new adventure for Co-Founder KevinH.

  3. #13
    unilogic is offline Senior Member
    Join Date
    Nov 2005
    Posts
    51
    Rep Power
    9

    Default

    On line 43 of zmtrainfilter:

    if [ ! -f $TMPDIR/last ]; then
    curCount=1000000000000000
    elif [ -e $TMPDIR/last ]; then

    becomes:

    if [ ! -e $TMPDIR/last ]; then
    curCount=1000000000000001
    elif [ -e $TMPDIR/last ]; then

    so it will match fetchmail's messages count (just an appearance fix). Fetchmail's output is a bit dirty to begin with. I'm glad I could get it working for you, and that you can use it.

    Regards,
    Ben
    Last edited by unilogic; 12-08-2005 at 07:18 AM.

  4. #14
    Justin is offline Member
    Join Date
    Dec 2005
    Posts
    10
    Rep Power
    9

    Default Cron entries for zmtrainsa

    I understand that zmtrainsa is supposed to be run periodically via cron, but I'm a bit fuzzy as to the specifics. Would somebody be so kind as to let me know exactly what the relevant cron entries should be, and where they should be entered? I've looked for this information both in the PDF docs and the forums here, but I haven't come up with anything so far.

    Many thanks!

    Justin

  5. #15
    KevinH's Avatar
    KevinH is offline Expert Member
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    18

    Default

    Quote Originally Posted by Justin
    I understand that zmtrainsa is supposed to be run periodically via cron, but I'm a bit fuzzy as to the specifics. Would somebody be so kind as to let me know exactly what the relevant cron entries should be, and where they should be entered? I've looked for this information both in the PDF docs and the forums here, but I haven't come up with anything so far.

    Many thanks!

    Justin
    Basically you create a cron task for the interval you want (once a day) and just run the command. See the usage of the command for options.
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  6. #16
    Justin is offline Member
    Join Date
    Dec 2005
    Posts
    10
    Rep Power
    9

    Default Specifics

    Quote Originally Posted by KevinH
    Basically you create a cron task for the interval you want (once a day) and just run the command. See the usage of the command for options.
    Thanks for the quick response, Kevin. I was actually looking for specific command examples. I assume the following two commands would suffice?

    Code:
    /opt/zimbra/bin/zmtrainsa localhost spamreporter@domain.com acct_pass spam
    /opt/zimbra/bin/zmtrainsa localhost hamreporter@domain.com acct_pass ham
    I seem to recall reading that Zimbra has its own crontab somewhere. Is it safe to assume that the above commands should be put there? What is the exact path to the file in which these commands should be inserted?

  7. #17
    KevinH's Avatar
    KevinH is offline Expert Member
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    18

    Default

    Commands look good. For te crantab just edit the zimbra user.

    Code:
    su - zimbra
    crontab -e
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

  8. #18
    Justin is offline Member
    Join Date
    Dec 2005
    Posts
    10
    Rep Power
    9

    Default Cron entries for zmtrainsa -- followup

    Thank you for pointing me in the right direction, Kevin. Here are the entries I plan on entering into the Zimbra crontab:

    Code:
    # Daily spam/ham training for DSpam and Spam Assassin
    * 2 * * * /opt/zimbra/bin/zmtrainsa localhost spamreporter@domain.com acct_pass spam > /opt/zimbra/log/zmtrain-spam.log 2>&1
    * 2 * * * /opt/zimbra/bin/zmtrainsa localhost hamreporter@domain.com acct_pass ham > /opt/zimbra/log/zmtrain-ham.log 2>&1
    I assume these entries would run at 2:00 AM every night and append any output to the relevant new log files. Did I get these cron entries right?

    Also, I realized that I was never prompted for passwords when the spam/ham reporting email addresses were created during initial Zimbra set-up. What should be entered in the "acct_pass" placeholders above?

    Many thanks for all your help, Kevin!

  9. #19
    KevinH's Avatar
    KevinH is offline Expert Member
    Join Date
    Aug 2005
    Location
    San Mateo, CA
    Posts
    4,789
    Rep Power
    18

    Default

    Looks good. You can use zmprov to set a password. BTW: With only one > the files will be new each night if you want append use >>
    Looking for new beta users -> Co-Founder of Acompli. Previously worked at Zimbra (and Yahoo! & VMware) since 2005.

Page 2 of 2 FirstFirst 12

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. zmtrainsa ham learning error
    By lzmarine in forum Administrators
    Replies: 3
    Last Post: 10-10-2007, 11:41 AM
  2. How can I fix zmtrainsa?
    By ms2k in forum Administrators
    Replies: 11
    Last Post: 04-16-2007, 10: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
  •