+ sprintf(filter, "(&(objectClass=user)(proxyAddresses=smtp:%s))", mail);
+ attr_array[0] = "cn";
+ attr_array[1] = NULL;
+
+ if ((rc = linklist_build(ld, bind_path, filter, attr_array,
+ &group_base, &group_count,
+ LDAP_SCOPE_SUBTREE)) != 0)
+ {
+ com_err(whoami, 0, "Unable to process contact %s : %s",
+ user, ldap_err2string(rc));
+ return(rc);
+ }
+
+ if (group_count)
+ {
+ com_err(whoami, 0, "Object already exists with name %s",
+ user);
+ return(1);
+ }
+
+ linklist_free(group_base);
+ group_base = NULL;
+ group_count = 0;
+
+ sprintf(filter, "(&(objectClass=group)(proxyAddresses=smtp:%s))", mail);
+ attr_array[0] = "cn";
+ attr_array[1] = NULL;
+
+ if ((rc = linklist_build(ld, bind_path, filter, attr_array,
+ &group_base, &group_count,
+ LDAP_SCOPE_SUBTREE)) != 0)
+ {
+ com_err(whoami, 0, "Unable to process contact %s : %s",
+ user, ldap_err2string(rc));
+ return(rc);
+ }
+
+ if (group_count)
+ {
+ com_err(whoami, 0, "Object already exists with name %s",
+ user);
+ return(1);
+ }
+