From: zacheiss Date: Wed, 2 Sep 2009 19:17:35 +0000 (+0000) Subject: Handle mail routing for users with no pobox. X-Git-Url: http://andersk.mit.edu/gitweb/moira.git/commitdiff_plain/5d55a4bce36579236531c8fc19ed77e0b47d180c Handle mail routing for users with no pobox. --- diff --git a/incremental/ldap/winad.c b/incremental/ldap/winad.c index 7520d048..fa6f3ea5 100755 --- a/incremental/ldap/winad.c +++ b/incremental/ldap/winad.c @@ -4346,6 +4346,20 @@ int user_update(LDAP *ldap_handle, char *dn_path, char *user_name, user_name, ldap_err2string(rc)); } } + } else if(rc==MR_NO_MATCH) { + + n = 0; + ADD_ATTR("mailRoutingAddress", mail_routing_v, LDAP_MOD_REPLACE); + mods[n] = NULL; + rc = ldap_modify_s(ldap_handle, distinguished_name, mods); + + if (rc == LDAP_ALREADY_EXISTS || rc == LDAP_TYPE_OR_VALUE_EXISTS) + rc = LDAP_SUCCESS; + + if(rc) + com_err(whoami, 0, + "Unable to set the mailRoutingAddress for %s : %s", + user_name, ldap_err2string(rc)); } moira_disconnect(); }