diff options
author | Matthias Andree <matthias.andree@gmx.de> | 2014-11-22 00:23:45 +0100 |
---|---|---|
committer | Matthias Andree <matthias.andree@gmx.de> | 2014-11-22 00:23:45 +0100 |
commit | a7940f5d16bb602f27d16120d2bf89575eb7d715 (patch) | |
tree | 30f1df38f530bca312052fcf0c68c2d26c33516e /fetchmail.c | |
parent | 2816976745d273051504b8a82d87d48f7f5c3ee7 (diff) | |
download | fetchmail-a7940f5d16bb602f27d16120d2bf89575eb7d715.tar.gz fetchmail-a7940f5d16bb602f27d16120d2bf89575eb7d715.tar.bz2 fetchmail-a7940f5d16bb602f27d16120d2bf89575eb7d715.zip |
Error out if user combines --idle with multiple mailboxes.
Diffstat (limited to 'fetchmail.c')
-rw-r--r-- | fetchmail.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/fetchmail.c b/fetchmail.c index ae30f90a..5f31d6ec 100644 --- a/fetchmail.c +++ b/fetchmail.c @@ -1035,6 +1035,8 @@ static int load_params(int argc, char **argv, int optind) struct query def_opts, *ctl; struct stat rcstat; char *p; + unsigned int mboxcount = 0; + unsigned int idlecount = 0; run.bouncemail = TRUE; run.softbounce = TRUE; /* treat permanent errors as temporary */ @@ -1236,7 +1238,7 @@ static int load_params(int argc, char **argv, int optind) /* * We no longer do DNS lookups at startup. - * This is a kluge. It enables users to edit their + * This is a kludge. It enables users to edit their * configurations when DNS isn't available. */ ctl->server.truename = xstrdup(ctl->server.queryname); @@ -1386,9 +1388,18 @@ static int load_params(int argc, char **argv, int optind) (void) fprintf(stderr, GT_("Both fetchall and keep on in daemon or idle mode is a mistake!\n")); } + + if (ctl->idle) ++idlecount; + mboxcount += count_list(&ctl->mailboxes); } } + if (idlecount && mboxcount > 1) { + fprintf(stderr, + GT_("fetchmail: Error: idle mode does not work for multiple folders or accounts!\n")); + exit(PS_SYNTAX); + } + /* * If the user didn't set a last-resort user to get misaddressed * multidrop mail, set an appropriate default here. |