<commit_before>class InboundMailProcessor
  def self.queue
    :inbound_mail
  end

  def self.perform(mail_id)
    mail = InboundMail.find(mail_id)
    to_address = mail.message.to.first
    thread_match = to_address.match(/^thread-([^@]+)/)
    message_match = to_address.match(/^message-([^@]+)/)
    deliver_thread_reply(mail, thread_match.try(:[], 1), message_match.try(:[], 1))
  end

  def self.deliver_thread_reply(mail, thread_token, message_token)
    message = Message.find_by(public_token: message_token)<commit_msg>Stop logging emails without valid tokens<commit_after>class InboundMailProcessor
  def self.queue
    :inbound_mail
  end

  def self.perform(mail_id)
    mail = InboundMail.find(mail_id)
    to_address = mail.message.to.first
    thread_token = to_address.match(/^thread-([^@]+)/).to_a[1]
    message_token = to_address.match(/^message-([^@]+)/).to_a[1]
    return unless thread_token || message_token
    deliver_thread_reply(mail, thread_token, message_token)
  end

  def self.deliver_thread_reply(mail, thread_token, message_token)
    message = Message.find_by(public_token: message_token)
{'fraction_non_alphanumeric': 0.12644701691896706, 'fraction_numerical': 0.003561887800534283, 'mean_word_length': 4.764102564102564, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6523821', 'n_tokens_mistral': 385, 'n_tokens_neox': 377, 'n_words': 64}