Thanks to everyone who had a look at my LDAP problem. I investigated a little
deeper how sqwebmail retrieves LDAP entries and it seems that it calls a
short wrapper script called ldapsearch, which can be found in the
/usr/lib/courier/sqwebmail
directory (at least in my Debian distribution). This wrapper does not much
more than calling the command line tool ldapsearch and limits the number
of entries that this tool retrieves. To solve my problem, I wrote a short
perl script (my first ever) to filter the output of ldapsearch in such a
way that the base64 part is decoded. For those interested the script can
be found below.
One problem remains: As some of you pointed out, the characters are utf-8
encoded, which are not displayed correctly. I switched the characterset
of sqwebmail to utf-8 but then my emails started looking strange. I had
a closer look at my mails and found out that most of them are ASCII or either
ISO-8859-1 or ISO-8859-15.
I guess I see two solutions to this issue:
1. convert the output of ldap to iso-8859-15
2. convert all special characters from ldap to their HTML equivalent i.e.
�->ü etc.
OR do you know a way in sqwebmail that would display both utf-8 and iso-8859-1
correctly?
Which of these solutions would you prefer? I feel the second one would always
work, but it is not really the job of a filter at this level to format the
output for the display.
Any suggestions?
as promised, here is the filter:
----------%<---------------------%<---------------
#! /usr/bin/perl
use MIME::Base64;
while (<STDIN>) {
@currentLine = split ,,2;
$sub=substr($currentLine[0],-2);
if ($sub =~ /::/) {
$currentLine[0] = substr($currentLine[0],0,-1);
$currentLine[1] = decode_base64($currentLine[1]);
}
print "@currentLine\n";
}
---------------%<-------%<-----------------%<--------
Jens
________________________________________
http://www.epost.de - das Kommunikationsportal der Deutschen Post