On Thu, Apr 11, 2002 at 12:17:06PM +0200, Igor Stroh wrote:
> The problem is, ldap does not accept characters beyond range(127), so
> trying to insert a text that contains e.g. umlauts will raise an error.
> This is, I guess, why the 'mailReplyText' should be base64-encoded.
Let the ldap tools lety the work do for you...
(shortened)
sub autoresponder {
$vals{"mailReplyText"}=$_[2];
my $ldap = Net::LDAP->new($bswscc::ldapHost) or die "$@";
my $msg = $ldap->search (
base => "ou=customer, dc=bsws, dc=de",
filter => "uid=$_[0]",
);
my $ret=$msg->code;
if ( $ret == 0 ) {
my $cnt = $msg->entries;
if ( $cnt != 1 ) { $ret=999; }
}
if ( $ret == 0 ) {
my $dn=$msg->entry(0)->dn;
$msg = $ldap->bind(dn => $bswscc::ldapDN_ADM, password => $bswscc::ldapPW);
$msg = $ldap->modify($dn, replace => { %vals });
$ret=$msg->code;
}
return $ret;
}
--
| Henning Brauer | PGP-Key: http://misc.bsws.de/hb/pubkey.asc
| BS Web Services | Roedingsmarkt 14, 20459 Hamburg, DE | http://bsws.de
Unix is very simple, but it takes a genius to understand the simplicity.
(Dennis Ritchie)