Merge 0.6 with latest trunk bits
This commit is contained in:
+14
-2
@@ -6,6 +6,11 @@ cmake_minimum_required(VERSION 2.6)
|
||||
cmake_policy(VERSION 2.6)
|
||||
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_SOURCE_DIR}/cmake/")
|
||||
|
||||
set(BONGO_V_MAJOR 0)
|
||||
set(BONGO_V_MINOR 1)
|
||||
set(BONGO_V_BUILD 0)
|
||||
set(BONGO_V_STR "${BONGO_V_MAJOR}.${BONGO_V_MINOR}.${BONGO_V_BUILD}")
|
||||
|
||||
# arguments we can supply to the build system - TODO
|
||||
set(BONGO_USER "root" CACHE STRING "User account Bongo should run under")
|
||||
option(CONN_TRACE "Enable connection tracing" OFF)
|
||||
@@ -35,11 +40,18 @@ include_directories(BEFORE ${CMAKE_CURRENT_SOURCE_DIR}/include/)
|
||||
include_directories(BEFORE ${CMAKE_CURRENT_BINARY_DIR}/include/)
|
||||
|
||||
# now build our various libraries, agents, binaries.
|
||||
foreach (LIBRARY xpl streamio logging msgapi connio bongoutil
|
||||
json cal nmap python/libbongo python/bongo)
|
||||
# DO NOT ALTER (SO)VERSION ON LIBRARIES WITHOUT ASKING!
|
||||
foreach (LIBRARY xpl streamio logging msgapi connio util json cal nmap)
|
||||
add_subdirectory (src/libs/${LIBRARY})
|
||||
set_target_properties(bongo${LIBRARY} PROPERTIES
|
||||
SOVERSION 0
|
||||
VERSION ${BONGO_V_STR}
|
||||
)
|
||||
endforeach (LIBRARY)
|
||||
|
||||
add_subdirectory(src/libs/python/libbongo)
|
||||
add_subdirectory(src/libs/python/bongo)
|
||||
|
||||
foreach (AGENT antispam avirus imap pop queue rules smtp store)
|
||||
add_subdirectory (src/agents/${AGENT})
|
||||
endforeach (AGENT)
|
||||
|
||||
@@ -2,9 +2,9 @@ set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Mail and calendering made simple")
|
||||
set(CPACK_PACKAGE_VENDOR "Bongo Project")
|
||||
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
|
||||
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR "0")
|
||||
set(CPACK_PACKAGE_VERSION_MINOR "1")
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "0")
|
||||
set(CPACK_PACKAGE_VERSION_MAJOR "${BONGO_V_MAJOR}")
|
||||
set(CPACK_PACKAGE_VERSION_MINOR "${BONGO_V_MINOR}")
|
||||
set(CPACK_PACKAGE_VERSION_PATCH "${BONGO_V_PATCH}")
|
||||
set(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}")
|
||||
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ typedef struct _BongoConfigItem {
|
||||
} BongoConfigItem;
|
||||
|
||||
BOOL ReadBongoConfiguration(BongoConfigItem *config, char *filename);
|
||||
BOOL ProcessBongoConfiguration(BongoConfigItem *config, const BongoJsonNode *node);
|
||||
BOOL ProcessBongoConfiguration(BongoConfigItem *config, BongoJsonNode *node);
|
||||
BOOL SetBongoConfigItem(BongoConfigItem *schema, BongoJsonNode *node);
|
||||
void FreeBongoConfiguration(BongoConfigItem *config);
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include "queued.h"
|
||||
#include "conf.h"
|
||||
#include "queue.h"
|
||||
|
||||
@@ -203,7 +204,7 @@ ReadConfiguration (BOOL *recover)
|
||||
|
||||
unsigned int x;
|
||||
for(x=0;x<Conf.domains->len;x++) {
|
||||
unsigned char *aconfig;
|
||||
char *aconfig;
|
||||
unsigned char path[100];
|
||||
BongoJsonNode *node;
|
||||
struct _AliasStruct a;
|
||||
|
||||
@@ -228,7 +228,7 @@ SendMimeDetails(Connection *conn, MIMEReportStruct *report)
|
||||
for (i=0; i < parts; i++) {
|
||||
/* 2002 <type> <subtype> <charset> <encoding> <name> <part-head-start> <part-head-size> <part-start-pos> <Size> <RFC822 Header-Size> <lines> */
|
||||
if (XplStrCaseCmp(part[i].subtype, "RFC822") && ((i + 1) < parts)) {
|
||||
ccode = ConnWriteF(conn, "2002-%s %s %s %s \"%s\" %d %lu %lu %lu %lu %lu\r\n",
|
||||
ccode = ConnWriteF(conn, "2002-%s %s %s %s \"%s\" %ld %lu %lu %lu %lu %lu\r\n",
|
||||
part[i].type,
|
||||
part[i].subtype,
|
||||
part[i].charset,
|
||||
@@ -241,7 +241,7 @@ SendMimeDetails(Connection *conn, MIMEReportStruct *report)
|
||||
part[i + 1].start - part[i].start,
|
||||
part[i].lines);
|
||||
} else if (XplStrCaseCmp(part[i].type, "TEXT")) {
|
||||
ccode = ConnWriteF(conn, "2002-%s %s %s %s \"%s\" %d %lu %lu %lu 0 %lu\r\n",
|
||||
ccode = ConnWriteF(conn, "2002-%s %s %s %s \"%s\" %ld %lu %lu %lu 0 %lu\r\n",
|
||||
part[i].type,
|
||||
part[i].subtype,
|
||||
part[i].charset,
|
||||
@@ -253,7 +253,7 @@ SendMimeDetails(Connection *conn, MIMEReportStruct *report)
|
||||
part[i].length,
|
||||
part[i].lines);
|
||||
} else {
|
||||
ccode = ConnWriteF(conn, "2002-%s %s %s %s \"%s\" %d %lu %lu %lu 0 0\r\n",
|
||||
ccode = ConnWriteF(conn, "2002-%s %s %s %s \"%s\" %ld %lu %lu %lu 0 0\r\n",
|
||||
part[i].type,
|
||||
part[i].subtype,
|
||||
part[i].charset,
|
||||
|
||||
@@ -2135,7 +2135,7 @@ CreateDSNMessage(FILE *data, FILE *control, FILE *rtsData, FILE *rtsControl, BOO
|
||||
|
||||
case DELIVER_QUOTA_EXCEEDED: {
|
||||
if (Conf.quotaMessage && (Conf.quotaMessage[0] != '\0')) {
|
||||
fprintf(rtsData, Conf.quotaMessage);
|
||||
fprintf(rtsData, "%s", Conf.quotaMessage);
|
||||
} else {
|
||||
fprintf(rtsData, DEFAULT_QUOTA_MESSAGE);
|
||||
}
|
||||
|
||||
@@ -242,7 +242,7 @@ int CommandAddressResolve(void *param) {
|
||||
unsigned char buffer[1024]; /* FIXME: is this too big? */
|
||||
QueueClient *client = (QueueClient *)param;
|
||||
|
||||
handled = aliasing(client->buffer + 16, &cnt, &buffer);
|
||||
handled = aliasing(client->buffer + 16, &cnt, buffer);
|
||||
if (!handled) {
|
||||
ConnWriteF(client->conn, MSG4001NO_USER"\r\n", client->buffer + 16);
|
||||
} else {
|
||||
|
||||
@@ -3969,7 +3969,7 @@ ReadConfiguration (void)
|
||||
|
||||
LocalAddress = MsgGetHostIPAddress ();
|
||||
|
||||
MsgGetServerCredential(&NMAPHash);
|
||||
MsgGetServerCredential(NMAPHash);
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
@@ -115,7 +115,7 @@ PutOrReplaceConfig(StoreClient *client, char *collection, char *filename, char *
|
||||
char command[1024];
|
||||
|
||||
snprintf(command, 1000, "INFO %s/%s\r\n", collection, filename);
|
||||
ccode = NMAPSendCommandF(client->conn, command);
|
||||
ccode = NMAPSendCommandF(client->conn, "%s", command);
|
||||
ccode = NMAPReadAnswer(client->conn, client->buffer, sizeof(client->buffer), TRUE);
|
||||
while (ccode == 2001)
|
||||
ccode = NMAPReadAnswer(client->conn, client->buffer, sizeof(client->buffer), TRUE);
|
||||
@@ -130,7 +130,7 @@ PutOrReplaceConfig(StoreClient *client, char *collection, char *filename, char *
|
||||
collection, STORE_DOCTYPE_CONFIG, len, filename);
|
||||
}
|
||||
|
||||
NMAPSendCommandF(client->conn, command);
|
||||
NMAPSendCommandF(client->conn, "%s", command);
|
||||
ccode = NMAPReadAnswer(client->conn, client->buffer, sizeof(client->buffer), TRUE);
|
||||
|
||||
if (ccode == 2002) {
|
||||
@@ -151,7 +151,7 @@ BOOL
|
||||
NMAPSimpleCommand(StoreClient *client, char *command) {
|
||||
CCode ccode;
|
||||
|
||||
NMAPSendCommandF(client->conn, command);
|
||||
NMAPSendCommandF(client->conn, "%s", command);
|
||||
ccode = NMAPReadAnswer(client->conn, client->buffer, sizeof(client->buffer), TRUE);
|
||||
if (1000 == ccode)
|
||||
return TRUE;
|
||||
|
||||
@@ -302,7 +302,7 @@ StartAgentsWithPriority(int priority, BOOL onlyCrashed, BOOL printMessage)
|
||||
static BOOL
|
||||
LoadAgentConfiguration()
|
||||
{
|
||||
unsigned char *config;
|
||||
char *config;
|
||||
BOOL retcode = FALSE;
|
||||
BongoJsonNode *node;
|
||||
BongoJsonResult res;
|
||||
|
||||
@@ -158,7 +158,7 @@ MsgAuthDeleteCookie(const char *username, const char *token)
|
||||
|
||||
// next, clear the existing file
|
||||
rewind(cookiefile);
|
||||
ftruncate((int)cookiefile, 0);
|
||||
ftruncate(fileno(cookiefile), 0);
|
||||
|
||||
// now, go through memory writing out only the cookies we want to keep
|
||||
for (i = 0; i < cookiecount; i++) {
|
||||
|
||||
@@ -180,7 +180,7 @@ MsgSQLBeginTransaction(MsgSQLHandle *handle)
|
||||
case SQLITE_BUSY:
|
||||
return -2;
|
||||
default:
|
||||
printf("Database error %d : %s\n", result, sqlite3_errmsg(stmt->stmt));
|
||||
printf("Database error %d : %s\n", result, sqlite3_errmsg(handle->db));
|
||||
//DStoreStmtError(handle, stmt);
|
||||
return -1;
|
||||
}
|
||||
@@ -212,7 +212,7 @@ MsgSQLCommitTransaction(MsgSQLHandle *handle)
|
||||
|
||||
if (SQLITE_DONE != result) {
|
||||
// DStoreStmtError(handle, stmt);
|
||||
printf("Database commit error %d: %s\n", result, sqlite3_errmsg(stmt->stmt));
|
||||
printf("Database commit error %d: %s\n", result, sqlite3_errmsg(handle->db));
|
||||
return -1;
|
||||
}
|
||||
return 0;
|
||||
@@ -440,10 +440,8 @@ MsgSQLResultInt64(MsgSQLStatement *_stmt, int column)
|
||||
int
|
||||
MsgSQLResultText(MsgSQLStatement *_stmt, int column, char *result, size_t result_size)
|
||||
{
|
||||
char *out;
|
||||
|
||||
const char *out = sqlite3_column_text(_stmt->stmt, column);
|
||||
DEBUG(" - result text %ld\n", _stmt->stmt)
|
||||
out = sqlite3_column_text(_stmt->stmt, column);
|
||||
if (out != NULL)
|
||||
strncpy(result, out, result_size);
|
||||
|
||||
@@ -453,6 +451,6 @@ MsgSQLResultText(MsgSQLStatement *_stmt, int column, char *result, size_t result
|
||||
int
|
||||
MsgSQLResultTextPtr(MsgSQLStatement *_stmt, int column, char **ptr)
|
||||
{
|
||||
*ptr = sqlite3_column_text(_stmt->stmt, column);
|
||||
*ptr = strdup(sqlite3_column_text(_stmt->stmt, column));
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -274,7 +274,7 @@ ReadBongoConfiguration(BongoConfigItem *config, char *filename) {
|
||||
*/
|
||||
|
||||
BOOL
|
||||
ProcessBongoConfiguration(BongoConfigItem *config, const BongoJsonNode *node)
|
||||
ProcessBongoConfiguration(BongoConfigItem *config, BongoJsonNode *node)
|
||||
{
|
||||
while (config->type != BONGO_JSON_NULL) {
|
||||
BongoJsonNode *result = BongoJsonJPath(node, config->source);
|
||||
|
||||
Reference in New Issue
Block a user