aboutsummaryrefslogtreecommitdiff
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/main.c b/src/main.c
index ccd31e69..1620fa2b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -78,7 +78,7 @@ int stack_trace_option; /* Print stack traces on runtime errors */
78size_t max_match_mx = MAXMXCOUNT; 78size_t max_match_mx = MAXMXCOUNT;
79 79
80char *main_function_name = "main"; 80char *main_function_name = "main";
81char *default_callout_url = DEFAULT_CALLOUT_SOCKET; 81char *callout_server_url;
82 82
83 83
84/* Preprocessor helper function */ 84/* Preprocessor helper function */
@@ -894,9 +894,8 @@ struct mu_cfg_param mf_cfg_param[] = {
894 { "milter-timeout", mu_cfg_callback, NULL, 0, cb_milter_timeout, 894 { "milter-timeout", mu_cfg_callback, NULL, 0, cb_milter_timeout,
895 N_("Set milter timeout."), 895 N_("Set milter timeout."),
896 N_("time") }, 896 N_("time") },
897 { "callout-url", mu_cfg_string, &default_callout_url, 0, NULL, 897 { "callout-url", mu_cfg_string, &callout_server_url, 0, NULL,
898 N_("Sets the URL of the default callout server. " 898 N_("Sets the URL of the default callout server."),
899 "Deprecated. Use `setvar callout_server_url <url>;' instead."),
900 N_("url") }, 899 N_("url") },
901 { "include-path", mu_cfg_callback, NULL, 0, cb_include_path, 900 { "include-path", mu_cfg_callback, NULL, 0, cb_include_path,
902 N_("Add directories to the list of directories to be searched for " 901 N_("Add directories to the list of directories to be searched for "
@@ -1104,16 +1103,11 @@ provide_default_callout_server()
1104 struct variable *var; 1103 struct variable *var;
1105 1104
1106 if (provide_callout && 1105 if (provide_callout &&
1106 !callout_server_url &&
1107 (!(var = variable_lookup("callout_server_url")) || 1107 (!(var = variable_lookup("callout_server_url")) ||
1108 (var->sym.flags & SYM_REFERENCED) && 1108 (var->sym.flags & SYM_REFERENCED) &&
1109 !(var->sym.flags & SYM_INITIALIZED))) { 1109 !(var->sym.flags & SYM_INITIALIZED))) {
1110 struct value val; 1110 mf_srvcfg_add("callout", DEFAULT_CALLOUT_SOCKET);
1111
1112 val.type = dtype_string;
1113 val.v.literal = string_alloc(DEFAULT_CALLOUT_SOCKET,
1114 sizeof(DEFAULT_CALLOUT_SOCKET)-1);
1115 ensure_initialized_variable("callout_server_url", &val);
1116 mf_srvcfg_add("callout", val.v.literal->text);
1117 } 1111 }
1118} 1112}
1119 1113
@@ -1134,8 +1128,8 @@ mf_server_function(const char *key, struct mf_srvcfg *cfg)
1134 else if (strcmp(key, "callout") == 0) { 1128 else if (strcmp(key, "callout") == 0) {
1135 cfg->server = callout_session_server; 1129 cfg->server = callout_session_server;
1136 if (cfg->defopt || 1130 if (cfg->defopt ||
1137 mu_list_locate(cfg->options, "default", NULL)) 1131 mu_list_locate(cfg->options, "default", NULL) == 0)
1138 default_callout_url = 1132 callout_server_url =
1139 xstrdup(mu_url_to_string(cfg->url)); 1133 xstrdup(mu_url_to_string(cfg->url));
1140 } else 1134 } else
1141 return 1; 1135 return 1;
@@ -1184,7 +1178,7 @@ main(int argc, char **argv)
1184 mu_acl_cfg_init(); 1178 mu_acl_cfg_init();
1185 database_cfg_init(); 1179 database_cfg_init();
1186 srvman_init(); 1180 srvman_init();
1187 mf_srvcfg_init(N_("(milter | server)")); 1181 mf_srvcfg_init(N_("(milter | callout)"));
1188 1182
1189 mu_argp_init(program_version, "<" PACKAGE_BUGREPORT ">"); 1183 mu_argp_init(program_version, "<" PACKAGE_BUGREPORT ">");
1190 mu_app_rcfile = DEFAULT_CONFIG_FILE; 1184 mu_app_rcfile = DEFAULT_CONFIG_FILE;

Return to:

Send suggestions and report system problems to the System administrator.