Zimbra offers Open Source email server software and shared calendar for Linux and the Mac
Go Back   Zimbra :: Forums > Zimbra Collaboration Suite > Developers

Welcome to the Zimbra :: Forums!
Welcome, if you would like to post a comment please register. We also encourage you to explore all things Zimbra with our team and members of the community.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #11 (permalink)  
Old 12-06-2005, 02:28 PM
Senior Member
 
Posts: 51
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
File Type: tgz zmtrainsa.tgz (2.0 KB, 183 views)
Reply With Quote
  #12 (permalink)  
Old 12-08-2005, 01:24 AM
Zimbra Consultant & Moderator
 
Posts: 19,653
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
Reply With Quote
  #13 (permalink)  
Old 12-08-2005, 07:15 AM
Senior Member
 
Posts: 51
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..
Reply With Quote
  #14 (permalink)  
Old 01-11-2006, 05:30 PM
Member
 
Posts: 10
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
Reply With Quote
  #15 (permalink)  
Old 01-11-2006, 06:13 PM
Zimbra Employee
 
Posts: 4,792
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.
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
  #16 (permalink)  
Old 01-12-2006, 08:18 AM
Member
 
Posts: 10
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?
Reply With Quote
  #17 (permalink)  
Old 01-12-2006, 10:24 AM
Zimbra Employee
 
Posts: 4,792
Default

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

Code:
su - zimbra
crontab -e
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
  #18 (permalink)  
Old 01-12-2006, 05:20 PM
Member
 
Posts: 10
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!
Reply With Quote
  #19 (permalink)  
Old 01-12-2006, 06:03 PM
Zimbra Employee
 
Posts: 4,792
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 >>
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


Similar Threads

Why Join?

Registering let's you ask questions, makes it easier to search, displays any files attached to posts, and notifies you about replies.

blog.zimbra.com




 

SEO by vBSEO ©2011, Crawlability, Inc.