def lookup_mail(cn)
      service&.search(base: tree,
                     filter: Net::LDAP::Filter.equals('cn', cn),
                     attributes: 'mail')&.first&.mail&.first.to_s
    end
def lookup_mail(cn)
      service&.search(base: tree,
                     filter: Net::LDAP::Filter.equals('cn', cn),
                     attributes: 'mail')&.first&.mail&.first.to_s
    end
Returns the mail for a given CN attribute