4 Copyright (C) 2007 Carlos Daniel Ruvalcaba Valenzuela <clsdaniel@gmail.com>
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
16 You should have received a copy of the GNU General Public License along
17 with this program; if not, write to the Free Software Foundation, Inc.,
18 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
24 typedef ProtocolHandler
* (*PROTO_LOAD
)();
25 typedef AuthManager
* (*AUTH_LOAD
)();
27 class SimpleLoad
: public LoadHandler
{
29 int Dispatch(Socket
*sock
, ProtocolHandler
*ph
){
31 return ph
->Handle(sock
);
38 ProtocolHandler
*pop3
;
39 ProtocolHandler
*smtp
;
44 ipc
= IPC::CreateIPC("socket://localhost:1900");
46 odkLibHandle
*lib_pop3
;
47 odkLibHandle
*lib_smtp
;
51 odkLibHandle
*lib_auth
;
54 lib_pop3
= odk_library_open("libfmail-pop3");
55 lib_smtp
= odk_library_open("libfmail-smtp");
57 load_pop3
= (PROTO_LOAD
)odk_library_symbol(lib_pop3
, "plugin_protocol_load");
58 load_smtp
= (PROTO_LOAD
)odk_library_symbol(lib_smtp
, "plugin_protocol_load");
63 lib_auth
= odk_library_open("libfmail-dbauth");
64 load_auth
= (AUTH_LOAD
)odk_library_symbol(lib_auth
, "plugin_authman_load");
68 lh
= new SimpleLoad();
70 serv
= new BaseServer(pop3
, 12001);
72 serv
->SetLoadhandler(lh
);