Added packaging for the mail daemon, added build support for SSL mode (although it currently relies on manually uncommenting things in the Jamfile). PPP state detection still broken.

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@9025 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Nathan Whitehorn 2004-09-21 20:23:32 +00:00
parent 7835571124
commit 0d21a7f43f
15 changed files with 84 additions and 13 deletions

View File

@ -10,3 +10,7 @@ Addon Match\ Header : mail_daemon inbound_filters :
LinkSharedOSLibs Match\ Header :
be mail ;
Package haiku-maildaemon-cvs :
Match\ Header :
boot home config add-ons mail_daemon inbound_filters ;

View File

@ -8,3 +8,7 @@ Addon R5\ Daemon\ Filter : mail_daemon inbound_filters :
LinkSharedOSLibs R5\ Daemon\ Filter :
be mail ;
Package haiku-maildaemon-cvs :
R5\ Daemon\ Filter :
boot home config add-ons mail_daemon inbound_filters ;

View File

@ -1,10 +1,15 @@
SubDir OBOS_TOP src add-ons mail_daemon inbound_protocols imap ;
UsePrivateHeaders mail ;
SubDirHdrs [ FDirName $(OBOS_TOP) headers os add-ons mail_daemon ] ;
SubDirC++Flags -DBONE ;
#OpenSSL testing should be automated somehow
#SubDirC++Flags -DBONE -DUSESSL ;
#SubDirHdrs [ FDirName / boot home config include ] ;
Addon IMAP : mail_daemon inbound_protocols :
imap_client.cpp
imap_config.cpp
@ -12,3 +17,10 @@ Addon IMAP : mail_daemon inbound_protocols :
LinkSharedOSLibs IMAP :
be mail socket bind ;
#LinkSharedOSLibs IMAP :
# be mail socket bind ssl crypto ;
Package haiku-maildaemon-cvs :
IMAP :
boot home config add-ons mail_daemon inbound_protocols ;

View File

@ -28,7 +28,7 @@
#include <socket.h>
#endif
#ifdef IMAPSSL
#ifdef USESSL
#include <openssl/ssl.h>
#include <openssl/rand.h>
#endif
@ -89,7 +89,7 @@ class IMAP4Client : public BMailRemoteStorageProtocol {
BList box_info;
status_t err;
#ifdef IMAPSSL
#ifdef USESSL
SSL_CTX *ctx;
SSL *ssl;
BIO *sbio;
@ -122,14 +122,14 @@ IMAP4Client::IMAP4Client(BMessage *settings, BMailChainRunner *run) : BMailRemot
err = B_OK;
mb_root = settings->FindString("root");
#ifdef IMAPSSL
#ifdef USESSL
use_ssl = (settings->FindInt32("flavor") == 1);
#endif
int port = settings->FindInt32("port");
if (port <= 0)
#ifdef IMAPSSL
#ifdef USESSL
port = use_ssl ? 993 : 143;
#else
port = 143;
@ -192,7 +192,7 @@ IMAP4Client::IMAP4Client(BMessage *settings, BMailChainRunner *run) : BMailRemot
return;
}
#ifdef IMAPSSL
#ifdef USESSL
if (use_ssl) {
SSL_library_init();
SSL_load_error_strings();
@ -279,7 +279,7 @@ IMAP4Client::~IMAP4Client() {
delete noop;
#ifdef IMAPSSL
#ifdef USESSL
if (use_ssl) {
SSL_shutdown(ssl);
SSL_CTX_free(ctx);
@ -421,7 +421,7 @@ status_t IMAP4Client::AddMessage(const char *mailbox, BPositionIO *data, BString
char *buffer = new char[size];
data->ReadAt(0,buffer,size);
#ifdef IMAPSSL
#ifdef USESSL
if (use_ssl) {
SSL_write(ssl,buffer,size);
SSL_write(ssl,"\r\n",2);
@ -884,7 +884,7 @@ IMAP4Client::SendCommand(const char* command)
static char cmd[255];
::sprintf(cmd,"a%.7ld %s"CRLF,++commandCount,command);
#ifdef IMAPSSL
#ifdef USESSL
if (use_ssl)
SSL_write(ssl,cmd,strlen(cmd));
else
@ -918,7 +918,7 @@ IMAP4Client::ReceiveLine(BString &out)
/* Set the socket in the mask. */
FD_SET(net, &fds);
int result;
#ifdef IMAPSSL
#ifdef USESSL
if ((use_ssl) && (SSL_pending(ssl)))
result = 1;
else
@ -932,7 +932,7 @@ IMAP4Client::ReceiveLine(BString &out)
{
while(c != '\n' && c != xEOF)
{
#ifdef IMAPSSL
#ifdef USESSL
if (use_ssl)
r = SSL_read(ssl,&c,1);
else
@ -983,7 +983,7 @@ int IMAP4Client::GetResponse(BString &tag, NestedString *parsed_response, bool r
/* Set the socket in the mask. */
FD_SET(net, &fds);
#ifdef IMAPSSL
#ifdef USESSL
if ((use_ssl) && (SSL_pending(ssl)))
result = 1;
else
@ -1001,7 +1001,7 @@ int IMAP4Client::GetResponse(BString &tag, NestedString *parsed_response, bool r
{
while(c != '\n' && c != xEOF)
{
#ifdef IMAPSSL
#ifdef USESSL
if (use_ssl)
r = SSL_read(ssl,&c,1);
else
@ -1061,7 +1061,7 @@ int IMAP4Client::GetResponse(BString &tag, NestedString *parsed_response, bool r
int read_octets = 0;
int nibble_size;
while (read_octets < octets_to_read) {
#ifdef IMAPSSL
#ifdef USESSL
if (use_ssl)
nibble_size = SSL_read(ssl,buffer + read_octets,octets_to_read - read_octets);
else

View File

@ -5,6 +5,10 @@ SubDirHdrs [ FDirName $(OBOS_TOP) headers os add-ons mail_daemon ] ;
SubDirC++Flags -DBONE ;
#OpenSSL testing should be automated somehow
#SubDirC++Flags -DBONE -DUSESSL ;
#SubDirHdrs [ FDirName / boot home config include ] ;
Addon POP3 : mail_daemon inbound_protocols :
MessageIO.cpp
pop3.cpp
@ -13,3 +17,10 @@ Addon POP3 : mail_daemon inbound_protocols :
LinkSharedOSLibs POP3 :
be mail socket bind ;
#LinkSharedOSLibs POP3 :
# be mail socket bind ssl crypto ;
Package haiku-maildaemon-cvs :
POP3 :
boot home config add-ons mail_daemon inbound_protocols ;

View File

@ -9,3 +9,7 @@ Addon Fortune : mail_daemon outbound_fitlers :
LinkSharedOSLibs Fortune :
be mail ;
Package haiku-maildaemon-cvs :
Fortune :
boot home config add-ons mail_daemon outbound_filters ;

View File

@ -11,3 +11,7 @@ Addon SMTP : mail_daemon outbound_protocols :
LinkSharedOSLibs SMTP :
be mail socket bind ;
Package haiku-maildaemon-cvs :
SMTP :
boot home config add-ons mail_daemon outbound_protocols ;

View File

@ -8,3 +8,7 @@ Addon Inbox : mail_daemon inbound_filters :
LinkSharedOSLibs Inbox :
be mail ;
Package haiku-maildaemon-cvs :
Inbox :
boot home config add-ons mail_daemon system_filters ;

View File

@ -8,3 +8,7 @@ Addon New\ Mail\ Notification : mail_daemon inbound_filters :
LinkSharedOSLibs New\ Mail\ Notification :
be mail ;
Package haiku-maildaemon-cvs :
New\ Mail\ Notification :
boot home config add-ons mail_daemon system_filters ;

View File

@ -8,3 +8,7 @@ Addon Outbox : mail_daemon inbound_filters :
LinkSharedOSLibs Outbox :
be mail ;
Package haiku-maildaemon-cvs :
Outbox :
boot home config add-ons mail_daemon system_filters ;

View File

@ -8,3 +8,7 @@ Addon Message\ Parser : mail_daemon inbound_filters :
LinkSharedOSLibs Message\ Parser :
be mail ;
Package haiku-maildaemon-cvs :
Message\ Parser :
boot home config add-ons mail_daemon system_filters ;

View File

@ -22,3 +22,7 @@ App BeMail :
KUndoBuffer.cpp ;
LinkSharedOSLibs BeMail : be mail tracker stdc++.r4 ;
Package haiku-maildaemon-cvs :
BeMail :
boot beos apps ;

View File

@ -47,3 +47,7 @@ LinkSharedOSLibs libmail.so :
MakeLocate <develop>libmail.so : $(OBOS_STLIB_DIR) ;
RelSymLink <develop>libmail.so : libmail.so ;
Package haiku-maildaemon-cvs :
libmail.so :
boot beos system lib ;

View File

@ -13,3 +13,7 @@ Preference E-mail :
main.cpp ;
LinkSharedOSLibs E-mail : be mail ;
Package haiku-maildaemon-cvs :
E-mail :
boot beos preferences ;

View File

@ -18,3 +18,7 @@ LinkSharedOSLibs mail_daemon :
tracker
stdc++.r4
;
Package haiku-maildaemon-cvs :
mail_daemon :
boot beos system servers ;