<commit_before>require_dependency 'bounce_receiver'

class IncomingMailsController < ApplicationController
  require 'mail'
    skip_before_filter :verify_authenticity_token

    def create
      message = Mail.new(params[:message])
      to_address = params[:to]
      if (to_address and to_address.to_s.start_with? 'bounce')
        Rails.logger.info "Received incoming mail correctly"
        BounceReceiver.receive_bounced_email(message.to_s, to_address.to_s)
        render :text => 'success', :status => 200
      else
        Rails.logger.info "Message failed #{message} from incorrect to address: #{to_address}"
        render :text => "Message failed #{message} from incorrect to address: #{to_address}", :status => 404
      end
    end
end<commit_msg>Stripped angle brackets from incoming email to address to handle bounces<commit_after>require_dependency 'bounce_receiver'

class IncomingMailsController < ApplicationController
  require 'mail'
    skip_before_filter :verify_authenticity_token

    def create
      message = Mail.new(params[:message])
      to_address = params[:to].to_s.gsub(/[<>]/, '')
      if (to_address and to_address.to_s.start_with? 'bounce')
        Rails.logger.info "Received incoming mail correctly"
        BounceReceiver.receive_bounced_email(message.to_s, to_address.to_s)
        render :text => 'success', :status => 200
      else
        Rails.logger.info "Message failed #{message} from incorrect to address: #{to_address}"
        render :text => "Message failed #{message} from incorrect to address: #{to_address}", :status => 404
      end
    end
end
{'fraction_non_alphanumeric': 0.09906542056074766, 'fraction_numerical': 0.007476635514018692, 'mean_word_length': 3.808383233532934, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 12, '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': '3944159', 'n_tokens_mistral': 477, 'n_tokens_neox': 453, 'n_words': 123}