Excerpts from micah anderson's message of Thu Nov 12 10:35:59 -0500 2009: > > spam = thread.labels.member? :spam > > what = spam ? 'spam' : 'ham' > > I'm curious about this 'what' piece. It seems like it is a way to > specify the message as 'spam' or 'ham', which is the second half of the > puzzle: go into my Spam source and review the messages there, if there > is a incorrectly categorized as spam message, I would typically stuff > that into Mistakes as well. It seems like you *have* built this into > this hook, but I don't understand how it is able to determine one from > the other? There is the 'S' mark-as-spam key, but there is no 'H' > mark-as-ham :)
There's only 'S' and the mark-as-spam hook, but you can tell whether the user has marked the thread as spam or ham by checking the labels. If the thread is labelled 'spam', it's spam. > Yeah, I had realized this thread problem when I saw that the thread > variable was available for this hook. I think that this is mostly ok, I > think getting threaded spam is somewhat unusual... but I will pay > attention to see how frequently this happens. In the case that it > happens, i'll probably fire up mutt, categorize it as Spam, and then > re-index my sup index, which is what I was doing before. If you can configure your spam filter so it reads from two folders, 'spam' and 'ham', then you can safely store extra messages in them (assuming you don't have true-spam threaded with true-ham). My own setup is slightly different - I write the raw message to a tempfile and run sa-learn on it with --spam or --ham. > > We should also have a Thread#each_message which ignores any > > result of Thread#each that isn't a Message. These two changes would make > > the hook above a lot less magical. What other API changes could we do > > to make writing hooks easier? > > Would that make it so the above thread problem would go away? Nope, it would just mean easier iteration over the messages in a thread. _______________________________________________ sup-talk mailing list sup-talk@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-talk