maidag: remove `default' mode (superseded by --mda).
Showing
2 changed files
with
2 additions
and
29 deletions
... | @@ -18,7 +18,7 @@ | ... | @@ -18,7 +18,7 @@ |
18 | 18 | ||
19 | #include "maidag.h" | 19 | #include "maidag.h" |
20 | 20 | ||
21 | enum maidag_mode maidag_mode = mode_default; | 21 | enum maidag_mode maidag_mode = mode_mda; |
22 | int multiple_delivery; /* Don't return errors when delivering to multiple | 22 | int multiple_delivery; /* Don't return errors when delivering to multiple |
23 | recipients */ | 23 | recipients */ |
24 | int ex_quota_tempfail; /* Return temporary failure if mailbox quota is | 24 | int ex_quota_tempfail; /* Return temporary failure if mailbox quota is |
... | @@ -420,7 +420,6 @@ static int | ... | @@ -420,7 +420,6 @@ static int |
420 | cb_delivery_mode (mu_debug_t debug, void *data, mu_config_value_t *val) | 420 | cb_delivery_mode (mu_debug_t debug, void *data, mu_config_value_t *val) |
421 | { | 421 | { |
422 | static mu_kwd_t mode_tab[] = { | 422 | static mu_kwd_t mode_tab[] = { |
423 | { "default", mode_default }, | ||
424 | { "mda", mode_mda }, | 423 | { "mda", mode_mda }, |
425 | { "url", mode_url }, | 424 | { "url", mode_url }, |
426 | { "lmtp", mode_lmtp }, | 425 | { "lmtp", mode_lmtp }, |
... | @@ -443,7 +442,7 @@ cb_delivery_mode (mu_debug_t debug, void *data, mu_config_value_t *val) | ... | @@ -443,7 +442,7 @@ cb_delivery_mode (mu_debug_t debug, void *data, mu_config_value_t *val) |
443 | struct mu_cfg_param maidag_cfg_param[] = { | 442 | struct mu_cfg_param maidag_cfg_param[] = { |
444 | { "delivery-mode", mu_cfg_callback, NULL, 0, cb_delivery_mode, | 443 | { "delivery-mode", mu_cfg_callback, NULL, 0, cb_delivery_mode, |
445 | N_("Set delivery mode"), | 444 | N_("Set delivery mode"), |
446 | N_("mode: {default | mda | url | lmtp}") }, | 445 | N_("mode: {mda | url | lmtp}") }, |
447 | { "exit-multiple-delivery-success", mu_cfg_bool, &multiple_delivery, 0, NULL, | 446 | { "exit-multiple-delivery-success", mu_cfg_bool, &multiple_delivery, 0, NULL, |
448 | N_("In case of multiple delivery, exit with code 0 if at least one " | 447 | N_("In case of multiple delivery, exit with code 0 if at least one " |
449 | "delivery succeeded.") }, | 448 | "delivery succeeded.") }, |
... | @@ -574,8 +573,6 @@ main (int argc, char *argv[]) | ... | @@ -574,8 +573,6 @@ main (int argc, char *argv[]) |
574 | exit (EX_CONFIG); | 573 | exit (EX_CONFIG); |
575 | 574 | ||
576 | current_uid = getuid (); | 575 | current_uid = getuid (); |
577 | if (maidag_mode == mode_default && current_uid == 0) | ||
578 | maidag_mode = mode_mda; | ||
579 | 576 | ||
580 | if (log_to_stderr == -1) | 577 | if (log_to_stderr == -1) |
581 | log_to_stderr = maidag_mode == mode_url; | 578 | log_to_stderr = maidag_mode == mode_url; |
... | @@ -606,29 +603,6 @@ main (int argc, char *argv[]) | ... | @@ -606,29 +603,6 @@ main (int argc, char *argv[]) |
606 | } | 603 | } |
607 | return maidag_lmtp_server (); | 604 | return maidag_lmtp_server (); |
608 | 605 | ||
609 | case mode_default: | ||
610 | { | ||
611 | static char *s_argv[2]; | ||
612 | struct mu_auth_data *auth = mu_get_auth_by_uid (current_uid); | ||
613 | |||
614 | if (!auth) | ||
615 | { | ||
616 | mu_error (_("cannot get username")); | ||
617 | return EX_UNAVAILABLE; | ||
618 | } | ||
619 | |||
620 | if (argc > 0 && strcmp (auth->name, argv[0])) | ||
621 | { | ||
622 | mu_error (_("recipients given when running as non-root")); | ||
623 | return EX_USAGE; | ||
624 | } | ||
625 | s_argv[0] = auth->name; | ||
626 | argv = s_argv; | ||
627 | argc = 1; | ||
628 | } | ||
629 | delivery_fun = deliver_to_user; | ||
630 | break; | ||
631 | |||
632 | case mode_url: | 606 | case mode_url: |
633 | /* FIXME: Verify if the urls are deliverable? */ | 607 | /* FIXME: Verify if the urls are deliverable? */ |
634 | delivery_fun = deliver_to_url; | 608 | delivery_fun = deliver_to_url; | ... | ... |
-
Please register or sign in to post a comment