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
@@ -10,3 +10,7 @@ Addon Match\ Header : mail_daemon inbound_filters :
LinkSharedOSLibs Match\ Header : LinkSharedOSLibs Match\ Header :
be mail ; be mail ;
Package haiku-maildaemon-cvs :
Match\ Header :
boot home config add-ons mail_daemon inbound_filters ;
@@ -8,3 +8,7 @@ Addon R5\ Daemon\ Filter : mail_daemon inbound_filters :
LinkSharedOSLibs R5\ Daemon\ Filter : LinkSharedOSLibs R5\ Daemon\ Filter :
be mail ; be mail ;
Package haiku-maildaemon-cvs :
R5\ Daemon\ Filter :
boot home config add-ons mail_daemon inbound_filters ;
@@ -1,10 +1,15 @@
SubDir OBOS_TOP src add-ons mail_daemon inbound_protocols imap ; SubDir OBOS_TOP src add-ons mail_daemon inbound_protocols imap ;
UsePrivateHeaders mail ; UsePrivateHeaders mail ;
SubDirHdrs [ FDirName $(OBOS_TOP) headers os add-ons mail_daemon ] ; SubDirHdrs [ FDirName $(OBOS_TOP) headers os add-ons mail_daemon ] ;
SubDirC++Flags -DBONE ; 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 : Addon IMAP : mail_daemon inbound_protocols :
imap_client.cpp imap_client.cpp
imap_config.cpp imap_config.cpp
@@ -12,3 +17,10 @@ Addon IMAP : mail_daemon inbound_protocols :
LinkSharedOSLibs IMAP : LinkSharedOSLibs IMAP :
be mail socket bind ; 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 ;
@@ -28,7 +28,7 @@
#include <socket.h> #include <socket.h>
#endif #endif
#ifdef IMAPSSL #ifdef USESSL
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <openssl/rand.h> #include <openssl/rand.h>
#endif #endif
@@ -89,7 +89,7 @@ class IMAP4Client : public BMailRemoteStorageProtocol {
BList box_info; BList box_info;
status_t err; status_t err;
#ifdef IMAPSSL #ifdef USESSL
SSL_CTX *ctx; SSL_CTX *ctx;
SSL *ssl; SSL *ssl;
BIO *sbio; BIO *sbio;
@@ -122,14 +122,14 @@ IMAP4Client::IMAP4Client(BMessage *settings, BMailChainRunner *run) : BMailRemot
err = B_OK; err = B_OK;
mb_root = settings->FindString("root"); mb_root = settings->FindString("root");
#ifdef IMAPSSL #ifdef USESSL
use_ssl = (settings->FindInt32("flavor") == 1); use_ssl = (settings->FindInt32("flavor") == 1);
#endif #endif
int port = settings->FindInt32("port"); int port = settings->FindInt32("port");
if (port <= 0) if (port <= 0)
#ifdef IMAPSSL #ifdef USESSL
port = use_ssl ? 993 : 143; port = use_ssl ? 993 : 143;
#else #else
port = 143; port = 143;
@@ -192,7 +192,7 @@ IMAP4Client::IMAP4Client(BMessage *settings, BMailChainRunner *run) : BMailRemot
return; return;
} }
#ifdef IMAPSSL #ifdef USESSL
if (use_ssl) { if (use_ssl) {
SSL_library_init(); SSL_library_init();
SSL_load_error_strings(); SSL_load_error_strings();
@@ -279,7 +279,7 @@ IMAP4Client::~IMAP4Client() {
delete noop; delete noop;
#ifdef IMAPSSL #ifdef USESSL
if (use_ssl) { if (use_ssl) {
SSL_shutdown(ssl); SSL_shutdown(ssl);
SSL_CTX_free(ctx); SSL_CTX_free(ctx);
@@ -421,7 +421,7 @@ status_t IMAP4Client::AddMessage(const char *mailbox, BPositionIO *data, BString
char *buffer = new char[size]; char *buffer = new char[size];
data->ReadAt(0,buffer,size); data->ReadAt(0,buffer,size);
#ifdef IMAPSSL #ifdef USESSL
if (use_ssl) { if (use_ssl) {
SSL_write(ssl,buffer,size); SSL_write(ssl,buffer,size);
SSL_write(ssl,"\r\n",2); SSL_write(ssl,"\r\n",2);
@@ -884,7 +884,7 @@ IMAP4Client::SendCommand(const char* command)
static char cmd[255]; static char cmd[255];
::sprintf(cmd,"a%.7ld %s"CRLF,++commandCount,command); ::sprintf(cmd,"a%.7ld %s"CRLF,++commandCount,command);
#ifdef IMAPSSL #ifdef USESSL
if (use_ssl) if (use_ssl)
SSL_write(ssl,cmd,strlen(cmd)); SSL_write(ssl,cmd,strlen(cmd));
else else
@@ -918,7 +918,7 @@ IMAP4Client::ReceiveLine(BString &out)
/* Set the socket in the mask. */ /* Set the socket in the mask. */
FD_SET(net, &fds); FD_SET(net, &fds);
int result; int result;
#ifdef IMAPSSL #ifdef USESSL
if ((use_ssl) && (SSL_pending(ssl))) if ((use_ssl) && (SSL_pending(ssl)))
result = 1; result = 1;
else else
@@ -932,7 +932,7 @@ IMAP4Client::ReceiveLine(BString &out)
{ {
while(c != '\n' && c != xEOF) while(c != '\n' && c != xEOF)
{ {
#ifdef IMAPSSL #ifdef USESSL
if (use_ssl) if (use_ssl)
r = SSL_read(ssl,&c,1); r = SSL_read(ssl,&c,1);
else else
@@ -983,7 +983,7 @@ int IMAP4Client::GetResponse(BString &tag, NestedString *parsed_response, bool r
/* Set the socket in the mask. */ /* Set the socket in the mask. */
FD_SET(net, &fds); FD_SET(net, &fds);
#ifdef IMAPSSL #ifdef USESSL
if ((use_ssl) && (SSL_pending(ssl))) if ((use_ssl) && (SSL_pending(ssl)))
result = 1; result = 1;
else else
@@ -1001,7 +1001,7 @@ int IMAP4Client::GetResponse(BString &tag, NestedString *parsed_response, bool r
{ {
while(c != '\n' && c != xEOF) while(c != '\n' && c != xEOF)
{ {
#ifdef IMAPSSL #ifdef USESSL
if (use_ssl) if (use_ssl)
r = SSL_read(ssl,&c,1); r = SSL_read(ssl,&c,1);
else else
@@ -1061,7 +1061,7 @@ int IMAP4Client::GetResponse(BString &tag, NestedString *parsed_response, bool r
int read_octets = 0; int read_octets = 0;
int nibble_size; int nibble_size;
while (read_octets < octets_to_read) { while (read_octets < octets_to_read) {
#ifdef IMAPSSL #ifdef USESSL
if (use_ssl) if (use_ssl)
nibble_size = SSL_read(ssl,buffer + read_octets,octets_to_read - read_octets); nibble_size = SSL_read(ssl,buffer + read_octets,octets_to_read - read_octets);
else else
@@ -5,6 +5,10 @@ SubDirHdrs [ FDirName $(OBOS_TOP) headers os add-ons mail_daemon ] ;
SubDirC++Flags -DBONE ; 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 : Addon POP3 : mail_daemon inbound_protocols :
MessageIO.cpp MessageIO.cpp
pop3.cpp pop3.cpp
@@ -13,3 +17,10 @@ Addon POP3 : mail_daemon inbound_protocols :
LinkSharedOSLibs POP3 : LinkSharedOSLibs POP3 :
be mail socket bind ; 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 ;
@@ -9,3 +9,7 @@ Addon Fortune : mail_daemon outbound_fitlers :
LinkSharedOSLibs Fortune : LinkSharedOSLibs Fortune :
be mail ; be mail ;
Package haiku-maildaemon-cvs :
Fortune :
boot home config add-ons mail_daemon outbound_filters ;
@@ -11,3 +11,7 @@ Addon SMTP : mail_daemon outbound_protocols :
LinkSharedOSLibs SMTP : LinkSharedOSLibs SMTP :
be mail socket bind ; be mail socket bind ;
Package haiku-maildaemon-cvs :
SMTP :
boot home config add-ons mail_daemon outbound_protocols ;
@@ -8,3 +8,7 @@ Addon Inbox : mail_daemon inbound_filters :
LinkSharedOSLibs Inbox : LinkSharedOSLibs Inbox :
be mail ; be mail ;
Package haiku-maildaemon-cvs :
Inbox :
boot home config add-ons mail_daemon system_filters ;
@@ -8,3 +8,7 @@ Addon New\ Mail\ Notification : mail_daemon inbound_filters :
LinkSharedOSLibs New\ Mail\ Notification : LinkSharedOSLibs New\ Mail\ Notification :
be mail ; be mail ;
Package haiku-maildaemon-cvs :
New\ Mail\ Notification :
boot home config add-ons mail_daemon system_filters ;
@@ -8,3 +8,7 @@ Addon Outbox : mail_daemon inbound_filters :
LinkSharedOSLibs Outbox : LinkSharedOSLibs Outbox :
be mail ; be mail ;
Package haiku-maildaemon-cvs :
Outbox :
boot home config add-ons mail_daemon system_filters ;
@@ -8,3 +8,7 @@ Addon Message\ Parser : mail_daemon inbound_filters :
LinkSharedOSLibs Message\ Parser : LinkSharedOSLibs Message\ Parser :
be mail ; be mail ;
Package haiku-maildaemon-cvs :
Message\ Parser :
boot home config add-ons mail_daemon system_filters ;
+4
View File
@@ -22,3 +22,7 @@ App BeMail :
KUndoBuffer.cpp ; KUndoBuffer.cpp ;
LinkSharedOSLibs BeMail : be mail tracker stdc++.r4 ; LinkSharedOSLibs BeMail : be mail tracker stdc++.r4 ;
Package haiku-maildaemon-cvs :
BeMail :
boot beos apps ;
+4
View File
@@ -47,3 +47,7 @@ LinkSharedOSLibs libmail.so :
MakeLocate <develop>libmail.so : $(OBOS_STLIB_DIR) ; MakeLocate <develop>libmail.so : $(OBOS_STLIB_DIR) ;
RelSymLink <develop>libmail.so : libmail.so ; RelSymLink <develop>libmail.so : libmail.so ;
Package haiku-maildaemon-cvs :
libmail.so :
boot beos system lib ;
+4
View File
@@ -13,3 +13,7 @@ Preference E-mail :
main.cpp ; main.cpp ;
LinkSharedOSLibs E-mail : be mail ; LinkSharedOSLibs E-mail : be mail ;
Package haiku-maildaemon-cvs :
E-mail :
boot beos preferences ;
+4
View File
@@ -18,3 +18,7 @@ LinkSharedOSLibs mail_daemon :
tracker tracker
stdc++.r4 stdc++.r4
; ;
Package haiku-maildaemon-cvs :
mail_daemon :
boot beos system servers ;