On 31/1/2012 4:30 μμ, Charles T. Brooks wrote:
You could always make an LDIF with your preferred awk
ldapsearch -x -LLL -Dcn=manager,dc=example,dc=com -W 'mail=*' mail|gawk '/^dn/{printf "%s\nchangetype: modify\nadd: acceptedEmail\n", $0};/^mail/{printf "acceptedEmail: %s\n\n", $2}'
and pipe it to ldapadd/ldapmodify... if you need to add the objectClass as well, just modify the printf on the /^dn/ pattern.
Seems like you might be independently recreating the Lachman schema, though.
Thanks Charles,
Your solution looks fine. Obviously ldapmodify cannot use existing data directly for new entries.
I didn't know of Lachman schema, I guess you mean: http://www.sendmail.org/m4/laser.txt (which I found with a bit of googling).
I'll take a look. From a first glance, however, it is more extensive than what I want. In fact, I want to disassociate mail attribute from use in our applications (mainly Postfix), and I want to use a different attribute for that use.
Can I find the Lachman schema anywhere in a complete form, ready for Openldap?
Nick
openldap-technical@openldap.org