summaryrefslogtreecommitdiffabout
path: root/src/main.c
authorSergey Poznyakoff <gray@gnu.org.ua>2010-08-22 19:21:28 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2010-08-22 20:11:41 (GMT)
commitdc8d3d50cbaca39447576ac0ac573ca8a84a2c05 (patch) (side-by-side diff)
treed9a4f88f0fb0019a740d334d67a7215d66c0c8aa /src/main.c
parent84db5d2111b2f8ac9fd583ed13c106b620b8fefa (diff)
downloadmailfromd-dc8d3d50cbaca39447576ac0ac573ca8a84a2c05.tar.gz
mailfromd-dc8d3d50cbaca39447576ac0ac573ca8a84a2c05.tar.bz2
Fix starting of the default callout server. Reflect the actual server URL in callout_server_url.
* mflib/callout.mf4 (callout_server_url): New variable. (begin): Provide a default for callout_server_url. (__callout_open_default): Return the fd. (callout): Use return from __callout_open_default as the first argument to callout_do. * mflib/poll.mf (__make_extra_arg): New static function. (_pollhost, _pollmx, stdpoll, strictpoll): Use return from __callout_open_default as the first argument to callout_do. Construct the rest of arguments using __make_extra_arg. * src/builtin/callout.bi (callout_server_url): Remove. (default_callout_server_url): New function. (MF_INIT): Remove initialization of callout_server_url. * src/mailfromd.h (default_callout_url): Rename to callout_server_url. * src/main.c (default_callout_url): Rename to callout_server_url. (provide_default_callout_server): Rewrite the condition. Don't try to reset the callout_server_url MFL variable: it is useless after compilation is finished. (mf_server_function): Fix the use of mu_list_locate. (main): Fix a typo in the server section label. * src/srvcfg.c (server_section_parser): Move the call to mf_server_function to the mu_cfg_section_end branch.
Diffstat (limited to 'src/main.c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/main.c22
1 files changed, 8 insertions, 14 deletions
diff --git a/src/main.c b/src/main.c
index ccd31e6..1620fa2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -80,3 +80,3 @@ size_t max_match_mx = MAXMXCOUNT;
char *main_function_name = "main";
-char *default_callout_url = DEFAULT_CALLOUT_SOCKET;
+char *callout_server_url;
@@ -896,5 +896,4 @@ struct mu_cfg_param mf_cfg_param[] = {
N_("time") },
- { "callout-url", mu_cfg_string, &default_callout_url, 0, NULL,
- N_("Sets the URL of the default callout server. "
- "Deprecated. Use `setvar callout_server_url <url>;' instead."),
+ { "callout-url", mu_cfg_string, &callout_server_url, 0, NULL,
+ N_("Sets the URL of the default callout server."),
N_("url") },
@@ -1106,2 +1105,3 @@ provide_default_callout_server()
if (provide_callout &&
+ !callout_server_url &&
(!(var = variable_lookup("callout_server_url")) ||
@@ -1109,9 +1109,3 @@ provide_default_callout_server()
!(var->sym.flags & SYM_INITIALIZED))) {
- struct value val;
-
- val.type = dtype_string;
- val.v.literal = string_alloc(DEFAULT_CALLOUT_SOCKET,
- sizeof(DEFAULT_CALLOUT_SOCKET)-1);
- ensure_initialized_variable("callout_server_url", &val);
- mf_srvcfg_add("callout", val.v.literal->text);
+ mf_srvcfg_add("callout", DEFAULT_CALLOUT_SOCKET);
}
@@ -1136,4 +1130,4 @@ mf_server_function(const char *key, struct mf_srvcfg *cfg)
if (cfg->defopt ||
- mu_list_locate(cfg->options, "default", NULL))
- default_callout_url =
+ mu_list_locate(cfg->options, "default", NULL) == 0)
+ callout_server_url =
xstrdup(mu_url_to_string(cfg->url));
@@ -1186,3 +1180,3 @@ main(int argc, char **argv)
srvman_init();
- mf_srvcfg_init(N_("(milter | server)"));
+ mf_srvcfg_init(N_("(milter | callout)"));

Return to:

Send suggestions and report system problems to the System administrator.