log "Registering message #{thread.containers[0].message.id} as spam.  Subject is #{thread.containers[0].message.subj}'"
thread.each { |m, *o|
  if m
    if m.has_label? :unsure
      IO.popen("bogofilter -s", "w") {|f|
        f.puts thread.first.raw_message
      }
    else
      IO.popen("bogofilter -Ns", "w") {|f|
        f.puts thread.first.raw_message
      }
    end
  end
}
thread.remove_label :unsure

