Claudio Jeker wrote:

On Wed, Dec 28, 2005 at 04:42:53PM +0530, Sameer N Ingole wrote:
Hi,

I have been trying to add an attribute mailReplyText for an LDAP entry. The message I was trying to store is a multiline message so I was referring to

http://www.nrg4u.com/qmail/QLDAPINSTALL
LDAP_REPLYTEXT (default: "mailReplyText")

I tried to use base64 encoded message for that attribute but it did not work. I got autoreply with encoded message string. But if I set it in plain text (even multiline, but not encoded), it works.


Keep in mind, that many ldap libraries do the base64 encoding and decoding
on the fly. Base64 encoding will only be visible in the LDIF.
Hmm, but OpenLDAP does not seem to be doing it for mailReplyText. I could see plain text message for attribute mailReplyText until I added base64 encoded string.

I am encoding this using PHP function as I am building a web application for mail users.

I used functions like this base64_encode($mymessage) and chunk_split(base64_encode($mymessage)) but both base64 strings failed.

I remeber that doing the right conversion with php is not that easy.
PHP functions:

chunk_split(base64_encode($mymessage))
worked.

An example of an LDAP entry (as in LDIF file) would be a greate help.


Here is an example entry:
dn: uid=test,ou=regress,o=qmail-ldap
objectClass: top
objectClass: qmailUser
objectClass: person
mail: [EMAIL PROTECTED]
uid: test
sn: test
cn: test
mailMessageStore: test
userPassword:: e1NTSEF9UDlSYUhDNkJUN2g4dE4xZDZhdlZmbk9iSmcvTTl1SkY=
mailQuotaSize: 512000
mailQuotaCount: 20
mailReplyText:: JUhFQURFUiUKRnJvbTogIkkgZG8gbm90IGNhcmUiIDxlZGl0ZWRfZm9yX3NwY
W0+ClN1YmplY3Q6ICVTVUJKRUNUJQoKSG1tbW0uCk1vdyBtb3cuCkJvYi1vcC1vcC4KSG1tbW1tb
S4KTW93IG1vdy4K

While unencoded attributes use only one ":" after the attribute name
base64 encoded ones use two ":". If your entry has only one ":" it is not
recognized as base64 encoded entry.
That was the catch. It worked for me now after I added one more ":" in my LDIF file.

Also the userPassword is base64 encoded since it is defined as binary data
in the schema file.
In the end base64 encoding only matters for LDIF files.

I will try adding base64 string using PHP and repost the results.
So far LDIF with base64 string is working for mailReplyText (and multiline messages too).

Thank you Claudio.

Regards,

--
Sameer N. Ingole

Reply via email to