  def self.destroy_by_user(user_id, add_con=nil)

    SqlHelper.validate_token([user_id])

    con = "(user_id=#{user_id.to_i})"
    con << " and (#{add_con})" unless add_con.nil? or add_con.empty?
    mail_accounts = MailAccount.where(con).to_a

    mail_accounts.each do |mail_account|
      mail_account.destroy
    end
  end
The software constructs all or part of an SQL command using externally-influenced input from an upstream component, but it does not neutralize or incorrectly neutralizes special elements that could modify the intended SQL command when it is sent to a downstream component.