#define LA_LMTP 42
#define LA_PLUGIN 43
#define LA_PLUGOUT 44
-#define LA_NETSEC 45
#define LA_INTERFACE 46
#define LA_MONITOR 47
#define LA_CONFIGDUMP 48
#define LA_SSLFINGERPRINT 60
#endif
+#define LA_FETCHSIZELIMIT 61
+#define LA_FASTUIDL 62
+
+/* don't use 63-122: they could clash with short options */
+
+#define LA_LIMITFLUSH 128
/* options still left: CDgGhHjJoORwWxXYz */
static const char *shortoptions =
{"nokeep", no_argument, (int *) 0, LA_NOKEEP },
{"keep", no_argument, (int *) 0, LA_KEEP },
{"flush", no_argument, (int *) 0, LA_FLUSH },
+ {"limitflush", no_argument, (int *) 0, LA_LIMITFLUSH },
{"norewrite", no_argument, (int *) 0, LA_NOREWRITE },
{"limit", required_argument, (int *) 0, LA_LIMIT },
{"warnings", required_argument, (int *) 0, LA_WARNINGS },
{"batchlimit",required_argument, (int *) 0, LA_BATCHLIMIT },
{"fetchlimit",required_argument, (int *) 0, LA_FETCHLIMIT },
+ {"fetchsizelimit",required_argument, (int *) 0, LA_FETCHSIZELIMIT },
+ {"fastuidl", required_argument, (int *) 0, LA_FASTUIDL },
{"expunge", required_argument, (int *) 0, LA_EXPUNGE },
{"mda", required_argument, (int *) 0, LA_MDA },
{"bsmtp", required_argument, (int *) 0, LA_BSMTP },
{"lmtp", no_argument, (int *) 0, LA_LMTP },
-#ifdef INET6_ENABLE
- {"netsec", required_argument, (int *) 0, LA_NETSEC },
-#endif /* INET6_ENABLE */
-
#ifdef SSL_ENABLE
{"ssl", no_argument, (int *) 0, LA_SSL },
{"sslkey", required_argument, (int *) 0, LA_SSLKEY },
{"principal", required_argument, (int *) 0, LA_PRINCIPAL },
-#if (defined(linux) && !INET6_ENABLE) || defined(__FreeBSD__)
+#ifdef CAN_MONITOR
{"interface", required_argument, (int *) 0, LA_INTERFACE },
{"monitor", required_argument, (int *) 0, LA_MONITOR },
-#endif /* (defined(linux) && !INET6_ENABLE) || defined(__FreeBSD__) */
+#endif /* CAN_MONITOR */
{"plugin", required_argument, (int *) 0, LA_PLUGIN },
{"plugout", required_argument, (int *) 0, LA_PLUGOUT },
rctl->invisible = TRUE;
break;
case LA_SHOWDOTS:
- rctl->showdots = TRUE;
+ rctl->showdots = FLAG_TRUE;
break;
case 'f':
case LA_RCFILE:
+ xfree(rcfile);
rcfile = prependdir (optarg, currentwd);
break;
case 'i':
else if (strcasecmp(optarg,"kpop") == 0)
{
ctl->server.protocol = P_POP3;
-#if INET6_ENABLE
ctl->server.service = KPOP_PORT;
-#else /* INET6_ENABLE */
- ctl->server.port = KPOP_PORT;
-#endif /* INET6_ENABLE */
#ifdef KERBEROS_V5
ctl->server.authenticate = A_KERBEROS_V5;
#else
break;
case 'P':
case LA_PORT:
-#if INET6_ENABLE
ctl->server.service = optarg;
-#else /* INET6_ENABLE */
- ctl->server.port = xatoi(optarg, &errflag);
-#endif /* INET6_ENABLE */
break;
case LA_AUTH:
if (strcmp(optarg, "password") == 0)
ctl->server.authenticate = A_SSH;
else if (strcmp(optarg, "otp") == 0)
ctl->server.authenticate = A_OTP;
+ else if (strcmp(optarg, "opie") == 0)
+ ctl->server.authenticate = A_OTP;
else if (strcmp(optarg, "ntlm") == 0)
ctl->server.authenticate = A_NTLM;
else if (strcmp(optarg, "cram") == 0)
case LA_FLUSH:
ctl->flush = FLAG_TRUE;
break;
+ case LA_LIMITFLUSH:
+ ctl->limitflush = FLAG_TRUE;
+ break;
case 'n':
case LA_NOREWRITE:
ctl->rewrite = FLAG_FALSE;
break;
case 'r':
case LA_FOLDER:
- xalloca(buf, char *, strlen(optarg) + 1);
- strcpy(buf, optarg);
+ buf = xstrdup(optarg);
cp = strtok(buf, ",");
do {
save_str(&ctl->mailboxes, cp, 0);
} while
((cp = strtok((char *)NULL, ",")));
+ free(buf);
break;
case 'S':
case LA_SMTPHOST:
- xalloca(buf, char *, strlen(optarg) + 1);
- strcpy(buf, optarg);
+ buf = xstrdup(optarg);
cp = strtok(buf, ",");
do {
save_str(&ctl->smtphunt, cp, TRUE);
} while
((cp = strtok((char *)NULL, ",")));
+ free(buf);
ocount++;
break;
case LA_FETCHDOMAINS:
- xalloca(buf, char *, strlen(optarg) + 1);
- strcpy(buf, optarg);
+ buf = xstrdup(optarg);
cp = strtok(buf, ",");
do {
save_str(&ctl->domainlist, cp, TRUE);
} while
((cp = strtok((char *)NULL, ",")));
+ free(buf);
break;
case 'D':
case LA_SMTPADDR:
break;
case 'Z':
case LA_ANTISPAM:
- xalloca(buf, char *, strlen(optarg) + 1);
- strcpy(buf, optarg);
+ buf = xstrdup(optarg);
cp = strtok(buf, ",");
do {
struct idlist *idp = save_str(&ctl->antispam, NULL, 0);;
idp->val.status.num = xatoi(cp, &errflag);
} while
((cp = strtok((char *)NULL, ",")));
+ free(buf);
break;
case 'b':
case LA_BATCHLIMIT:
c = xatoi(optarg, &errflag);
ctl->fetchlimit = NUM_VALUE_IN(c);
break;
+ case LA_FETCHSIZELIMIT:
+ c = xatoi(optarg, &errflag);
+ ctl->fetchsizelimit = NUM_VALUE_IN(c);
+ break;
+ case LA_FASTUIDL:
+ c = xatoi(optarg, &errflag);
+ ctl->fastuidl = NUM_VALUE_IN(c);
+ break;
case 'e':
case LA_EXPUNGE:
c = xatoi(optarg, &errflag);
ctl->listener = LMTP_MODE;
break;
- case 'T':
- case LA_NETSEC:
-#if NET_SECURITY
- ctl->server.netsec = (void *)optarg;
-#else
- fprintf(stderr, GT_("fetchmail: network security support is disabled\n"));
- errflag++;
-#endif /* NET_SECURITY */
- break;
-
-#if (defined(linux) && !INET6_ENABLE) || defined(__FreeBSD__)
+#ifdef CAN_MONITOR
case 'I':
case LA_INTERFACE:
interface_parse(optarg, &ctl->server);
case LA_MONITOR:
ctl->server.monitor = xstrdup(optarg);
break;
-#endif /* (defined(linux) && !INET6_ENABLE) || defined(__FreeBSD__) */
+#endif /* CAN_MONITOR */
case LA_PLUGIN:
ctl->server.plugin = xstrdup(optarg);
break;
break;
case LA_SSLCERTPATH:
- ctl->sslcertpath = xstrdup(optarg);
+ ctl->sslcertpath = prependdir(optarg, currentwd);
break;
case LA_SSLFINGERPRINT:
rctl->use_syslog = FLAG_FALSE;
break;
- case LA_TRACEPOLLS:
- ctl->tracepolls = FLAG_TRUE;
- break;
+ case LA_TRACEPOLLS:
+ ctl->server.tracepolls = FLAG_TRUE;
+ break;
case '?':
case LA_HELP:
P(GT_(" -i, --idfile specify alternate UIDs file\n"));
P(GT_(" --postmaster specify recipient of last resort\n"));
P(GT_(" --nobounce redirect bounces from user to postmaster.\n"));
-#if (defined(linux) && !INET6_ENABLE) || defined(__FreeBSD__)
+#ifdef CAN_MONITOR
P(GT_(" -I, --interface interface required specification\n"));
P(GT_(" -M, --monitor monitor interface for activity\n"));
#endif
P(GT_(" --ssl enable ssl encrypted session\n"));
P(GT_(" --sslkey ssl private key file\n"));
P(GT_(" --sslcert ssl client certificate\n"));
+ P(GT_(" --sslcertpath path to ssl certificates\n"));
+ P(GT_(" --sslfingerprint fingerprint that must match that of the server's cert.\n"));
P(GT_(" --sslproto force ssl protocol (ssl2/ssl3/tls1)\n"));
#endif
P(GT_(" --plugin specify external command to open connection\n"));
P(GT_(" -p, --protocol specify retrieval protocol (see man page)\n"));
P(GT_(" -U, --uidl force the use of UIDLs (pop3 only)\n"));
P(GT_(" -P, --port TCP/IP service port to connect to\n"));
- P(GT_(" --auth authentication type (password/kerberos/ssh)\n"));
+ P(GT_(" --auth authentication type (password/kerberos/ssh/otp)\n"));
P(GT_(" -t, --timeout server nonresponse timeout\n"));
P(GT_(" -E, --envelope envelope address header\n"));
P(GT_(" -Q, --qvirtual prefix to remove from local user id\n"));
P(GT_(" -K, --nokeep delete new messages after retrieval\n"));
P(GT_(" -k, --keep save new messages after retrieval\n"));
P(GT_(" -F, --flush delete old messages from server\n"));
+ P(GT_(" --limitflush delete oversized messages\n"));
P(GT_(" -n, --norewrite don't rewrite header addresses\n"));
P(GT_(" -l, --limit don't fetch messages over given size\n"));
P(GT_(" -w, --warnings interval between warning mail notification\n"));
-#if NET_SECURITY
- P(GT_(" -T, --netsec set IP security request\n"));
-#endif /* NET_SECURITY */
P(GT_(" -S, --smtphost set SMTP forwarding host\n"));
P(GT_(" --fetchdomains fetch mail for specified domains\n"));
P(GT_(" -D, --smtpaddress set SMTP delivery domain to use\n"));
P(GT_(" -Z, --antispam, set antispam response values\n"));
P(GT_(" -b, --batchlimit set batch limit for SMTP connections\n"));
P(GT_(" -B, --fetchlimit set fetch limit for server connections\n"));
+ P(GT_(" --fetchsizelimit set fetch message size limit\n"));
+ P(GT_(" --fastuidl do a binary search for UIDLs\n"));
P(GT_(" -e, --expunge set max deletions between expunges\n"));
P(GT_(" -m, --mda set MDA to use for forwarding\n"));
P(GT_(" --bsmtp set output BSMTP file\n"));