* Received line parsing for envelope addresses now matches MX as well as
canonical DNS addresses, making multidrop routing slightly more reliable.
+* Added --fetchlimit option to limit number of messages fetched in a
+ single poll.
+
bugs --
* Fixed a FreeBSD compilation glitch involving SIGCLD (thanks to
#define SMTP_PORT 25 /* standard SMTP service port */
int batchlimit; /* how often to tear down the delivery connection */
+int fetchlimit; /* how often to tear down the server connection */
int batchcount; /* count of messages sent in current batch */
int peek_capable; /* can we peek for better error recovery? */
}
else if (outlevel > O_SILENT)
fprintf(stderr, " not flushed\n");
+
+ /* perhaps this as many as we're ready to handle */
+ if (ctl->fetchlimit && ctl->fetchlimit <= num)
+ break;
}
/* remove all messages flagged for deletion */
int quitmode; /* if --quit was set */
int check_only; /* if --probe was set */
int cmd_batchlimit; /* if --batchlimit was set */
+int cmd_fetchlimit; /* if --fetchlimit was set */
char *cmd_logfile; /* if --logfile was set */
/* miscellaneous global controls */
ctl->norewrite ? "dis" : "en",
ctl->norewrite ? "on" : "off");
if (ctl->limit)
- printf(" Message size limit is %d bytes\n", ctl->limit);
+ printf(" Message size limit is %d bytes (--limit %d).\n",
+ ctl->limit, ctl->limit);
else if (outlevel == O_VERBOSE)
- printf(" No message size limit\n");
+ printf(" No message size limit (--limit 0).\n");
+ if (ctl->fetchlimit)
+ printf(" Received-message limit is %d (--fetchlimit %d).\n",
+ ctl->fetchlimit, ctl->fetchlimit);
+ else if (outlevel == O_VERBOSE)
+ printf(" No received-message limit (--fetchlimit 0).\n");
if (ctl->mda[0])
printf(" Messages will be delivered with '%s.'\n", visbuf(ctl->mda));
else
int flush;
int norewrite;
int limit;
+ int fetchlimit;
/* unseen, previous state of mailbox (initially from .fetchids) */
struct idlist *oldsaved, *newsaved;
will not be fetched, not be marked seen, and will be left on the
server (in foreground sessions, the progress messages will note that
they are "oversized"). The --all option overrides this one. This
-option is intended for those need to strictly control fetch time
+option is intended for those needing to strictly control fetch time
in interactive mode. It may not be used with daemon mode,
as users would never receive a notification that messages were waiting.
.TP
is processing very large batches. Setting the batch limit to some
nonzero size will prevent these delays.
.TP
+.B -R, --fetchlimit
+Limit the number of messages accepted from a given server in a single
+poll. By default there is no limit.
+.TP
.B \-V, --version
Displays the version information for your copy of
.I fetchmail.
noflush
nofetchall
norewrite
+ limit
+ fetchlimit
.PP
All options correspond to the obvious command-line arguments except
four: `aka', `is', `to', `password', and `envelope'.
#define LA_REMOTEFILE 23
#define LA_SMTPHOST 24
#define LA_BATCHLIMIT 25
-#define LA_MDA 26
-#define LA_YYDEBUG 27
+#define LA_FETCHLIMIT 26
+#define LA_MDA 27
+#define LA_YYDEBUG 28
-static char *shortoptions = "?Vcsvd:NqL:f:i:p:P:A:t:u:akKFnl:r:S:b:m:y";
+static char *shortoptions = "?Vcsvd:NqL:f:i:p:P:A:t:u:akKFnl:r:S:b:B:m:y";
static struct option longoptions[] = {
{"help", no_argument, (int *) 0, LA_HELP },
{"version", no_argument, (int *) 0, LA_VERSION },
{"remote", required_argument, (int *) 0, LA_REMOTEFILE },
{"smtphost", required_argument, (int *) 0, LA_SMTPHOST },
{"batchlimit",required_argument, (int *) 0, LA_BATCHLIMIT },
+ {"fetchlimit",required_argument, (int *) 0, LA_FETCHLIMIT },
{"mda", required_argument, (int *) 0, LA_MDA },
{"yydebug", no_argument, (int *) 0, LA_YYDEBUG },
case LA_BATCHLIMIT:
cmd_batchlimit = atoi(optarg);
break;
+ case 'B':
+ case LA_FETCHLIMIT:
+ ctl->fetchlimit = atoi(optarg);
+ break;
case 'm':
case LA_MDA:
strncpy(ctl->mda,optarg,sizeof(ctl->mda));
fputs(" -S, --smtphost set SMTP forwarding host\n", stderr);
fputs(" -b, --batchlimit set batch limit for SMTP connections\n", stderr);
+ fputs(" -B, --fetchlimit set fetch limit for server connections\n", stderr);
fputs(" -r, --remote specify remote folder name\n", stderr);
return(-1);
}
set { return SET; }
batchlimit { return BATCHLIMIT; }
+fetchlimit { return FETCHLIMIT; }
logfile { return LOGFILE; }
defaults { return DEFAULTS; }
server { return POLL; }
%token DEFAULTS POLL SKIP AKA PROTOCOL AUTHENTICATE TIMEOUT KPOP KERBEROS
%token ENVELOPE USERNAME PASSWORD FOLDER SMTPHOST MDA LIMIT
%token IS HERE THERE TO MAP WILDCARD
-%token SET BATCHLIMIT LOGFILE
+%token SET BATCHLIMIT FETCHLIMIT LOGFILE
%token <proto> PROTO
%token <sval> STRING
%token <number> NUMBER
| FETCHALL {current.fetchall = ($1==FLAG_TRUE);}
| REWRITE {current.norewrite = ($1==FLAG_TRUE);}
| LIMIT NUMBER {current.limit = $2;}
+ | FETCHLIMIT NUMBER {current.fetchlimit = $2;}
;
%%
FLAG_FORCE(authenticate);
FLAG_FORCE(timeout);
FLAG_FORCE(limit);
+ FLAG_FORCE(fetchlimit);
#undef FLAG_FORCE
(void) hostalloc(¤t);
FLAG_MERGE(authenticate);
FLAG_MERGE(timeout);
FLAG_MERGE(limit);
+ FLAG_MERGE(fetchlimit);
#undef FLAG_MERGE
}
# noflush
# nofetchall
# norewrite
+# limit -- must be followed by numeric size limit
+# fetchlimit -- must be followed by numeric msg fetch limit
#
# Legal protocol identifiers are
# pop2 (or POP2)