aboutsummaryrefslogtreecommitdiffstats
path: root/fetchmail.c
diff options
context:
space:
mode:
Diffstat (limited to 'fetchmail.c')
-rw-r--r--fetchmail.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/fetchmail.c b/fetchmail.c
index a1c6754d..c5b6f7cb 100644
--- a/fetchmail.c
+++ b/fetchmail.c
@@ -1003,14 +1003,30 @@ static int load_params(int argc, char **argv, int optind)
{
ctl->wedged = FALSE;
- if (configdump || ctl->active )
- {
- /* merge in defaults */
- optmerge(ctl, &def_opts, FALSE);
+ /* merge in defaults */
+ optmerge(ctl, &def_opts, FALSE);
+
+ /* force command-line options */
+ optmerge(ctl, &cmd_opts, TRUE);
+
+ /*
+ * queryname has to be set up for inactive servers too.
+ * Otherwise the UIDL code core-dumps on startup.
+ */
+ if (ctl->server.via)
+ ctl->server.queryname = xstrdup(ctl->server.via);
+ else
+ ctl->server.queryname = xstrdup(ctl->server.pollname);
- /* force command-line options */
- optmerge(ctl, &cmd_opts, TRUE);
+ /*
+ * We no longer do DNS lookups at startup.
+ * This is a kluge. It enables users to edit their
+ * configurations when DNS isn't available.
+ */
+ ctl->server.truename = xstrdup(ctl->server.queryname);
+ if (configdump || ctl->active )
+ {
/* this code enables flags to be turned off */
#define DEFAULT(flag, dflt) if (flag == FLAG_TRUE)\
flag = TRUE;\
@@ -1074,18 +1090,6 @@ static int load_params(int argc, char **argv, int optind)
}
#endif /* !HAVE_GETHOSTBYNAME || !HAVE_RES_SEARCH */
- if (ctl->server.via)
- ctl->server.queryname = xstrdup(ctl->server.via);
- else
- ctl->server.queryname = xstrdup(ctl->server.pollname);
-
- /*
- * We no longer do DNS lookups at startup.
- * This is a kluge. It enables users to edit their
- * configurations when DNS isn't available.
- */
- ctl->server.truename = xstrdup(ctl->server.queryname);
-
/* if no folders were specified, set up the null one as default */
if (!ctl->mailboxes)
save_str(&ctl->mailboxes, (char *)NULL, 0);