Now compiles for both Haiku and R5 targets. Also bumped the version

number to 3.0.3, just in case we want to do a new release soon with
this slightly better working version.


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@14718 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexander G.M. Smith
2005-11-05 22:51:31 +00:00
parent 4b1aabf67e
commit 9c91a5f9d6
19 changed files with 149 additions and 148 deletions
@@ -4,10 +4,11 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
if $(TARGET_PLATFORM) != haiku { if $(TARGET_PLATFORM) != haiku {
UsePublicHeaders mail ; UsePublicHeaders mail ;
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
} }
UsePrivateHeaders mail ; UsePrivateHeaders mail ;
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ; SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ;
Addon Match\ Header : mail_daemon inbound_filters : Addon Match\ Header : mail_daemon inbound_filters :
@@ -19,5 +20,5 @@ LinkAgainst Match\ Header :
be libmail.so ; be libmail.so ;
Package haiku-maildaemon-cvs : Package haiku-maildaemon-cvs :
Match\ Header : Match\ Header :
boot home config add-ons mail_daemon inbound_filters ; boot home config add-ons mail_daemon inbound_filters ;
@@ -4,10 +4,11 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
if $(TARGET_PLATFORM) != haiku { if $(TARGET_PLATFORM) != haiku {
UsePublicHeaders mail ; UsePublicHeaders mail ;
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
} }
UsePrivateHeaders mail ; UsePrivateHeaders mail ;
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ; SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ;
Addon R5\ Daemon\ Filter : mail_daemon inbound_filters : Addon R5\ Daemon\ Filter : mail_daemon inbound_filters :
@@ -17,5 +18,5 @@ LinkAgainst R5\ Daemon\ Filter :
be libmail.so ; be libmail.so ;
Package haiku-maildaemon-cvs : Package haiku-maildaemon-cvs :
R5\ Daemon\ Filter : R5\ Daemon\ Filter :
boot home config add-ons mail_daemon inbound_filters ; boot home config add-ons mail_daemon inbound_filters ;
@@ -4,10 +4,11 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
if $(TARGET_PLATFORM) != haiku { if $(TARGET_PLATFORM) != haiku {
UsePublicHeaders mail ; UsePublicHeaders mail ;
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
} }
UsePrivateHeaders mail ; UsePrivateHeaders mail ;
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ; SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ;
Addon Spam\ Filter : mail_daemon inbound_filters : Addon Spam\ Filter : mail_daemon inbound_filters :
@@ -18,5 +19,5 @@ LinkAgainst Spam\ Filter :
be libmail.so ; be libmail.so ;
Package haiku-maildaemon-cvs : Package haiku-maildaemon-cvs :
Spam\ Filter : Spam\ Filter :
boot home config add-ons mail_daemon inbound_filters ; boot home config add-ons mail_daemon inbound_filters ;
@@ -4,10 +4,11 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
if $(TARGET_PLATFORM) != haiku { if $(TARGET_PLATFORM) != haiku {
UsePublicHeaders mail ; UsePublicHeaders mail ;
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
} }
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
UsePrivateHeaders mail ; UsePrivateHeaders mail ;
SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ; SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ;
if $(USESSL) { if $(USESSL) {
@@ -15,12 +16,6 @@ if $(USESSL) {
SubDirHdrs [ FDirName / boot home config include ] ; SubDirHdrs [ FDirName / boot home config include ] ;
} }
if $(BONE_COMPATIBLE) {
SubDirC++Flags -DBONE ;
} else {
SubDirC++Flags -DBUILDING_R5_LIBNET ;
}
Addon POP3 : mail_daemon inbound_protocols : Addon POP3 : mail_daemon inbound_protocols :
MessageIO.cpp MessageIO.cpp
pop3.cpp pop3.cpp
@@ -34,5 +29,5 @@ if $(USESSL) {
} }
Package haiku-maildaemon-cvs : Package haiku-maildaemon-cvs :
POP3 : POP3 :
boot home config add-ons mail_daemon inbound_protocols ; boot home config add-ons mail_daemon inbound_protocols ;
@@ -12,7 +12,11 @@
#include <errno.h> #include <errno.h>
#include <unistd.h> #include <unistd.h>
#include <sys/time.h> #include <sys/time.h>
#include <sys/select.h> #include <sys/socket.h>
#ifndef HAIKU_TARGET_PLATFORM_BEOS // These headers don't exist in BeOS R5.
#include <arpa/inet.h>
#include <sys/select.h>
#endif
#include <status.h> #include <status.h>
#include <StringList.h> #include <StringList.h>
@@ -21,10 +25,6 @@
#include <MDRLanguage.h> #include <MDRLanguage.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#if USESSL #if USESSL
#include <openssl/ssl.h> #include <openssl/ssl.h>
#include <openssl/rand.h> #include <openssl/rand.h>
@@ -55,7 +55,7 @@ POP3Protocol::POP3Protocol(BMessage *settings, BMailChainRunner *status)
POP3Protocol::~POP3Protocol() POP3Protocol::~POP3Protocol()
{ {
SendCommand("QUIT" CRLF); SendCommand("QUIT" CRLF);
#ifdef USESSL #ifdef USESSL
if (use_ssl) { if (use_ssl) {
SSL_shutdown(ssl); SSL_shutdown(ssl);
@@ -63,7 +63,7 @@ POP3Protocol::~POP3Protocol()
} }
#endif #endif
#ifdef BONE #ifndef HAIKU_TARGET_PLATFORM_BEOS
close(conn); close(conn);
#else #else
closesocket(conn); closesocket(conn);
@@ -75,7 +75,7 @@ status_t
POP3Protocol::Open(const char *server, int port, int) POP3Protocol::Open(const char *server, int port, int)
{ {
runner->ReportProgress(0,0,MDR_DIALECT_CHOICE ("Connecting to POP3 Server...","POP3サーバに接続しています...")); runner->ReportProgress(0,0,MDR_DIALECT_CHOICE ("Connecting to POP3 Server...","POP3サーバに接続しています..."));
if (port <= 0) if (port <= 0)
#ifdef USESSL #ifdef USESSL
port = use_ssl ? 995 : 110; port = use_ssl ? 995 : 110;
@@ -104,7 +104,7 @@ POP3Protocol::Open(const char *server, int port, int)
return B_NAME_NOT_FOUND; return B_NAME_NOT_FOUND;
} }
#ifdef BONE #ifndef HAIKU_TARGET_PLATFORM_BEOS
conn = socket(AF_INET, SOCK_STREAM, 0); conn = socket(AF_INET, SOCK_STREAM, 0);
#else #else
conn = socket(AF_INET, 2, 0); conn = socket(AF_INET, 2, 0);
@@ -117,7 +117,7 @@ POP3Protocol::Open(const char *server, int port, int)
saAddr.sin_addr.s_addr = hostIP; saAddr.sin_addr.s_addr = hostIP;
int result = connect(conn, (struct sockaddr *) &saAddr, sizeof(saAddr)); int result = connect(conn, (struct sockaddr *) &saAddr, sizeof(saAddr));
if (result < 0) { if (result < 0) {
#ifdef BONE #ifndef HAIKU_TARGET_PLATFORM_BEOS
close(conn); close(conn);
#else #else
closesocket(conn); closesocket(conn);
@@ -132,7 +132,7 @@ POP3Protocol::Open(const char *server, int port, int)
pop3_error(error_msg.String()); pop3_error(error_msg.String());
return B_ERROR; return B_ERROR;
} }
#ifdef USESSL #ifdef USESSL
if (use_ssl) { if (use_ssl) {
SSL_library_init(); SSL_library_init();
@@ -155,7 +155,7 @@ POP3Protocol::Open(const char *server, int port, int)
error << ". (SSL Connection Error)"; error << ". (SSL Connection Error)";
runner->ShowError(error.String()); runner->ShowError(error.String());
SSL_CTX_free(ctx); SSL_CTX_free(ctx);
#ifdef BONE #ifndef HAIKU_TARGET_PLATFORM_BEOS
close(conn); close(conn);
#else #else
closesocket(conn); closesocket(conn);
@@ -167,7 +167,7 @@ POP3Protocol::Open(const char *server, int port, int)
} }
#endif #endif
BString line; BString line;
status_t err; status_t err;
int32 tries = 200000; int32 tries = 200000;
@@ -178,7 +178,7 @@ POP3Protocol::Open(const char *server, int port, int)
} }
if (err < 0) { if (err < 0) {
#ifdef BONE #ifndef HAIKU_TARGET_PLATFORM_BEOS
close(conn); close(conn);
#else #else
closesocket(conn); closesocket(conn);
@@ -368,20 +368,20 @@ status_t POP3Protocol::RetrieveInternal(const char *command, int32 message,
return B_ERROR; return B_ERROR;
struct timeval tv; struct timeval tv;
struct fd_set fds; struct fd_set fds;
tv.tv_sec = long(POP3_RETRIEVAL_TIMEOUT / 1e6); tv.tv_sec = long(POP3_RETRIEVAL_TIMEOUT / 1e6);
tv.tv_usec = long(POP3_RETRIEVAL_TIMEOUT-(tv.tv_sec * 1e6)); tv.tv_usec = long(POP3_RETRIEVAL_TIMEOUT-(tv.tv_sec * 1e6));
/* Initialize (clear) the socket mask. */ /* Initialize (clear) the socket mask. */
FD_ZERO(&fds); FD_ZERO(&fds);
/* Set the socket in the mask. */ /* Set the socket in the mask. */
FD_SET(conn, &fds); FD_SET(conn, &fds);
while (cont) { while (cont) {
int result = 0; int result = 0;
#ifdef USESSL #ifdef USESSL
if ((use_ssl) && (SSL_pending(ssl))) if ((use_ssl) && (SSL_pending(ssl)))
result = 1; result = 1;
@@ -548,16 +548,16 @@ POP3Protocol::ReceiveLine(BString &line)
line = ""; line = "";
struct timeval tv; struct timeval tv;
struct fd_set fds; struct fd_set fds;
tv.tv_sec = long(POP3_RETRIEVAL_TIMEOUT / 1e6); tv.tv_sec = long(POP3_RETRIEVAL_TIMEOUT / 1e6);
tv.tv_usec = long(POP3_RETRIEVAL_TIMEOUT-(tv.tv_sec * 1e6)); tv.tv_usec = long(POP3_RETRIEVAL_TIMEOUT-(tv.tv_sec * 1e6));
/* Initialize (clear) the socket mask. */ /* Initialize (clear) the socket mask. */
FD_ZERO(&fds); FD_ZERO(&fds);
/* Set the socket in the mask. */ /* Set the socket in the mask. */
FD_SET(conn, &fds); FD_SET(conn, &fds);
int result = -1; int result = -1;
#ifdef USESSL #ifdef USESSL
if ((use_ssl) && (SSL_pending(ssl))) if ((use_ssl) && (SSL_pending(ssl)))
@@ -614,15 +614,15 @@ POP3Protocol::SendCommand(const char *cmd)
// due to bugs) as being from this command. // due to bugs) as being from this command.
struct timeval tv; struct timeval tv;
tv.tv_sec = long(1000 / 1e6); tv.tv_sec = long(1000 / 1e6);
tv.tv_usec = long(1000-(tv.tv_sec * 1e6)); /* very short timeout, hangs with 0 in R5 */ tv.tv_usec = long(1000-(tv.tv_sec * 1e6)); /* very short timeout, hangs with 0 in R5 */
struct fd_set fds; struct fd_set fds;
/* Initialize (clear) the socket mask. */ /* Initialize (clear) the socket mask. */
FD_ZERO(&fds); FD_ZERO(&fds);
/* Set the socket in the mask. */ /* Set the socket in the mask. */
FD_SET(conn, &fds); FD_SET(conn, &fds);
int result; int result;
#ifdef USESSL #ifdef USESSL
@@ -631,10 +631,10 @@ POP3Protocol::SendCommand(const char *cmd)
else else
#endif #endif
result = select(32, &fds, NULL, NULL, &tv); result = select(32, &fds, NULL, NULL, &tv);
if (result > 0) { if (result > 0) {
int amountReceived; int amountReceived;
char tempString [1025]; char tempString [1025];
#ifdef USESSL #ifdef USESSL
if (use_ssl) if (use_ssl)
amountReceived = SSL_read(ssl,tempString, sizeof (tempString) - 1); amountReceived = SSL_read(ssl,tempString, sizeof (tempString) - 1);
@@ -653,7 +653,7 @@ POP3Protocol::SendCommand(const char *cmd)
if (use_ssl) { if (use_ssl) {
SSL_write(ssl,cmd,::strlen(cmd)); SSL_write(ssl,cmd,::strlen(cmd));
//SSL_write(ssl,"\r\n",2); //SSL_write(ssl,"\r\n",2);
} else } else
#endif #endif
if (send(conn, cmd, ::strlen(cmd), 0) < 0) { if (send(conn, cmd, ::strlen(cmd), 0) < 0) {
fLog = strerror(errno); fLog = strerror(errno);
@@ -689,17 +689,17 @@ POP3Protocol::SendCommand(const char *cmd)
void POP3Protocol::MD5Digest (unsigned char *in,char *ascii_digest) void POP3Protocol::MD5Digest (unsigned char *in,char *ascii_digest)
{ {
unsigned char digest[16]; unsigned char digest[16];
#ifdef USESSL #ifdef USESSL
MD5(in, ::strlen((char*)in),digest); MD5(in, ::strlen((char*)in),digest);
#else #else
MD5_CTX context; MD5_CTX context;
MD5Init(&context); MD5Init(&context);
MD5Update(&context, in, ::strlen((char*)in)); MD5Update(&context, in, ::strlen((char*)in));
MD5Final(digest, &context); MD5Final(digest, &context);
#endif #endif
for (int i = 0; i < 16; i++) for (int i = 0; i < 16; i++)
sprintf(ascii_digest+2*i, "%02x", digest[i]); sprintf(ascii_digest+2*i, "%02x", digest[i]);
@@ -723,12 +723,12 @@ BView* instantiate_config_panel(BMessage *settings,BMessage *)
#endif #endif
view->AddAuthMethod("Plain Text"); view->AddAuthMethod("Plain Text");
view->AddAuthMethod("APOP"); view->AddAuthMethod("APOP");
#if USESSL #if USESSL
view->AddFlavor("Unencrypted"); view->AddFlavor("Unencrypted");
view->AddFlavor("SSL"); view->AddFlavor("SSL");
#endif #endif
view->SetTo(settings); view->SetTo(settings);
return view; return view;
@@ -4,10 +4,11 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
if $(TARGET_PLATFORM) != haiku { if $(TARGET_PLATFORM) != haiku {
UsePublicHeaders mail ; UsePublicHeaders mail ;
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
} }
UsePrivateHeaders mail ; UsePrivateHeaders mail ;
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ; SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ;
Addon Fortune : mail_daemon outbound_filters : Addon Fortune : mail_daemon outbound_filters :
@@ -18,5 +19,5 @@ LinkAgainst Fortune :
be libmail.so ; be libmail.so ;
Package haiku-maildaemon-cvs : Package haiku-maildaemon-cvs :
Fortune : Fortune :
boot home config add-ons mail_daemon outbound_filters ; boot home config add-ons mail_daemon outbound_filters ;
@@ -4,10 +4,11 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
if $(TARGET_PLATFORM) != haiku { if $(TARGET_PLATFORM) != haiku {
UsePublicHeaders mail ; UsePublicHeaders mail ;
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
} }
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
UsePrivateHeaders mail ; UsePrivateHeaders mail ;
SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ; SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ;
if $(USESSL) { if $(USESSL) {
@@ -15,12 +16,6 @@ if $(USESSL) {
SubDirHdrs [ FDirName / boot home config include ] ; SubDirHdrs [ FDirName / boot home config include ] ;
} }
if $(BONE_COMPATIBLE) {
SubDirC++Flags -DBONE ;
} else {
SubDirC++Flags -DBUILDING_R5_LIBNET ;
}
Addon SMTP : mail_daemon outbound_protocols : Addon SMTP : mail_daemon outbound_protocols :
smtp.cpp smtp.cpp
md5c.c ; md5c.c ;
@@ -32,5 +27,5 @@ if $(USESSL) {
} }
Package haiku-maildaemon-cvs : Package haiku-maildaemon-cvs :
SMTP : SMTP :
boot home config add-ons mail_daemon outbound_protocols ; boot home config add-ons mail_daemon outbound_protocols ;
@@ -3,7 +3,6 @@
** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved. ** Copyright 2001 Dr. Zoidberg Enterprises. All rights reserved.
*/ */
#include <DataIO.h> #include <DataIO.h>
#include <Message.h> #include <Message.h>
#include <Alert.h> #include <Alert.h>
@@ -16,7 +15,13 @@
#include <stdio.h> #include <stdio.h>
#include <errno.h> #include <errno.h>
#include <netdb.h> #include <netdb.h>
#include <sys/time.h>
#include <sys/socket.h>
#ifndef HAIKU_TARGET_PLATFORM_BEOS // These headers don't exist in BeOS R5.
#include <arpa/inet.h>
#include <sys/select.h>
#endif
#include <status.h> #include <status.h>
#include <ProtocolConfigView.h> #include <ProtocolConfigView.h>
#include <mail_encoding.h> #include <mail_encoding.h>
@@ -34,10 +39,6 @@
#include <MDRLanguage.h> #include <MDRLanguage.h>
#include <sys/socket.h>
#include <sys/time.h>
#include <sys/select.h>
#include <arpa/inet.h>
#define CRLF "\r\n" #define CRLF "\r\n"
#define SMTP_RESPONSE_SIZE 8192 #define SMTP_RESPONSE_SIZE 8192
@@ -146,7 +147,7 @@ MD5HexHmac(char *hexdigest,
** Function: MD5Sum ** Function: MD5Sum
** generates an MD5-sum from the given string ** generates an MD5-sum from the given string
*/ */
void void
MD5Sum (char* sum, unsigned char *text, int text_len) { MD5Sum (char* sum, unsigned char *text, int text_len) {
MD5_CTX context; MD5_CTX context;
MD5_Init(&context); MD5_Init(&context);
@@ -282,7 +283,7 @@ SMTPProtocol::SMTPProtocol(BMessage *message, BMailChainRunner *run)
if (fStatus < B_OK) { if (fStatus < B_OK) {
//-----This is a really cool kind of error message. How can we make it work for POP3? //-----This is a really cool kind of error message. How can we make it work for POP3?
error_msg << MDR_DIALECT_CHOICE ("Error while logging in to ","ログイン中にエラーが発生しました\n") << fSettings->FindString("server") error_msg << MDR_DIALECT_CHOICE ("Error while logging in to ","ログイン中にエラーが発生しました\n") << fSettings->FindString("server")
<< MDR_DIALECT_CHOICE (". The server said:\n","サーバーエラー\n") << fLog; << MDR_DIALECT_CHOICE (". The server said:\n","サーバーエラー\n") << fLog;
runner->ShowError(error_msg.String()); runner->ShowError(error_msg.String());
runner->Stop(true); runner->Stop(true);
@@ -345,13 +346,13 @@ status_t
SMTPProtocol::Open(const char *address, int port, bool esmtp) SMTPProtocol::Open(const char *address, int port, bool esmtp)
{ {
runner->ReportProgress(0, 0, MDR_DIALECT_CHOICE ("Connecting to server...","接続中...")); runner->ReportProgress(0, 0, MDR_DIALECT_CHOICE ("Connecting to server...","接続中..."));
#ifdef USESSL #ifdef USESSL
use_ssl = (fSettings->FindInt32("flavor") == 1); use_ssl = (fSettings->FindInt32("flavor") == 1);
ssl = NULL; ssl = NULL;
ctx = NULL; ctx = NULL;
#endif #endif
if (port <= 0) if (port <= 0)
#ifdef USESSL #ifdef USESSL
port = use_ssl ? 465 : 25; port = use_ssl ? 465 : 25;
@@ -364,11 +365,11 @@ SMTPProtocol::Open(const char *address, int port, bool esmtp)
struct hostent * he = gethostbyname(address); struct hostent * he = gethostbyname(address);
hostIP = he ? *((uint32*)he->h_addr) : 0; hostIP = he ? *((uint32*)he->h_addr) : 0;
} }
if (hostIP == 0) if (hostIP == 0)
return EHOSTUNREACH; return EHOSTUNREACH;
#ifdef BONE #ifndef HAIKU_TARGET_PLATFORM_BEOS
_fd = socket(AF_INET, SOCK_STREAM, 0); _fd = socket(AF_INET, SOCK_STREAM, 0);
#else #else
_fd = socket(AF_INET, 2, 0); _fd = socket(AF_INET, 2, 0);
@@ -381,7 +382,7 @@ SMTPProtocol::Open(const char *address, int port, bool esmtp)
saAddr.sin_addr.s_addr = hostIP; saAddr.sin_addr.s_addr = hostIP;
int result = connect(_fd, (struct sockaddr *) &saAddr, sizeof(saAddr)); int result = connect(_fd, (struct sockaddr *) &saAddr, sizeof(saAddr));
if (result < 0) { if (result < 0) {
#ifdef BONE #ifndef HAIKU_TARGET_PLATFORM_BEOS
close(_fd); close(_fd);
#else #else
closesocket(_fd); closesocket(_fd);
@@ -415,7 +416,7 @@ SMTPProtocol::Open(const char *address, int port, bool esmtp)
error << ". (SSL Connection Error)"; error << ". (SSL Connection Error)";
runner->ShowError(error.String()); runner->ShowError(error.String());
SSL_CTX_free(ctx); SSL_CTX_free(ctx);
#ifdef BONE #ifndef HAIKU_TARGET_PLATFORM_BEOS
close(_fd); close(_fd);
#else #else
closesocket(_fd); closesocket(_fd);
@@ -558,7 +559,7 @@ SMTPProtocol::Login(const char *_login, const char *password)
if (fAuthType & DIGEST_MD5) { if (fAuthType & DIGEST_MD5) {
//******* DIGEST-MD5 Authentication ( tested. works fine [with Cyrus SASL] ) //******* DIGEST-MD5 Authentication ( tested. works fine [with Cyrus SASL] )
// this implements only the subpart of DIGEST-MD5 which is // this implements only the subpart of DIGEST-MD5 which is
// required for authentication to SMTP-servers. Integrity- // required for authentication to SMTP-servers. Integrity-
// and confidentiality-protection are not implemented, as // and confidentiality-protection are not implemented, as
// they are provided by the use of OpenSSL. // they are provided by the use of OpenSSL.
@@ -597,16 +598,16 @@ SMTPProtocol::Login(const char *_login, const char *password)
rawResponse << ",digest-uri=" << '"' << digestUriValue << '"'; rawResponse << ",digest-uri=" << '"' << digestUriValue << '"';
char sum[17], hex_digest2[33]; char sum[17], hex_digest2[33];
BString a1,a2,kd; BString a1,a2,kd;
BString t1 = BString(login) << ":" BString t1 = BString(login) << ":"
<< challengeMap["realm"] << ":" << challengeMap["realm"] << ":"
<< password; << password;
MD5Sum(sum, (unsigned char*)t1.String(), t1.Length()); MD5Sum(sum, (unsigned char*)t1.String(), t1.Length());
a1 << sum << ":" << challengeMap["nonce"] << ":" << cnonce; a1 << sum << ":" << challengeMap["nonce"] << ":" << cnonce;
MD5Digest(hex_digest, (unsigned char*)a1.String(), a1.Length()); MD5Digest(hex_digest, (unsigned char*)a1.String(), a1.Length());
a2 << "AUTHENTICATE:" << digestUriValue; a2 << "AUTHENTICATE:" << digestUriValue;
MD5Digest(hex_digest2, (unsigned char*)a2.String(), a2.Length()); MD5Digest(hex_digest2, (unsigned char*)a2.String(), a2.Length());
kd << hex_digest << ':' << challengeMap["nonce"] kd << hex_digest << ':' << challengeMap["nonce"]
<< ":" << "00000001" << ':' << cnonce << ':' << "auth" << ":" << "00000001" << ':' << cnonce << ':' << "auth"
<< ':' << hex_digest2; << ':' << hex_digest2;
MD5Digest(hex_digest, (unsigned char*)kd.String(), kd.Length()); MD5Digest(hex_digest, (unsigned char*)kd.String(), kd.Length());
@@ -754,7 +755,7 @@ SMTPProtocol::Close()
} }
#endif #endif
#ifdef BONE #ifndef HAIKU_TARGET_PLATFORM_BEOS
close(_fd); close(_fd);
#else #else
closesocket(_fd); closesocket(_fd);
@@ -925,16 +926,16 @@ SMTPProtocol::ReceiveResponse(BString &out)
BString searchStr = ""; BString searchStr = "";
struct timeval tv; struct timeval tv;
struct fd_set fds; struct fd_set fds;
tv.tv_sec = long(timeout / 1e6); tv.tv_sec = long(timeout / 1e6);
tv.tv_usec = long(timeout-(tv.tv_sec * 1e6)); tv.tv_usec = long(timeout-(tv.tv_sec * 1e6));
/* Initialize (clear) the socket mask. */ /* Initialize (clear) the socket mask. */
FD_ZERO(&fds); FD_ZERO(&fds);
/* Set the socket in the mask. */ /* Set the socket in the mask. */
FD_SET(_fd, &fds); FD_SET(_fd, &fds);
int result = -1; int result = -1;
#ifdef USESSL #ifdef USESSL
if ((use_ssl) && (SSL_pending(ssl))) if ((use_ssl) && (SSL_pending(ssl)))
@@ -1036,7 +1037,7 @@ BView *
instantiate_config_panel(BMessage *settings, BMessage *) instantiate_config_panel(BMessage *settings, BMessage *)
{ {
BMailProtocolConfigView *view = new BMailProtocolConfigView(B_MAIL_PROTOCOL_HAS_AUTH_METHODS | B_MAIL_PROTOCOL_HAS_USERNAME | B_MAIL_PROTOCOL_HAS_PASSWORD | B_MAIL_PROTOCOL_HAS_HOSTNAME BMailProtocolConfigView *view = new BMailProtocolConfigView(B_MAIL_PROTOCOL_HAS_AUTH_METHODS | B_MAIL_PROTOCOL_HAS_USERNAME | B_MAIL_PROTOCOL_HAS_PASSWORD | B_MAIL_PROTOCOL_HAS_HOSTNAME
#ifdef USESSL #ifdef USESSL
| B_MAIL_PROTOCOL_HAS_FLAVORS); | B_MAIL_PROTOCOL_HAS_FLAVORS);
view->AddFlavor("Unencrypted"); view->AddFlavor("Unencrypted");
@@ -4,10 +4,11 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
if $(TARGET_PLATFORM) != haiku { if $(TARGET_PLATFORM) != haiku {
UsePublicHeaders mail ; UsePublicHeaders mail ;
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
} }
UsePrivateHeaders mail ; UsePrivateHeaders mail ;
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ; SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ;
Addon Inbox : mail_daemon system_filters : Addon Inbox : mail_daemon system_filters :
@@ -17,5 +18,5 @@ LinkAgainst Inbox :
be libmail.so ; be libmail.so ;
Package haiku-maildaemon-cvs : Package haiku-maildaemon-cvs :
Inbox : Inbox :
boot home config add-ons mail_daemon system_filters ; boot home config add-ons mail_daemon system_filters ;
@@ -4,10 +4,11 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
if $(TARGET_PLATFORM) != haiku { if $(TARGET_PLATFORM) != haiku {
UsePublicHeaders mail ; UsePublicHeaders mail ;
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
} }
UsePrivateHeaders mail ; UsePrivateHeaders mail ;
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ; SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ;
Addon New\ Mail\ Notification : mail_daemon system_filters : Addon New\ Mail\ Notification : mail_daemon system_filters :
@@ -17,5 +18,5 @@ LinkAgainst New\ Mail\ Notification :
be libmail.so ; be libmail.so ;
Package haiku-maildaemon-cvs : Package haiku-maildaemon-cvs :
New\ Mail\ Notification : New\ Mail\ Notification :
boot home config add-ons mail_daemon system_filters ; boot home config add-ons mail_daemon system_filters ;
@@ -4,10 +4,11 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
if $(TARGET_PLATFORM) != haiku { if $(TARGET_PLATFORM) != haiku {
UsePublicHeaders mail ; UsePublicHeaders mail ;
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
} }
UsePrivateHeaders mail ; UsePrivateHeaders mail ;
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ; SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ;
Addon Outbox : mail_daemon system_filters : Addon Outbox : mail_daemon system_filters :
@@ -17,5 +18,5 @@ LinkAgainst Outbox :
be libmail.so ; be libmail.so ;
Package haiku-maildaemon-cvs : Package haiku-maildaemon-cvs :
Outbox : Outbox :
boot home config add-ons mail_daemon system_filters ; boot home config add-ons mail_daemon system_filters ;
@@ -4,10 +4,11 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
if $(TARGET_PLATFORM) != haiku { if $(TARGET_PLATFORM) != haiku {
UsePublicHeaders mail ; UsePublicHeaders mail ;
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
} }
UsePrivateHeaders mail ; UsePrivateHeaders mail ;
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ; SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ;
Addon Message\ Parser : mail_daemon system_filters : Addon Message\ Parser : mail_daemon system_filters :
@@ -17,5 +18,5 @@ LinkAgainst Message\ Parser :
be libmail.so ; be libmail.so ;
Package haiku-maildaemon-cvs : Package haiku-maildaemon-cvs :
Message\ Parser : Message\ Parser :
boot home config add-ons mail_daemon system_filters ; boot home config add-ons mail_daemon system_filters ;
+4 -4
View File
@@ -10,9 +10,9 @@ resource file_types message
resource app_version resource app_version
{ {
major = 3, major = 3,
middle = 0, middle = 0,
minor = 2, minor = 3,
/* 0 = development 1 = alpha 2 = beta /* 0 = development 1 = alpha 2 = beta
3 = gamma 4 = golden master 5 = final */ 3 = gamma 4 = golden master 5 = final */
@@ -20,8 +20,8 @@ resource app_version
internal = 3, internal = 3,
short_info = "BeMail 3.0.2", short_info = "BeMail 3.0.3",
long_info = "BeMail 3.0.2 ©2004 Haiku" long_info = "BeMail 3.0.3 ©2005 Haiku"
}; };
resource app_flags B_SINGLE_LAUNCH; resource app_flags B_SINGLE_LAUNCH;
+4 -4
View File
@@ -1,8 +1,8 @@
resource app_version resource app_version
{ {
major = 3, major = 3,
middle = 0, middle = 0,
minor = 2, minor = 3,
/* 0 = development 1 = alpha 2 = beta /* 0 = development 1 = alpha 2 = beta
3 = gamma 4 = golden master 5 = final */ 3 = gamma 4 = golden master 5 = final */
@@ -10,8 +10,8 @@ resource app_version
internal = 3, internal = 3,
short_info = "E-mail Preferences 3.0.2", short_info = "E-mail Preferences 3.0.3",
long_info = "E-mail Preferences 3.0.2 ©2004 Haiku" long_info = "E-mail Preferences 3.0.3 ©2005 Haiku"
}; };
resource(101, "BEOS:L:STD_ICON") #'ICON' array resource(101, "BEOS:L:STD_ICON") #'ICON' array
+9 -6
View File
@@ -1,7 +1,11 @@
Haiku Mail Daemon Replacement v3.0.2 Haiku Mail Daemon Replacement v3.0.3
VERSION HISTORY VERSION HISTORY
November 5 2005 - v3.0.3
- Fixed up source code to compile under the newest Haiku build system.
- AGMSBayesianSpamServer renamed to "spamdbm", runtime interface between the filter and server repaired, spam MIME types and icons also revived.
January 30 2005 - v3.0.2 January 30 2005 - v3.0.2
- Added SMTP SSL support - Added SMTP SSL support
- Fixed a nasty bug with Message-ID generation that was caused by incorrect headers when building on BONE - Fixed a nasty bug with Message-ID generation that was caused by incorrect headers when building on BONE
@@ -20,8 +24,7 @@ March 9 2004 - v2.3.0
- Handle spam messages with a malformed MIME Content-Type header that specifies multipart, but no boundary marker string. The messages show up as empty. They also sneakily have a second Content-Type that says the message is text. So, only use the multipart entry if there is no other, and only if the boundary string exists too. - Handle spam messages with a malformed MIME Content-Type header that specifies multipart, but no boundary marker string. The messages show up as empty. They also sneakily have a second Content-Type that says the message is text. So, only use the multipart entry if there is no other, and only if the boundary string exists too.
- Makefiles changed to do a parallel make on multiprocessor systems. - Makefiles changed to do a parallel make on multiprocessor systems.
- BeMail no longer breaks URLs in outgoing mails, at least it tries to do that. It's kind of a hack like the whole word-wrap algorithm, so it shouldn't do much more harm :) - BeMail no longer breaks URLs in outgoing mails, at least it tries to do that. It's kind of a hack like the whole word-wrap algorithm, so it shouldn't do much more harm :)
- E-mail addresses are now properly recognized without the "mailto:" - E-mail addresses are now properly recognized without the "mailto:" prefix.
prefix.
- Doesn't keep as many file handles open as before (was using 4 per window, with the BeOS limit of 100 files open, that was a maximum of 25 BeMail windows). - Doesn't keep as many file handles open as before (was using 4 per window, with the BeOS limit of 100 files open, that was a maximum of 25 BeMail windows).
- Included new icons by Stefano - Included new icons by Stefano
- Fixed a horrible bug that would cause deletion of entire mailboxes on newly set-up IMAP accounts. - Fixed a horrible bug that would cause deletion of entire mailboxes on newly set-up IMAP accounts.
@@ -41,7 +44,7 @@ December 4 2003 - v2.2.5
- General happiness. - General happiness.
October 12 2003 - v2.2.4 October 12 2003 - v2.2.4
- Fixed IMAP's mailbox look-up routines so that they use LSUB instead of LIST. This fixes a few bugs with certain mail servers, and allows better interoperability with other mail clients on the same account. - Fixed IMAP's mailbox look-up routines so that they use LSUB instead of LIST. This fixes a few bugs with certain mail servers, and allows better interoperability with other mail clients on the same account.
- Added the X-Mailer header to satisfy Feature Request 788700. - Added the X-Mailer header to satisfy Feature Request 788700.
- Made it so that the message count uses the correct singular/plural form, given the number of messages, in the daemon status window. - Made it so that the message count uses the correct singular/plural form, given the number of messages, in the daemon status window.
- CHECK_MEM build simply does not work with BONE, changed to get it to partially work. - CHECK_MEM build simply does not work with BONE, changed to get it to partially work.
@@ -243,7 +246,7 @@ November 21 2001 - v2.0.0a2
- Better RuleFilter (Descriptive filter names) - Better RuleFilter (Descriptive filter names)
- Better Folder Filter (No more email filename colisions) - Better Folder Filter (No more email filename colisions)
- SMTP Auth now works for real - SMTP Auth now works for real
November 06 2001 - v2.0.0 a1 November 06 2001 - v2.0.0 a1
- Complete rewrite from the ground up - Complete rewrite from the ground up
- Filters - Filters
@@ -272,7 +275,7 @@ June 12 2001 - v1.0.0 b4
- More bug fixes. More error checking is now being done. - More bug fixes. More error checking is now being done.
- First version of the filter API. - First version of the filter API.
- Some brand new bugs for you to play with. :) - Some brand new bugs for you to play with. :)
- The old mail_daemon icon is back! Thanks to Syn.Terra for it. - The old mail_daemon icon is back! Thanks to Syn.Terra for it.
June 08 2001 - v1.0.0 b3 June 08 2001 - v1.0.0 b3
- Installation script now creates an index for the MAIL:account - Installation script now creates an index for the MAIL:account
+6 -7
View File
@@ -2,16 +2,15 @@ SubDir HAIKU_TOP src servers mail ;
SetSubDirSupportedPlatformsBeOSCompatible ; SetSubDirSupportedPlatformsBeOSCompatible ;
if $(TARGET_PLATFORM) != haiku {
UsePublicHeaders mail ;
}
UsePublicHeaders [ FDirName add-ons mail_daemon ] ;
UsePrivateHeaders mail ; UsePrivateHeaders mail ;
SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ; SubDirHdrs [ FDirName $(HAIKU_TOP) headers os add-ons mail_daemon ] ;
if $(BONE_COMPATIBLE) {
SubDirC++Flags -DBONE ;
} else {
SubDirC++Flags -DBUILDING_R5_LIBNET ;
}
AddResources mail_daemon : mail_daemon.rdef ; AddResources mail_daemon : mail_daemon.rdef ;
Server mail_daemon : Server mail_daemon :
@@ -23,7 +22,7 @@ Server mail_daemon :
LinkAgainst mail_daemon : be libmail.so tracker stdc++.r4 $(NETWORK_LIBS) ; LinkAgainst mail_daemon : be libmail.so tracker stdc++.r4 $(NETWORK_LIBS) ;
Package haiku-maildaemon-cvs : Package haiku-maildaemon-cvs :
mail_daemon : mail_daemon :
boot beos system servers ; boot beos system servers ;
Packages haiku-maildaemon-cvs : Packages haiku-maildaemon-cvs :
+12 -12
View File
@@ -1,4 +1,4 @@
Haiku Mail Daemon Replacement v3.0.2 Haiku Mail Daemon Replacement v3.0.3
ABOUT: ABOUT:
@@ -21,7 +21,7 @@ files:
It will be installed in /boot/beos/system/lib It will be installed in /boot/beos/system/lib
mail_daemon mail_daemon
This is the new replacement Mail Daemon. It will be installed in This is the new replacement Mail Daemon. It will be installed in
/boot/beos/system/servers, overwriting the original mail_daemon file. /boot/beos/system/servers, overwriting the original mail_daemon file.
BeMail BeMail
@@ -31,7 +31,7 @@ files:
/boot/beos/apps/BeMail /boot/beos/apps/BeMail
E-mail E-mail
This is the new e-mail preferences panel. It will be installed to This is the new e-mail preferences panel. It will be installed to
/boot/beos/preferences, overwriting the original preferences app. /boot/beos/preferences, overwriting the original preferences app.
Addons Addons
@@ -63,7 +63,7 @@ from your Deskbar menu after installing the package.
USAGE: USAGE:
Open the E-mail preferences app (BeOS Menu/Preferences/E-mail) and Open the E-mail preferences app (BeOS Menu/Preferences/E-mail) and
configure your accounts. To save all the changes, close the window configure your accounts. To save all the changes, close the window
by clicking "Save". To delete an account, select it and press the by clicking "Save". To delete an account, select it and press the
DEL key or use the Remove button. DEL key or use the Remove button.
@@ -73,7 +73,7 @@ Single-click the icon to open your mail inbox. The field about new messages
will be available for selection if you have new messages, and will open a will be available for selection if you have new messages, and will open a
Tracker query displaying those messages. The Quit option quits the Tracker query displaying those messages. The Quit option quits the
mail_daemon. You don't want to do this. Right-clicking the Deskbar replicant mail_daemon. You don't want to do this. Right-clicking the Deskbar replicant
while pressing the SHIFT key reveals more options for Sending/Receiving while pressing the SHIFT key reveals more options for Sending/Receiving
emails. emails.
ADDON INSTALLATION: ADDON INSTALLATION:
@@ -81,7 +81,7 @@ ADDON INSTALLATION:
Add-ons should be installed in /boot/home/config/add-ons/ Add-ons should be installed in /boot/home/config/add-ons/
mail_daemon/ in the subdirectory specified in the add on documentation. mail_daemon/ in the subdirectory specified in the add on documentation.
This directory will be automatically created by the installation process. This directory will be automatically created by the installation process.
The distribution contains POP3 (with APOP support), IMAP and SMTP (including The distribution contains POP3 (with APOP support), IMAP and SMTP (including
SMTP-Auth) protocols, as well as Add Fortune, R5 Daemon Filter, and Match SMTP-Auth) protocols, as well as Add Fortune, R5 Daemon Filter, and Match
Header filters. Header filters.
@@ -92,7 +92,7 @@ in preferences, and choose the appropriate direction to apply them in
(specified below), then add that filter. You can add several instances of (specified below), then add that filter. You can add several instances of
the same filter type, although this is only recomended for RuleFilter. Addons the same filter type, although this is only recomended for RuleFilter. Addons
will be executed in the order they appear in the list, and can be reorderd with will be executed in the order they appear in the list, and can be reorderd with
a simple drag and drop. To install new filters, follow the directions in a simple drag and drop. To install new filters, follow the directions in
ADDON INSTALLATION. ADDON INSTALLATION.
Add Fortune Add Fortune
@@ -120,7 +120,7 @@ ADDON INSTALLATION.
them as [ and ] characters instead of marking a set of values. For more them as [ and ] characters instead of marking a set of values. For more
info on this, read up on regular expressions. info on this, read up on regular expressions.
AGMS Bayesian Spam Filter Spam Filter
This filters out spam. If you want to know more (and you may) more This filters out spam. If you want to know more (and you may) more
documentation can be found in the directory with no spaces in its documentation can be found in the directory with no spaces in its
name: AGMSBayesianSpamDocumentation. It even has, unlike this, lots of name: AGMSBayesianSpamDocumentation. It even has, unlike this, lots of
@@ -145,7 +145,7 @@ The latest version has the following (interesting) features:
- IMAP add-on - IMAP add-on
- SMTP add-on - SMTP add-on
- SSL support - SSL support
- Leave messages on server option, with optional delete messages from - Leave messages on server option, with optional delete messages from
server after deleting local message. server after deleting local message.
- PPP connection detection. - PPP connection detection.
- Multiple accounts. - Multiple accounts.
@@ -170,8 +170,8 @@ This is a partial list of what we intend to implement. Suggestions are welcome:
OTHER STUFF: OTHER STUFF:
This program was created by Haiku, Inc. (http://www.haiku-os.org) This program was created by Haiku, Inc. (http://www.haiku-os.org)
Special thanks goes to Todd Lair, Brad Froehle, David Reid, Special thanks goes to Todd Lair, Brad Froehle, David Reid,
Rene Gollent and others for helping us with ideas and code. We also would Rene Gollent and others for helping us with ideas and code. We also would
like to thank the BeOS community in general for their support. like to thank the BeOS community in general for their support.
Japanese translation by: Koki ([email protected]) and Jun Suzki. Japanese translation by: Koki ([email protected]) and Jun Suzki.
@@ -185,4 +185,4 @@ Copyright (c)2001-2005, Haiku, Inc.. All rights reserved.
Original software written by Bruno G. Albuquerque ([email protected]), Nathan Whitehorn ([email protected]), Peter Folk ([email protected]), Stephan Assmus Original software written by Bruno G. Albuquerque ([email protected]), Nathan Whitehorn ([email protected]), Peter Folk ([email protected]), Stephan Assmus
([email protected]), Alan Ellis, David Reid,Axel Dörfler ([email protected]) ([email protected]), Alan Ellis, David Reid,Axel Dörfler ([email protected])
and Alexander G. M. Smith ([email protected]). and Alexander G. M. Smith ([email protected]).
+4 -4
View File
@@ -2,9 +2,9 @@ resource(1, "BEOS:APP_SIG") #'MIMS' "application/x-vnd.Be-POST";
resource app_version resource app_version
{ {
major = 3, major = 3,
middle = 0, middle = 0,
minor = 2, minor = 3,
/* 0 = development 1 = alpha 2 = beta /* 0 = development 1 = alpha 2 = beta
3 = gamma 4 = golden master 5 = final */ 3 = gamma 4 = golden master 5 = final */
@@ -12,8 +12,8 @@ resource app_version
internal = 3, internal = 3,
short_info = "Mail Daemon 3.0.2", short_info = "Mail Daemon 3.0.3",
long_info = "Mail Daemon 3.0.2 ©2004 Haiku" long_info = "Mail Daemon 3.0.3 ©2005 Haiku"
}; };
resource(0, "Read") #'BBMP' archive BBitmap resource(0, "Read") #'BBMP' archive BBitmap
+14 -14
View File
@@ -40,7 +40,7 @@
#include <MDRLanguage.h> #include <MDRLanguage.h>
#ifdef BONE #ifndef HAIKU_TARGET_PLATFORM_BEOS // BONE and later have these, R5 doesn't.
#define BONE_SERIAL_PPP_GET_STATUS 0xbe230501 #define BONE_SERIAL_PPP_GET_STATUS 0xbe230501
#define BSPPP_CONNECTED 4 #define BSPPP_CONNECTED 4
typedef struct { typedef struct {
@@ -233,7 +233,7 @@ MailDaemonApp::MessageReceived(BMessage *msg)
switch (msg->what) { switch (msg->what) {
case 'moto': case 'moto':
if (settings_file.CheckOnlyIfPPPUp()) { if (settings_file.CheckOnlyIfPPPUp()) {
#ifdef BONE #ifndef HAIKU_TARGET_PLATFORM_BEOS
int s = socket(AF_INET, SOCK_DGRAM, 0); int s = socket(AF_INET, SOCK_DGRAM, 0);
bsppp_status_t status; bsppp_status_t status;
@@ -602,13 +602,13 @@ makeIndices()
if (fs_stat_dev(device,&info) < 0 || (info.flags & B_FS_HAS_QUERY) == 0) if (fs_stat_dev(device,&info) < 0 || (info.flags & B_FS_HAS_QUERY) == 0)
continue; continue;
// Work-around for misbehaviour of earlier versions - should be // Work-around for misbehaviour of earlier versions - should be
// kept in for some time. // kept in for some time.
// It removes the B_MAIL_ATTR_FLAGS if it is of B_STRING_TYPE, // It removes the B_MAIL_ATTR_FLAGS if it is of B_STRING_TYPE,
// because that's what the MDR created before... // because that's what the MDR created before...
index_info indexInfo; index_info indexInfo;
if (fs_stat_index(device, B_MAIL_ATTR_FLAGS, &indexInfo) == 0 if (fs_stat_index(device, B_MAIL_ATTR_FLAGS, &indexInfo) == 0
&& indexInfo.type == B_STRING_TYPE) && indexInfo.type == B_STRING_TYPE)
fs_remove_index(device, B_MAIL_ATTR_FLAGS); fs_remove_index(device, B_MAIL_ATTR_FLAGS);
for (int32 i = 0;stringIndices[i];i++) for (int32 i = 0;stringIndices[i];i++)
@@ -626,13 +626,13 @@ makeIndices()
void void
addAttribute(BMessage &msg,char *name,char *publicName,int32 type = B_STRING_TYPE,bool viewable = true,bool editable = false,int32 width = 200) addAttribute(BMessage &msg,char *name,char *publicName,int32 type = B_STRING_TYPE,bool viewable = true,bool editable = false,int32 width = 200)
{ {
msg.AddString("attr:name",name); msg.AddString("attr:name",name);
msg.AddString("attr:public_name",publicName); msg.AddString("attr:public_name",publicName);
msg.AddInt32("attr:type",type); msg.AddInt32("attr:type",type);
msg.AddBool("attr:viewable",viewable); msg.AddBool("attr:viewable",viewable);
msg.AddBool("attr:editable",editable); msg.AddBool("attr:editable",editable);
msg.AddInt32("attr:width",width); msg.AddInt32("attr:width",width);
msg.AddInt32("attr:alignment",B_ALIGN_LEFT); msg.AddInt32("attr:alignment",B_ALIGN_LEFT);
} }