  def self.get_for(user, mail_account_id, xtype)

    return nil if user.nil? or mail_account_id.blank?

    if user.kind_of?(User)
      user_id = user.id
    else
      user_id = user.to_s
    end

    SqlHelper.validate_token([user_id, mail_account_id, xtype])

    con = []
    con << "(user_id=#{user_id})"
    con << "(mail_account_id=#{mail_account_id})"
    con << "(xtype='#{xtype}')"

    return MailFolder.where(con.join(' and ')).first
  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.