SCCS-vsn: usr.sbin/sendmail/src/recipient.c 6.33
SCCS-vsn: usr.sbin/sendmail/src/queue.c 6.40
SCCS-vsn: usr.sbin/sendmail/src/alias.c 6.29
SCCS-vsn: usr.sbin/sendmail/src/udb.c 6.16
#ifndef lint
#ifdef NEWDB
#ifdef NDBM
#ifndef lint
#ifdef NEWDB
#ifdef NDBM
-static char sccsid[] = "@(#)alias.c 6.28 (Berkeley) %G% (with NEWDB and NDBM)";
+static char sccsid[] = "@(#)alias.c 6.29 (Berkeley) %G% (with NEWDB and NDBM)";
-static char sccsid[] = "@(#)alias.c 6.28 (Berkeley) %G% (with NEWDB)";
+static char sccsid[] = "@(#)alias.c 6.29 (Berkeley) %G% (with NEWDB)";
-static char sccsid[] = "@(#)alias.c 6.28 (Berkeley) %G% (with NDBM)";
+static char sccsid[] = "@(#)alias.c 6.29 (Berkeley) %G% (with NDBM)";
-static char sccsid[] = "@(#)alias.c 6.28 (Berkeley) %G% (without NEWDB or NDBM)";
+static char sccsid[] = "@(#)alias.c 6.29 (Berkeley) %G% (without NEWDB or NDBM)";
#endif
#endif
#endif /* not lint */
#endif
#endif
#endif /* not lint */
if (bitset(EF_VRFYONLY, e->e_flags))
{
a->q_flags |= QVERIFIED;
if (bitset(EF_VRFYONLY, e->e_flags))
{
a->q_flags |= QVERIFIED;
return;
}
message("aliased to %s", p);
return;
}
message("aliased to %s", p);
#ifndef lint
#ifdef QUEUE
#ifndef lint
#ifdef QUEUE
-static char sccsid[] = "@(#)queue.c 6.39 (Berkeley) %G% (with queueing)";
+static char sccsid[] = "@(#)queue.c 6.40 (Berkeley) %G% (with queueing)";
-static char sccsid[] = "@(#)queue.c 6.39 (Berkeley) %G% (without queueing)";
+static char sccsid[] = "@(#)queue.c 6.40 (Berkeley) %G% (without queueing)";
#endif
#endif /* not lint */
#endif
#endif /* not lint */
while (WorkQ != NULL)
{
WORK *w = WorkQ;
while (WorkQ != NULL)
{
WORK *w = WorkQ;
+ extern bool shouldqueue();
+
+ /*
+ ** Ignore jobs that are too expensive for the moment.
+ */
+
+ if (shouldqueue(w->w_pri, w->w_ctime))
+ {
+ if (Verbose)
+ printf("\nSkipping %s\n", w->w_name + 2);
+ return;
+ }
+
+ dowork(w->w_name + 2, ForkQueueRuns, e);
free(w->w_name);
free((char *) w);
}
free(w->w_name);
free((char *) w);
}
** DOWORK -- do a work request.
**
** Parameters:
** DOWORK -- do a work request.
**
** Parameters:
-** w -- the work request to be satisfied.
+** id -- the ID of the job to run.
+** forkflag -- if set, run this in background.
+** e - the envelope in which to run it.
** The work request is satisfied if possible.
*/
** The work request is satisfied if possible.
*/
-dowork(w, e)
- register WORK *w;
+dowork(id, forkflag, e)
+ char *id;
+ bool forkflag;
register ENVELOPE *e;
{
register int i;
register ENVELOPE *e;
{
register int i;
- extern bool shouldqueue();
extern bool readqf();
if (tTd(40, 1))
extern bool readqf();
if (tTd(40, 1))
- printf("dowork: %s pri %ld\n", w->w_name, w->w_pri);
-
- /*
- ** Ignore jobs that are too expensive for the moment.
- */
-
- if (shouldqueue(w->w_pri, w->w_ctime))
- {
- if (Verbose)
- printf("\nSkipping %s\n", w->w_name + 2);
- return;
- }
+ printf("dowork(%s)\n", id);
clearenvelope(e, FALSE);
e->e_flags |= EF_QUEUERUN;
e->e_errormode = EM_MAIL;
clearenvelope(e, FALSE);
e->e_flags |= EF_QUEUERUN;
e->e_errormode = EM_MAIL;
- e->e_id = &w->w_name[2];
# ifdef LOG
if (LogLevel > 76)
syslog(LOG_DEBUG, "%s: dowork, pid=%d", e->e_id,
# ifdef LOG
if (LogLevel > 76)
syslog(LOG_DEBUG, "%s: dowork, pid=%d", e->e_id,
/* read the queue control file -- return if locked */
if (!readqf(e))
{
/* read the queue control file -- return if locked */
if (!readqf(e))
{
+ if (tTd(40, 4))
+ printf("readqf(%s) failed\n", e->e_id);
+ if (forkflag)
exit(EX_OK);
else
return;
exit(EX_OK);
else
return;
sendall(e, SM_DELIVER);
/* finish up and exit */
sendall(e, SM_DELIVER);
/* finish up and exit */
finis();
else
dropenvelope(e);
finis();
else
dropenvelope(e);
qfp = fopen(qf, "r+");
if (qfp == NULL)
{
qfp = fopen(qf, "r+");
if (qfp == NULL)
{
+ if (tTd(40, 8))
+ printf("readqf(%s): fopen failure (%s)\n",
+ qf, errstring(errno));
if (errno != ENOENT)
syserr("readqf: no control file %s", qf);
return FALSE;
if (errno != ENOENT)
syserr("readqf: no control file %s", qf);
return FALSE;
if (fstat(fileno(qfp), &st) < 0)
{
/* must have been being processed by someone else */
if (fstat(fileno(qfp), &st) < 0)
{
/* must have been being processed by someone else */
+ if (tTd(40, 8))
+ printf("readqf(%s): fstat failure (%s)\n",
+ qf, errstring(errno));
fclose(qfp);
return FALSE;
}
fclose(qfp);
return FALSE;
}
e->e_id, st.st_uid, st.st_mode);
}
# endif /* LOG */
e->e_id, st.st_uid, st.st_mode);
}
# endif /* LOG */
+ if (tTd(40, 8))
+ printf("readqf(%s): bogus file\n", qf);
fclose(qfp);
return FALSE;
}
fclose(qfp);
return FALSE;
}
if (!lockfile(fileno(qfp), qf, LOCK_EX|LOCK_NB))
{
/* being processed by another queuer */
if (!lockfile(fileno(qfp), qf, LOCK_EX|LOCK_NB))
{
/* being processed by another queuer */
+ if (tTd(40, 8))
+ printf("readqf(%s): locked\n", qf);
if (Verbose)
printf("%s: locked\n", e->e_id);
# ifdef LOG
if (Verbose)
printf("%s: locked\n", e->e_id);
# ifdef LOG
-static char sccsid[] = "@(#)recipient.c 6.32.1.1 (Berkeley) %G%";
+static char sccsid[] = "@(#)recipient.c 6.33 (Berkeley) %G%";
#endif /* not lint */
# include "sendmail.h"
#endif /* not lint */
# include "sendmail.h"
{
/* don't do any more now */
ctladdr->q_flags |= QVERIFIED;
{
/* don't do any more now */
ctladdr->q_flags |= QVERIFIED;
xfclose(fp, "include", fname);
return 0;
}
xfclose(fp, "include", fname);
return 0;
}
#ifndef lint
#ifdef USERDB
#ifndef lint
#ifdef USERDB
-static char sccsid [] = "@(#)udb.c 6.15 (Berkeley) %G% (with USERDB)";
+static char sccsid [] = "@(#)udb.c 6.16 (Berkeley) %G% (with USERDB)";
-static char sccsid [] = "@(#)udb.c 6.15 (Berkeley) %G% (without USERDB)";
+static char sccsid [] = "@(#)udb.c 6.16 (Berkeley) %G% (without USERDB)";
if (bitset(EF_VRFYONLY, e->e_flags))
{
a->q_flags |= QVERIFIED;
if (bitset(EF_VRFYONLY, e->e_flags))
{
a->q_flags |= QVERIFIED;