<commit_before>package site

import scala.concurrent.Future
import play.api.Play.current
import play.api.i18n.Messages

object Mail {
  private lazy val mailer = current.plugin[com.typesafe.plugin.MailerPlugin]
  private def getMailer = mailer.getOrElse(throw controllers.ServiceUnavailableException)
  val fromAddr = current.configuration.getString("mail.from").getOrElse("<>")
  val authorizeAddr = current.configuration.getString("mail.authorize").getOrElse("authorize")
  private val fillinKey = new javax.crypto.spec.SecretKeySpec(
    current.configuration.getString("fillin.key").getOrElse("").getBytes,
    "HmacSHA256")

  def available : Boolean = mailer.isDefined
  def check() { getMailer }

  def send(from : String = fromAddr, to : Seq[String], subject : String, body : String) : Future[Unit] = Future {
    val mail = getMailer.email
    mail.setFrom(from)
    mail.setRecipient(to : _*)
    mail.setSubject(subject)
    mail.send(body)
  }(context.process)<commit_msg>Apparently keys can't be empty, so use a stupid one<commit_after>package site

import scala.concurrent.Future
import play.api.Play.current
import play.api.i18n.Messages

object Mail {
  private lazy val mailer = current.plugin[com.typesafe.plugin.MailerPlugin]
  private def getMailer = mailer.getOrElse(throw controllers.ServiceUnavailableException)
  val fromAddr = current.configuration.getString("mail.from").getOrElse("<>")
  val authorizeAddr = current.configuration.getString("mail.authorize").getOrElse("authorize")
  private val fillinKey = new javax.crypto.spec.SecretKeySpec(
    current.configuration.getString("fillin.key").getOrElse("databrary").getBytes,
    "HmacSHA256")

  def available : Boolean = mailer.isDefined
  def check() { getMailer }

  def send(from : String = fromAddr, to : Seq[String], subject : String, body : String) : Future[Unit] = Future {
    val mail = getMailer.email
    mail.setFrom(from)
    mail.setRecipient(to : _*)
    mail.setSubject(subject)
    mail.send(body)
  }(context.process)
{'fraction_non_alphanumeric': 0.11811414392059554, 'fraction_numerical': 0.004962779156327543, 'mean_word_length': 4.8604651162790695, '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': '1634663', 'n_tokens_mistral': 638, 'n_tokens_neox': 606, 'n_words': 128}