示例#1
0
int main(int argc, char *argv[])
{
	serverConfig_t config;
	int result;
		
	openlog(PNAME, LOG_PID, LOG_MAIL);

        memset(&config, 0, sizeof(serverConfig_t));
	result = server_getopt(&config, "SIEVE", argc, argv);
	if (result == -1) goto shutdown;
	if (result == 1) {
		server_showhelp("dbmail-timsieved",
			"This daemon provides Tim's Sieve Daemon services.\n");
		goto shutdown;
	}

	config.ClientHandler = tims_handle_connection;

	/* Get the Sieve capabilities. This may also cause the
	 * program to bomb out if Sieve support was not compiled in. */
	sieve_extensions = sort_listextensions();
	if (sieve_extensions == NULL) {
		fprintf(stderr, "dbmail-timsieved: error loading Sieve extensions.\n\n");
		result = 1;
		goto shutdown;
	}
	result = server_mainloop(&config, "SIEVE", "dbmail-timsieved");
shutdown:
	TRACE(TRACE_INFO, "exit");
	return result;
}
示例#2
0
int main(int argc, char *argv[])
{
	ServerConfig_T config;
	int result;
		
	openlog(PNAME, LOG_PID, LOG_MAIL);
        memset(&config, 0, sizeof(ServerConfig_T));
	result = server_getopt(&config, "POP", argc, argv);
	if (result == -1) goto shutdown;
	if (result == 1) {
		server_showhelp("dbmail-pop3d",
			"This daemon provides Post Office Protocol v3 services.\n");
		goto shutdown;
	}
	config.ClientHandler = pop3_handle_connection;
	pop_before_smtp = config.service_before_smtp;
	result = server_mainloop(&config, "dbmail-pop3d");
shutdown:
	TRACE(TRACE_INFO, "exit");
	return result;
}
示例#3
0
文件: lmtpd.c 项目: alniaky/dbmail
int main(int argc, char *argv[])
{
	serverConfig_t config;
	int result;
		
	openlog(PNAME, LOG_PID, LOG_MAIL);
        memset(&config, 0, sizeof(serverConfig_t));
	result = server_getopt(&config, "LMTP", argc, argv);
	if (result == -1) goto shutdown;
	if (result == 1) {
		server_showhelp("dbmail-lmtpd",
			"This daemon provides Local Mail Transport Protocol services.");
		goto shutdown;
	}

	config.ClientHandler = lmtp_handle_connection;
	result = server_mainloop(&config, "LMTP", "dbmail-lmtpd");
shutdown:
	TRACE(TRACE_INFO, "exit");
	return result;
}
示例#4
0
int main(int argc, char *argv[])
{
	ServerConfig_T config;
	int result;
	openlog(PNAME, LOG_PID, LOG_MAIL);
	memset(&config, 0, sizeof(ServerConfig_T));
	result = server_getopt(&config, "IMAP", argc, argv);
	if (result == -1) goto shutdown;
	if (result == 1) {
		server_showhelp("dbmail-imapd",
				"This daemon provides Internet "
				"Message Access Protocol 4.1 "
				"services.");
		goto shutdown;
	}

	config.ClientHandler = imap_handle_connection;
	imap_before_smtp = config.service_before_smtp;
	result = server_mainloop(&config, "dbmail-imapd");
shutdown:
	TRACE(TRACE_INFO, "return [%d]", result);
	return result;
}
示例#5
0
文件: httpd.c 项目: alniaky/dbmail
int main(int argc, char *argv[])
{
	serverConfig_t config;
	int result;

	g_mime_init(0);
	g_mime_parser_get_type();
	g_mime_stream_get_type();
	g_mime_stream_mem_get_type();
	g_mime_stream_file_get_type();
	g_mime_stream_buffer_get_type();
	g_mime_stream_filter_get_type();
	g_mime_filter_crlf_get_type();
	
	openlog(PNAME, LOG_PID, LOG_MAIL);

        memset(&config, 0, sizeof(serverConfig_t));
	result = server_getopt(&config, "HTTP", argc, argv);
	if (result == -1)
		goto shutdown;

	if (result == 1) {
		server_showhelp("dbmail-httpd",
			"This daemon provides HTTP services.");
		goto shutdown;
	}

	config.cb = Request_cb;
	result = server_mainloop(&config, "HTTP", "dbmail-httpd");
	
shutdown:
	g_mime_shutdown();
	config_free();

	TRACE(TRACE_INFO, "exit");
	return result;
}