Mercurial > masqmail
comparison src/masqmail.c @ 261:0afe18a9ee03
fixed previous commit and excluded mode_version() from main()
author | markus schnalke <meillo@marmaro.de> |
---|---|
date | Thu, 02 Dec 2010 16:52:39 -0300 |
parents | bd3109ec0f0a |
children | fc1c6425c024 |
comparison
equal
deleted
inserted
replaced
260:bd3109ec0f0a | 261:0afe18a9ee03 |
---|---|
359 set_online_name(route_name); | 359 set_online_name(route_name); |
360 } | 360 } |
361 ret = queue_run_online(); | 361 ret = queue_run_online(); |
362 } | 362 } |
363 return ret; | 363 return ret; |
364 } | |
365 | |
366 static void | |
367 mode_version(void) | |
368 { | |
369 gchar *with_resolver = ""; | |
370 gchar *with_auth = ""; | |
371 gchar *with_ident = ""; | |
372 | |
373 #ifdef ENABLE_RESOLVER | |
374 with_resolver = " +resolver"; | |
375 #endif | |
376 #ifdef ENABLE_AUTH | |
377 with_auth = " +auth"; | |
378 #endif | |
379 #ifdef ENABLE_IDENT | |
380 with_ident = " +ident"; | |
381 #endif | |
382 | |
383 printf("%s %s%s%s%s\n", PACKAGE, VERSION, with_resolver, with_auth, with_ident); | |
364 } | 384 } |
365 | 385 |
366 int | 386 int |
367 main(int argc, char *argv[]) | 387 main(int argc, char *argv[]) |
368 { | 388 { |
387 gchar *full_sender_name = NULL; | 407 gchar *full_sender_name = NULL; |
388 gboolean do_verbose = FALSE; | 408 gboolean do_verbose = FALSE; |
389 gint debug_level = -1; | 409 gint debug_level = -1; |
390 | 410 |
391 /* strip the path part */ | 411 /* strip the path part */ |
392 progname = strrchr(argc[0], '/'); | 412 progname = strrchr(argv[0], '/'); |
393 progname = (progname) ? progname+1 : argc[0]; | 413 progname = (progname) ? progname+1 : argv[0]; |
394 | 414 |
395 if (strcmp(progname, "mailq") == 0) { | 415 if (strcmp(progname, "mailq") == 0) { |
396 mta_mode = MODE_LIST; | 416 mta_mode = MODE_LIST; |
397 } else if (strcmp(progname, "mailrm") == 0) { | 417 } else if (strcmp(progname, "mailrm") == 0) { |
398 mta_mode = MODE_MCMD; | 418 mta_mode = MODE_MCMD; |
529 if (!mta_mode) { | 549 if (!mta_mode) { |
530 mta_mode = (arg<argc || opt_t) ? MODE_ACCEPT : MODE_VERSION; | 550 mta_mode = (arg<argc || opt_t) ? MODE_ACCEPT : MODE_VERSION; |
531 } | 551 } |
532 | 552 |
533 if (mta_mode == MODE_VERSION) { | 553 if (mta_mode == MODE_VERSION) { |
534 gchar *with_resolver = ""; | 554 mode_version(); |
535 gchar *with_auth = ""; | |
536 gchar *with_ident = ""; | |
537 | |
538 #ifdef ENABLE_RESOLVER | |
539 with_resolver = " +resolver"; | |
540 #endif | |
541 #ifdef ENABLE_AUTH | |
542 with_auth = " +auth"; | |
543 #endif | |
544 #ifdef ENABLE_IDENT | |
545 with_ident = " +ident"; | |
546 #endif | |
547 | |
548 printf("%s %s%s%s%s\n", PACKAGE, VERSION, with_resolver, with_auth, with_ident); | |
549 | |
550 exit(EXIT_SUCCESS); | 555 exit(EXIT_SUCCESS); |
551 } | 556 } |
552 | 557 |
553 /* initialize random generator */ | 558 /* initialize random generator */ |
554 srand(time(NULL)); | 559 srand(time(NULL)); |