qf file is rewritten after k successful deliveries.
(ref bug 4.3BSD-reno/usr.bin/10)
SCCS-vsn: usr.sbin/sendmail/src/conf.c 5.28
SCCS-vsn: usr.sbin/sendmail/src/queue.c 5.32
SCCS-vsn: usr.sbin/sendmail/src/deliver.c 5.40
SCCS-vsn: usr.sbin/sendmail/src/readcf.c 5.22
SCCS-vsn: usr.sbin/sendmail/src/sendmail.h 5.17
SCCS-vsn: usr.sbin/sendmail/src/version.c 5.66
-static char sccsid[] = "@(#)conf.c 5.27 (Berkeley) %G%";
+static char sccsid[] = "@(#)conf.c 5.28 (Berkeley) %G%";
#endif /* not lint */
# include <sys/ioctl.h>
#endif /* not lint */
# include <sys/ioctl.h>
FileMode = 0644;
DefUid = 1;
DefGid = 1;
FileMode = 0644;
DefUid = 1;
DefGid = 1;
+ CheckpointInterval = 10;
-static char sccsid[] = "@(#)deliver.c 5.39 (Berkeley) %G%";
+static char sccsid[] = "@(#)deliver.c 5.40 (Berkeley) %G%";
#endif /* not lint */
#include "sendmail.h"
#endif /* not lint */
#include "sendmail.h"
{
rcode = mailfile(user, getctladdr(to));
giveresponse(rcode, m, e);
{
rcode = mailfile(user, getctladdr(to));
giveresponse(rcode, m, e);
+ if (rcode == EX_OK)
+ to->q_flags |= QSENT;
if (tobuf[0] != '\0')
giveresponse(rcode, m, e);
if (tobuf[0] != '\0')
giveresponse(rcode, m, e);
- if (rcode != EX_OK)
- for (to = tochain; to != NULL; to = to->q_tchain)
+ for (to = tochain; to != NULL; to = to->q_tchain)
+ if (rcode != EX_OK)
markfailure(e, to, rcode);
markfailure(e, to, rcode);
+ else
+ to->q_flags |= QSENT;
errno = 0;
define('g', (char *) NULL, e);
errno = 0;
define('g', (char *) NULL, e);
register ADDRESS *q;
bool oldverbose;
int pid;
register ADDRESS *q;
bool oldverbose;
int pid;
FILE *lockfp = NULL, *queueup();
/* determine actual delivery mode */
FILE *lockfp = NULL, *queueup();
/* determine actual delivery mode */
** Run through the list and send everything.
*/
** Run through the list and send everything.
*/
for (q = e->e_sendqueue; q != NULL; q = q->q_next)
{
if (mode == SM_VERIFY)
for (q = e->e_sendqueue; q != NULL; q = q->q_next)
{
if (mode == SM_VERIFY)
if (!bitset(QDONTSEND|QBADADDR, q->q_flags))
message(Arpa_Info, "deliverable");
}
if (!bitset(QDONTSEND|QBADADDR, q->q_flags))
message(Arpa_Info, "deliverable");
}
- else
- (void) deliver(e, q);
+ else if (!bitset(QDONTSEND, q->q_flags))
+ {
+ /*
+ ** Checkpoint the send list every few addresses
+ */
+
+ if (nsent >= CheckpointInterval)
+ {
+ queueup(e, TRUE, FALSE);
+ nsent = 0;
+ }
+ if (deliver(e, q) == EX_OK)
+ nsent++;
+ }
#ifndef lint
#ifdef QUEUE
#ifndef lint
#ifdef QUEUE
-static char sccsid[] = "@(#)queue.c 5.31 (Berkeley) %G% (with queueing)";
+static char sccsid[] = "@(#)queue.c 5.32 (Berkeley) %G% (with queueing)";
-static char sccsid[] = "@(#)queue.c 5.31 (Berkeley) %G% (without queueing)";
+static char sccsid[] = "@(#)queue.c 5.32 (Berkeley) %G% (without queueing)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
/* output list of recipient addresses */
for (q = e->e_sendqueue; q != NULL; q = q->q_next)
{
/* output list of recipient addresses */
for (q = e->e_sendqueue; q != NULL; q = q->q_next)
{
- if (queueall ? !bitset(QDONTSEND, q->q_flags) :
+ if (queueall ? !bitset(QDONTSEND|QSENT, q->q_flags) :
bitset(QQUEUEUP, q->q_flags))
{
char *ctluser, *getctluser();
bitset(QQUEUEUP, q->q_flags))
{
char *ctluser, *getctluser();
-static char sccsid[] = "@(#)readcf.c 5.21 (Berkeley) %G%";
+static char sccsid[] = "@(#)readcf.c 5.22 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
IgnrDot = atobool(val);
break;
IgnrDot = atobool(val);
break;
+ case 'k': /* checkpoint every N addresses */
+ CheckpointInterval = atoi(val);
+ break;
+
case 'L': /* log level */
LogLevel = atoi(val);
break;
case 'L': /* log level */
LogLevel = atoi(val);
break;
*
* %sccs.include.redist.c%
*
*
* %sccs.include.redist.c%
*
- * @(#)sendmail.h 5.16 (Berkeley) %G%
+ * @(#)sendmail.h 5.17 (Berkeley) %G%
# ifdef _DEFINE
# define EXTERN
# ifndef lint
# ifdef _DEFINE
# define EXTERN
# ifndef lint
-static char SmailSccsId[] = "@(#)sendmail.h 5.16 %G%";
+static char SmailSccsId[] = "@(#)sendmail.h 5.17 %G%";
# endif lint
# else _DEFINE
# define EXTERN extern
# endif lint
# else _DEFINE
# define EXTERN extern
# define QGOODUID 000004 /* the q_uid q_gid fields are good */
# define QPRIMARY 000010 /* set from argv */
# define QQUEUEUP 000020 /* queue for later transmission */
# define QGOODUID 000004 /* the q_uid q_gid fields are good */
# define QPRIMARY 000010 /* set from argv */
# define QQUEUEUP 000020 /* queue for later transmission */
+# define QSENT 000040 /* has been successfully delivered */
# define QPSEUDO 000040 /* only on the list for verification */
\f/*
** Mailer definition structure.
# define QPSEUDO 000040 /* only on the list for verification */
\f/*
** Mailer definition structure.
EXTERN char *MxHosts[MAXMXHOSTS+1]; /* for MX RRs */
EXTERN char *TrustedUsers[MAXTRUST+1]; /* list of trusted users */
EXTERN char *UserEnviron[MAXUSERENVIRON+1]; /* saved user environment */
EXTERN char *MxHosts[MAXMXHOSTS+1]; /* for MX RRs */
EXTERN char *TrustedUsers[MAXTRUST+1]; /* list of trusted users */
EXTERN char *UserEnviron[MAXUSERENVIRON+1]; /* saved user environment */
+EXTERN int CheckpointInterval; /* queue file checkpoint interval */
\f/*
** Trace information
*/
\f/*
** Trace information
*/
-static char sccsid[] = "@(#)version.c 5.65 (Berkeley) %G%";
+static char sccsid[] = "@(#)version.c 5.66 (Berkeley) %G%";
-char Version[] = "5.65";
+char Version[] = "5.66";