<commit_before># config/initializers/email.rb

config = YAML.load(ERB.new(IO.read(File.join(Rails.root, 'config', 'email.yml'))).result)[Rails.env].with_indifferent_access

settings = {
	address: config['email_address'],
	domain: config['email_domain'],
}
settings[:port] = config['email_port'] if config['email_port'].present?
settings[:user_name] = config['email_user_name'] if config['email_user_name'].present?
settings[:password] = config['email_password'] if config['email_password'].present?
settings[:authentication] = config['email_authentication'] if config['email_authentication'].present?
settings[:return_path] = config['email_return_path'] if config['email_return_path'].present?
settings[:enable_starttls_auto] = config['email_enable_starttls_auto'] if config['email_enable_starttls_auto'].present?
MAIL_SENDER = config['email_sender'] || '<EMAIL>'

ActionMailer::Base.smtp_settings = settings

ActionMailer::Base.default_url_options[:host] = ActionMailer::Base.smtp_settings[:return_path]

if config['deliver_email'] != 'true'
	ActionMailer::Base.register_interceptor(StagingMailInterceptor)
	emails = config['mail_intercept_recipients'] || ""
	MAIL_INTERCEPT_RECIPIENTS = emails.split(/[^\w\.@+-]+/)
end<commit_msg>Fix bug in turning off the email interceptor.<commit_after># config/initializers/email.rb

config = YAML.load(ERB.new(IO.read(File.join(Rails.root, 'config', 'email.yml'))).result)[Rails.env].with_indifferent_access

settings = {
	address: config['email_address'],
	domain: config['email_domain'],
}
settings[:port] = config['email_port'] if config['email_port'].present?
settings[:user_name] = config['email_user_name'] if config['email_user_name'].present?
settings[:password] = config['email_password'] if config['email_password'].present?
settings[:authentication] = config['email_authentication'] if config['email_authentication'].present?
settings[:return_path] = config['email_return_path'] if config['email_return_path'].present?
settings[:enable_starttls_auto] = config['email_enable_starttls_auto'] if config['email_enable_starttls_auto'].present?
MAIL_SENDER = config['email_sender'] || '<EMAIL>'

ActionMailer::Base.smtp_settings = settings

ActionMailer::Base.default_url_options[:host] = ActionMailer::Base.smtp_settings[:return_path]

if "#{config['deliver_email']}" != 'true'
	ActionMailer::Base.register_interceptor(StagingMailInterceptor)
	emails = config['mail_intercept_recipients'] || ""
	MAIL_INTERCEPT_RECIPIENTS = emails.split(/[^\w\.@+-]+/)
end
{'fraction_non_alphanumeric': 0.16073570571771292, 'fraction_numerical': 0.0, 'mean_word_length': 10.12, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '5741155', 'n_tokens_mistral': 802, 'n_tokens_neox': 793, 'n_words': 108}