scratchpad
submersible_toaster
<code>
# Kitty - your client code.
#!/usr/bin/perl -w
use warnings;
use strict;
use IO::Socket::INET;
my $client;
my $server;
my $remote_port = 8100;
my $remote_host = "localhost";
my $line;
$server = IO::Socket::INET->new( PeerAddr => $remote_host,
PeerPort => $remote_port,
Proto => "tcp",
Type => SOCK_STREAM ) or die "Couldn't connect to $remote_host: $!\n";
print $line = <$server>;
close $server;
# Server code.
#!/usr/bin/perl -w
use strict;
use IO::Socket::INET;
my $server_port = 8100;
my $client;
my $line;
my $server = IO::Socket::INET->new(
LocalPort => $server_port,
Type => SOCK_STREAM,
Reuse => 1,
Listen => 10 ) or die
"Could not create a tcp server on port $server_port : $!\n";
while( $client = $server->accept() )
{
open( FH, "<data.txt" ) or die "Couldn't open 'data.txt' : $!\n";
rand( $. ) < 1 and ( $line = $_ ) while <FH>;
close FH;
print $client "$line\n";
}
</code>
Testing... testing....
<p>After outlining my dilemma in [236173|this node] , the
subsequent research lead me to a product that is being touted as
a "MS Exchange Killer". The general sway of the project is to provide
MS outlook clients with the necessary 'services' to leverage
MOST of the groupware functionality that Exchange gives. Cost, scalability
and performance are the areas that are its hilights.</p>
<p>Great toaster, so WTF is this all about then... OK - check out the
information on [http://bynari.net/index.php?id=1169|Insight Server] , [http://bynari.net/index.php?id=7|Insight Connector] and
[http://bynari.net/index.php?id=8|Insight LDAP Client], all at [http://www.bynari.net].
In simple terms, the two Middleware plugins for outlook (Connector and LDAP Client), are installed
and configured to point to Insight Server.</p>
<p><h2>The Server</h2><br>
The server is kind of complicated, although it was one of the simplest
installation dances I have ever performed. There are three main components.<br>
<ul>
<li>exim : <p>Used as the MTA for the server it is responsible for
relaying SMTP , and for local delivery of messages into the cyrusIMAP mailstore</p></li>
<li>cyrusIMAPd : <p>Rather than storing imap folders as one huge concatenated blob, cyrus is
configured to stash mail in a simple database , keeping indexes etc - it's performance
on a mailbox with thousands of messages is great so far - as I would expect. I'm not going
to explain why/how - it's a database OK, the lookups are lookups not IO/CPU bound grep-to-death.</p></li>
<li>openLDAP : <p>all user information is kept in an LDAP accesible directory, it makes a
real boon for the Outlook client to have a 'Global Addressbook' type access to the directory, authentication
is also done using ldap (if you got nssldap and pamldap working - this is a walkover by comparison). In fact,
I got so far as to have exim authenticate users before relaying mail on their behalf -as well as determining
the existance of any locally addressed recipients.</p></li>
</ul><br>
<p><h2>The Plugins</h2><br>
Insight connector is easy to add as a service, with fairly common
and obvious settings, hostname of server, username, password , Use TLS. The Connector
places four buttons in the Outlook toolbar.
<ul>
<li>IMAP Mailboxes : <p>Configure any number of IMAP mailboxes with local mappings
to an Outlook .pst file . After initial configuration this button is basically lint.</p></li>
<li>Mailbox : <p>Allows you to configure the mapping of a single mailfolder to an IMAP server, I could for instance
elect NOT to store my send messages on the server - unchecking a box here will do the trick.</p></li>
<li>Folder : <p>Popup panel for synchronisation settings and some very
comprehensive ACL settings. The ACLs are mainly usefull for calender/appointment sharing, and those
other things that executives and their assistants demand.</p></li>
<li>Synchronize : <p>Ahh the magic word, of course you can use the Folder panel to
automagically sync each mailbox, but if you prefer manual-shift then bashing this button sets
off the sync manager.</p></li>
<br>
</p>
<p>This is all well and good but now for the pain and heartache. If you're only
comfortable with drag'on-slop GUI's for managing your users then Insight server is
not going to make your life any easier. I have had success managing the LDAP directory with a little java applet, it's
not feature rich, but gets the job done. As for administration of mailbox ACLs and
whatnot, I suppose you could use cyrus's manager account to connect, since every mailbox
defaults to full access for 'manager' and '$user'. So that makes outlook+connectors an administration
interface.</p>
<p>Insight Server itself is about as well documented as your average sourceforge.net project, there are some
PDF's covering the install and <strong>basic</strong> configuration but my advice is to
read up on exim and cyrus...which brings me to those two jewels.</p>
<p>Exim - well, what can I say. If you can't absorb the reams of info in
the Exim 4.10 Specification then not much can help you, I found 'Life With Qmail' a nice intro to digest before
trying to understand the qmail docs, but was not lucky enough to find such a thing for exim. The docs seem comprehensive, providing
you can find what you are looking for.</p>
<p>cyrus IMAPd has docs and manpages galore in the distro tarball, I have not played
around much with it yet so that's all I'm saying about it.</p>
<p>SSL/TLS , I'm not a security nut and to say that it barely raises passing interest in this company
is an understatement. Regardless I thought it proper to atleast give this a blast, in an afternoon I had cyrusIMAPd authenticating and
serving mailboxes over autonegotiated SSL/TLS connections, to both outlook and also Netscape(4.79 IRIX!!). I forget if I mentioned
already that InsightServer is a great plain-old-IMAPd as well, if you don't NEED outlook's groupware fluff then
this'll still do a good job with your 5000 message imap folders.</p>