xref: /haiku/src/servers/mail/main.cpp (revision daf972c99c4a66baa0bc4df698334eda8f224a7d)
1f802f04aSAxel Dörfler /*
2*daf972c9SAxel Dörfler  * Copyright 2007-2012, Haiku, Inc. All rights reserved.
31af4fa4bSClemens Zeidler  * Copyright 2001-2002 Dr. Zoidberg Enterprises. All rights reserved.
41af4fa4bSClemens Zeidler  * Copyright 2011, Clemens Zeidler <haiku@clemens-zeidler.de>
5f802f04aSAxel Dörfler  * Distributed under the terms of the MIT License.
6f7215ac8SNathan Whitehorn  */
7f7215ac8SNathan Whitehorn 
8f7215ac8SNathan Whitehorn 
9*daf972c9SAxel Dörfler #include "MailDaemonApplication.h"
10f7215ac8SNathan Whitehorn 
11f7215ac8SNathan Whitehorn 
12f7215ac8SNathan Whitehorn int
main(int argc,const char ** argv)13f7215ac8SNathan Whitehorn main(int argc, const char** argv)
14f7215ac8SNathan Whitehorn {
15f7215ac8SNathan Whitehorn 	bool remakeMIMETypes = false;
16f7215ac8SNathan Whitehorn 
17f7215ac8SNathan Whitehorn 	for (int i = 1; i < argc; i++) {
18f7215ac8SNathan Whitehorn 		if (strcmp(argv[i], "-E") == 0) {
19f7215ac8SNathan Whitehorn 			if (!BMailSettings().DaemonAutoStarts())
20f7215ac8SNathan Whitehorn 				return 0;
21f7215ac8SNathan Whitehorn 		}
22*daf972c9SAxel Dörfler 		if (strcmp(argv[i], "-M") == 0)
23f7215ac8SNathan Whitehorn 			remakeMIMETypes = true;
24f7215ac8SNathan Whitehorn 	}
25f7215ac8SNathan Whitehorn 
26*daf972c9SAxel Dörfler 	MailDaemonApplication app;
271af4fa4bSClemens Zeidler 	if (remakeMIMETypes)
281af4fa4bSClemens Zeidler 		app.MakeMimeTypes(true);
291af4fa4bSClemens Zeidler 	app.Run();
30f7215ac8SNathan Whitehorn 	return 0;
31f7215ac8SNathan Whitehorn }
32