1 /*
2 Copyright (C) 1999-2004 IC & S dbmail@ic-s.nl
3 Copyright (c) 2004-2012 NFG Net Facilities Group BV support@nfg.nl
4 Copyright (C) 2006 Aaron Stone aaron@serendipity.cx
5
6 This program is free software; you can redistribute it and/or
7 modify it under the terms of the GNU General Public License
8 as published by the Free Software Foundation; either
9 version 2 of the License, or (at your option) any later
10 version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program; if not, write to the Free Software
19 Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 */
21
22 /*
23 *
24 * pop3d.c
25 *
26 * main prg for pop3 daemon
27 */
28
29 #include "dbmail.h"
30 #define THIS_MODULE "pop3d"
31 #define PNAME "dbmail/pop3d"
32
33 /* also used in pop3.c */
34 int pop_before_smtp = 0;
35
main(int argc,char * argv[])36 int main(int argc, char *argv[])
37 {
38 ServerConfig_T config;
39 int result;
40
41 openlog(PNAME, LOG_PID, LOG_MAIL);
42 memset(&config, 0, sizeof(ServerConfig_T));
43 result = server_getopt(&config, "POP", argc, argv);
44 if (result == -1) goto shutdown;
45 if (result == 1) {
46 server_showhelp("dbmail-pop3d",
47 "This daemon provides Post Office Protocol v3 services.\n");
48 goto shutdown;
49 }
50 config.ClientHandler = pop3_handle_connection;
51 pop_before_smtp = config.service_before_smtp;
52 result = server_mainloop(&config, "dbmail-pop3d");
53 shutdown:
54 TRACE(TRACE_INFO, "exit");
55 return result;
56 }
57
58