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
  #1 (permalink)  
Old 02-06-2006, 10:16 AM
Junior Member
 
Posts: 5
Default Zimbra sql schema and mail store?

I want to write a script to automatically train spam assassin. I plan on using read messages in the inbox as ham and the contents of the junk folder as spam.

I've figured out how to get user/folder read/unread status out of mysql I think:

zimbra.mailbox.id corresponds to mailboxx db and zimbra/store/0/x/msg
and mailboxx.mail_item.folder_id corresponds to the imap folders
and unread is boolean

what I'm missing is how to infer the directory under zimbra/store/ and the directory under zimbra/store/x/x/msg/
Reply With Quote
  #2 (permalink)  
Old 02-06-2006, 10:26 AM
Zimbra Employee
 
Posts: 2,103
Default auto training

Wouldn't it be easier to start with the zmtrainsa script, and use fetchmail to only grab read messages from the folder? Or, move all read messages to a secondary folder and grab them from that?

Much more straightforward than grabbing the data from sql.
Reply With Quote
  #3 (permalink)  
Old 02-06-2006, 10:36 AM
Junior Member
 
Posts: 5
Default

needing the password for fetchmail is a limitation I can't work around.

I don't think this is particullarly difficult, all I need to know is where the 0,1... comes from after store and msg.

unless there is a way to grant fetchmail imap access without passwords?
Reply With Quote
  #4 (permalink)  
Old 02-06-2006, 10:42 AM
Zimbra Employee
 
Posts: 4,792
Default

Are you trying to use fetchmail for each user's account? Why not just use the built in support of Junk and Not Junk buttons that copies the messages to special SPAM and HAM system accounts.

Problem with zmtrainsa
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
  #5 (permalink)  
Old 02-06-2006, 10:48 AM
Junior Member
 
Posts: 5
Default

that sounds good, I didn't realise that existed, however, since the "not junk" button is only in the spam folder, and practically nothing is being marked spam now, it will take a long time to get the necessary ham.

does that get triggered when a user just moves their spam to the junk folder? I have had little luck convincing anyone to use the web interface.
Reply With Quote
  #6 (permalink)  
Old 02-06-2006, 11:14 AM
Zimbra Employee
 
Posts: 4,792
Default

Yes those copies are trigger on the web UI only.
__________________
Bugzilla - Wiki - Downloads - Offline Client
Reply With Quote
  #7 (permalink)  
Old 02-06-2006, 12:35 PM
Junior Member
 
Posts: 5
Default

anyway, I wrote my script, it is 50 lines, it messily finds those directories I couldn't figure out how to pull from the database by checking if its zero and incrementing from there. then feeds the messages to sa-learn.
Reply With Quote
  #8 (permalink)  
Old 02-07-2006, 11:18 AM
Zimbra Employee
 
Posts: 78
Default

Here's a snippet of Perl that calculates the mailbox group directory, based on the mailbox id.
Code:
sub getMailboxGroupDir($) {
    # Assume that the volume bits settings are hardcoded for now
    my ($mailboxId) = @_;
    my $groupDir = $mailboxId >> 12;
    $groupDir &= 0xFF;
    return $groupDir;
}
Reply With Quote
  #9 (permalink)  
Old 02-09-2006, 09:31 AM
Junior Member
 
Posts: 5
Default

looks good, thanks
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.