14632Seric # include "sendmail.h" 24632Seric # include <sys/stat.h> 36625Sglickman # include <ndir.h> 44634Seric # include <signal.h> 54632Seric # include <errno.h> 64632Seric 75182Seric # ifndef QUEUE 8*7860Seric SCCSID(@(#)queue.c 3.35 08/23/82 (no queueing)); 95182Seric # else QUEUE 104632Seric 11*7860Seric SCCSID(@(#)queue.c 3.35 08/23/82); 125182Seric 134632Seric /* 144632Seric ** QUEUEUP -- queue a message up for future transmission. 154632Seric ** 164632Seric ** The queued message should already be in the correct place. 174632Seric ** This routine just outputs the control file as appropriate. 184632Seric ** 194632Seric ** Parameters: 206980Seric ** e -- the envelope to queue up. 216999Seric ** queueall -- if TRUE, queue all addresses, rather than 226999Seric ** just those with the QQUEUEUP flag set. 234632Seric ** 244632Seric ** Returns: 254632Seric ** none. 264632Seric ** 274632Seric ** Side Effects: 284632Seric ** The current request (only unsatisfied addresses) 294632Seric ** are saved in a control file. 304632Seric */ 314632Seric 326999Seric queueup(e, queueall) 336980Seric register ENVELOPE *e; 346999Seric bool queueall; 354632Seric { 367812Seric char *tf; 377812Seric char *qf; 387763Seric char buf[MAXLINE]; 397812Seric register FILE *tfp; 404632Seric register HDR *h; 415007Seric register ADDRESS *q; 425902Seric register int i; 434632Seric 445037Seric /* 455037Seric ** Create control file. 465037Seric */ 474632Seric 487812Seric tf = newstr(queuename(e, 't')); 497812Seric tfp = fopen(tf, "w"); 507812Seric if (tfp == NULL) 514632Seric { 527812Seric syserr("queueup: cannot create temp file %s", tf); 534632Seric return; 544632Seric } 557812Seric (void) chmod(tf, 0600); 564632Seric 574632Seric # ifdef DEBUG 587677Seric if (tTd(40, 1)) 597812Seric printf("queueing in %s\n", tf); 604632Seric # endif DEBUG 614632Seric 624632Seric /* 636980Seric ** If there is no data file yet, create one. 646980Seric */ 656980Seric 666980Seric if (e->e_df == NULL) 676980Seric { 686980Seric register FILE *dfp; 696980Seric 707812Seric e->e_df = newstr(queuename(e, 'd')); 716980Seric dfp = fopen(e->e_df, "w"); 726980Seric if (dfp == NULL) 736980Seric { 746980Seric syserr("queueup: cannot create %s", e->e_df); 757812Seric (void) fclose(tfp); 766980Seric return; 776980Seric } 787010Seric (void) chmod(e->e_df, 0600); 796980Seric (*e->e_putbody)(dfp, Mailer[1], FALSE); 807009Seric (void) fclose(dfp); 816980Seric } 826980Seric 836980Seric /* 844632Seric ** Output future work requests. 854632Seric */ 864632Seric 874632Seric /* output name of data file */ 887812Seric fprintf(tfp, "D%s\n", e->e_df); 894632Seric 904632Seric /* output name of sender */ 917812Seric fprintf(tfp, "S%s\n", e->e_from.q_paddr); 924632Seric 93*7860Seric /* output creation time */ 94*7860Seric fprintf(tfp, "T%ld\n", e->e_ctime); 954632Seric 964634Seric /* output message priority */ 977812Seric fprintf(tfp, "P%ld\n", e->e_msgpriority); 984634Seric 996980Seric /* output message class */ 1007812Seric fprintf(tfp, "C%d\n", e->e_class); 1016980Seric 1025902Seric /* output macro definitions */ 1037763Seric /* I don't think this is needed any more..... 1045902Seric for (i = 0; i < 128; i++) 1055902Seric { 1066980Seric register char *p = e->e_macro[i]; 1075902Seric 1085902Seric if (p != NULL && i != (int) 'b') 1097812Seric fprintf(tfp, "M%c%s\n", i, p); 1105902Seric } 1117763Seric ..... */ 1125902Seric 1134632Seric /* output list of recipient addresses */ 1146980Seric for (q = e->e_sendqueue; q != NULL; q = q->q_next) 1154632Seric { 1165037Seric # ifdef DEBUG 1177677Seric if (tTd(40, 1)) 1185037Seric { 1195037Seric printf("queueing "); 1205037Seric printaddr(q, FALSE); 1215037Seric } 1225037Seric # endif DEBUG 1237763Seric if (queueall ? !bitset(QDONTSEND, q->q_flags) : 1247763Seric bitset(QQUEUEUP, q->q_flags)) 1257812Seric fprintf(tfp, "R%s\n", q->q_paddr); 1264632Seric } 1274632Seric 1284632Seric /* output headers for this message */ 1297763Seric define('g', "$f"); 1306980Seric for (h = e->e_header; h != NULL; h = h->h_link) 1314632Seric { 1324632Seric if (h->h_value == NULL || h->h_value[0] == '\0') 1334632Seric continue; 1347812Seric fprintf(tfp, "H"); 1354632Seric if (h->h_mflags != 0 && bitset(H_CHECK|H_ACHECK, h->h_flags)) 1367812Seric mfdecode(h->h_mflags, tfp); 1377812Seric fprintf(tfp, "%s: ", h->h_field); 1387763Seric if (bitset(H_DEFAULT, h->h_flags)) 1397763Seric { 1407763Seric (void) expand(h->h_value, buf, &buf[sizeof buf], e); 1417812Seric fprintf(tfp, "%s\n", buf); 1427763Seric } 1437763Seric else 1447812Seric fprintf(tfp, "%s\n", h->h_value); 1454632Seric } 1464632Seric 1474632Seric /* 1484632Seric ** Clean up. 1494632Seric */ 1504632Seric 1517812Seric (void) fclose(tfp); 1527812Seric qf = queuename(e, 'q'); 1537812Seric (void) unlink(qf); 1547812Seric if (link(tf, qf) < 0) 1557812Seric syserr("cannot link(%s, %s), df=%s", tf, qf, e->e_df); 1566980Seric else 1577812Seric (void) unlink(tf); 1587812Seric e->e_qf = NULL; 1597391Seric 1607677Seric # ifdef LOG 1617677Seric /* save log info */ 1627677Seric if (LogLevel > 9) 1637812Seric syslog(LOG_INFO, "%s queueup: qf=%s, df=%s\n", e->e_id, qf, e->e_df); 1647677Seric # endif LOG 1657677Seric 1667391Seric /* disconnect this temp file from the job */ 1677391Seric e->e_df = NULL; 1684632Seric } 1694632Seric /* 1704632Seric ** RUNQUEUE -- run the jobs in the queue. 1714632Seric ** 1724632Seric ** Gets the stuff out of the queue in some presumably logical 1734632Seric ** order and processes them. 1744632Seric ** 1754632Seric ** Parameters: 1764632Seric ** none. 1774632Seric ** 1784632Seric ** Returns: 1794632Seric ** none. 1804632Seric ** 1814632Seric ** Side Effects: 1824632Seric ** runs things in the mail queue. 1834632Seric */ 1844632Seric 1854639Seric bool ReorderQueue; /* if set, reorder the send queue */ 1864639Seric int QueuePid; /* pid of child running queue */ 1874634Seric 1884639Seric runqueue(forkflag) 1894639Seric bool forkflag; 1904632Seric { 1914634Seric extern reordersig(); 1924632Seric 1937466Seric /* 1947466Seric ** See if we want to go off and do other useful work. 1957466Seric */ 1964639Seric 1974639Seric if (forkflag) 1984639Seric { 1994639Seric QueuePid = dofork(); 2004639Seric if (QueuePid > 0) 2014639Seric { 2024639Seric /* parent */ 2037690Seric if (QueueIntvl != 0) 2047690Seric setevent(QueueIntvl, reordersig, TRUE); 2054639Seric return; 2064639Seric } 2074639Seric } 2084639Seric 2097466Seric /* 2107466Seric ** Start making passes through the queue. 2117466Seric ** First, read and sort the entire queue. 2127466Seric ** Then, process the work in that order. 2137466Seric ** But if you take too long, start over. 2147466Seric ** There is a race condition at the end -- we could get 2157466Seric ** a reorder signal after finishing the queue. 2167466Seric ** In this case we will hang for one more queue 2177466Seric ** interval -- clearly a botch, but rare and 2187466Seric ** relatively innocuous. 2197466Seric */ 2207466Seric 2214634Seric for (;;) 2224634Seric { 2237466Seric /* order the existing work requests */ 2244634Seric orderq(); 2257690Seric 2267690Seric /* arrange to reorder later */ 2274634Seric ReorderQueue = FALSE; 2287690Seric if (QueueIntvl != 0) 2297690Seric setevent(QueueIntvl, reordersig, FALSE); 2304634Seric 2317466Seric /* process them once at a time */ 2324634Seric while (WorkQ != NULL) 2334634Seric { 2344634Seric WORK *w = WorkQ; 2354634Seric 2364634Seric WorkQ = WorkQ->w_next; 2374634Seric dowork(w); 2384634Seric free(w->w_name); 2394634Seric free((char *) w); 2404634Seric if (ReorderQueue) 2414634Seric break; 2424634Seric } 2434634Seric 2447466Seric /* if we are just doing one pass, then we are done */ 2454634Seric if (QueueIntvl == 0) 2467690Seric finis(); 2477466Seric 2487466Seric /* wait for work -- note (harmless) race condition here */ 2497690Seric while (!ReorderQueue) 2507690Seric { 2517690Seric if (forkflag) 2527690Seric finis(); 2537466Seric pause(); 2547690Seric } 2554632Seric } 2564632Seric } 2574632Seric /* 2587690Seric ** REORDERSIG -- catch the reorder signal and tell sendmail to reorder queue. 2594634Seric ** 2604634Seric ** Parameters: 2617690Seric ** parent -- if set, called from parent (i.e., not 2627690Seric ** really doing the work). 2634634Seric ** 2644634Seric ** Returns: 2654634Seric ** none. 2664634Seric ** 2674634Seric ** Side Effects: 2684634Seric ** sets the "reorder work queue" flag. 2694634Seric */ 2704634Seric 2717690Seric reordersig(parent) 2727690Seric bool parent; 2734634Seric { 2747690Seric if (!parent) 2754639Seric { 2764639Seric /* we are in a child doing queueing */ 2774639Seric ReorderQueue = TRUE; 2784639Seric } 2794639Seric else 2804639Seric { 2817690Seric /* 2827690Seric ** In parent. If the child still exists, we want 2837690Seric ** to do nothing. If the child is gone, we will 2847690Seric ** start up a new one. 2857690Seric ** If the child exists, it is responsible for 2867690Seric ** doing a queue reorder. 2877690Seric ** This code really sucks. 2887690Seric */ 2897690Seric 2904639Seric if (kill(QueuePid, SIGALRM) < 0) 2914639Seric { 2924639Seric /* no child -- get zombie & start new one */ 2934639Seric static int st; 2944639Seric 2954836Seric (void) wait(&st); 2967690Seric runqueue(TRUE); 2974639Seric } 2984639Seric } 2994639Seric 3004639Seric /* 3014639Seric ** Arrange to get this signal again. 3024639Seric */ 3034639Seric 3047690Seric setevent(QueueIntvl, reordersig, parent); 3054634Seric } 3064634Seric /* 3074632Seric ** ORDERQ -- order the work queue. 3084632Seric ** 3094632Seric ** Parameters: 3104632Seric ** none. 3114632Seric ** 3124632Seric ** Returns: 3134632Seric ** none. 3144632Seric ** 3154632Seric ** Side Effects: 3164632Seric ** Sets WorkQ to the queue of available work, in order. 3174632Seric */ 3184632Seric 3194632Seric # define WLSIZE 120 /* max size of worklist per sort */ 3204632Seric 3214632Seric orderq() 3224632Seric { 3236625Sglickman register struct direct *d; 3244632Seric register WORK *w; 3254632Seric register WORK **wp; /* parent of w */ 3266625Sglickman DIR *f; 3274632Seric register int i; 3284632Seric WORK wlist[WLSIZE]; 3294632Seric int wn = 0; 3304632Seric extern workcmpf(); 3314632Seric extern char *QueueDir; 3324632Seric 3334632Seric /* clear out old WorkQ */ 3344632Seric for (w = WorkQ; w != NULL; ) 3354632Seric { 3364632Seric register WORK *nw = w->w_next; 3374632Seric 3384632Seric WorkQ = nw; 3394632Seric free(w->w_name); 3404632Seric free((char *) w); 3414632Seric w = nw; 3424632Seric } 3434632Seric 3444632Seric /* open the queue directory */ 3456625Sglickman f = opendir(QueueDir); 3464632Seric if (f == NULL) 3474632Seric { 3484632Seric syserr("orderq: cannot open %s", QueueDir); 3494632Seric return; 3504632Seric } 3514632Seric 3524632Seric /* 3534632Seric ** Read the work directory. 3544632Seric */ 3554632Seric 3566625Sglickman while (wn < WLSIZE && (d = readdir(f)) != NULL) 3574632Seric { 3584632Seric char cbuf[MAXNAME]; 3594632Seric char lbuf[MAXNAME]; 3604632Seric FILE *cf; 3614632Seric register char *p; 3624632Seric 3634632Seric /* is this an interesting entry? */ 3647812Seric if (d->d_name[0] != 'q' || d->d_name[1] != 'f') 3654632Seric continue; 3664632Seric 3674632Seric /* yes -- find the control file location */ 3687009Seric (void) strcpy(cbuf, QueueDir); 3697009Seric (void) strcat(cbuf, "/"); 3704632Seric p = &cbuf[strlen(cbuf)]; 3717009Seric (void) strcpy(p, d->d_name); 3724632Seric 3734632Seric /* open control file */ 3744632Seric cf = fopen(cbuf, "r"); 3754632Seric if (cf == NULL) 3764632Seric { 3777055Seric /* this may be some random person sending hir msgs */ 3787055Seric /* syserr("orderq: cannot open %s", cbuf); */ 3797055Seric errno = 0; 3804632Seric continue; 3814632Seric } 3825037Seric wlist[wn].w_name = newstr(cbuf); 3834632Seric 3844632Seric /* extract useful information */ 3854632Seric while (fgets(lbuf, sizeof lbuf, cf) != NULL) 3864632Seric { 3874632Seric fixcrlf(lbuf, TRUE); 3884632Seric 3894632Seric switch (lbuf[0]) 3904632Seric { 3914632Seric case 'P': /* message priority */ 3925037Seric (void) sscanf(&lbuf[1], "%ld", &wlist[wn].w_pri); 3934632Seric break; 3944632Seric } 3954632Seric } 3964632Seric wn++; 3974632Seric (void) fclose(cf); 3984632Seric } 3996625Sglickman (void) closedir(f); 4004632Seric 4014632Seric /* 4024632Seric ** Sort the work directory. 4034632Seric */ 4044632Seric 4054632Seric qsort(wlist, wn, sizeof *wlist, workcmpf); 4064632Seric 4074632Seric /* 4084632Seric ** Convert the work list into canonical form. 4094632Seric */ 4104632Seric 4114632Seric wp = &WorkQ; 4124632Seric for (i = 0; i < wn; i++) 4134632Seric { 4144632Seric w = (WORK *) xalloc(sizeof *w); 4154632Seric w->w_name = wlist[i].w_name; 4164632Seric w->w_pri = wlist[i].w_pri; 4174632Seric w->w_next = NULL; 4184632Seric *wp = w; 4194632Seric wp = &w->w_next; 4204632Seric } 4214632Seric 4224632Seric # ifdef DEBUG 4237677Seric if (tTd(40, 1)) 4244632Seric { 4254632Seric for (w = WorkQ; w != NULL; w = w->w_next) 4265037Seric printf("%32s: pri=%ld\n", w->w_name, w->w_pri); 4274632Seric } 4284632Seric # endif DEBUG 4294632Seric } 4304632Seric /* 4317677Seric ** WORKCMPF -- compare function for ordering work. 4324632Seric ** 4334632Seric ** Parameters: 4344632Seric ** a -- the first argument. 4354632Seric ** b -- the second argument. 4364632Seric ** 4374632Seric ** Returns: 4384632Seric ** -1 if a < b 4394632Seric ** 0 if a == b 4404632Seric ** 1 if a > b 4414632Seric ** 4424632Seric ** Side Effects: 4434632Seric ** none. 4444632Seric */ 4454632Seric 4464632Seric # define PRIFACT 1800 /* bytes each priority point is worth */ 4474632Seric 4484632Seric workcmpf(a, b) 4495037Seric register WORK *a; 4505037Seric register WORK *b; 4514632Seric { 4525037Seric if (a->w_pri == b->w_pri) 4534632Seric return (0); 4545037Seric else if (a->w_pri > b->w_pri) 4554632Seric return (1); 4564632Seric else 4574632Seric return (-1); 4584632Seric } 4594632Seric /* 4604632Seric ** DOWORK -- do a work request. 4614632Seric ** 4624632Seric ** Parameters: 4634632Seric ** w -- the work request to be satisfied. 4644632Seric ** 4654632Seric ** Returns: 4664632Seric ** none. 4674632Seric ** 4684632Seric ** Side Effects: 4694632Seric ** The work request is satisfied if possible. 4704632Seric */ 4714632Seric 4724632Seric dowork(w) 4734632Seric register WORK *w; 4744632Seric { 4754632Seric register int i; 4764632Seric auto int xstat; 4774632Seric 4784632Seric # ifdef DEBUG 4797677Seric if (tTd(40, 1)) 4805037Seric printf("dowork: %s pri %ld\n", w->w_name, w->w_pri); 4814632Seric # endif DEBUG 4824632Seric 4834632Seric /* 4844632Seric ** Fork for work. 4854632Seric */ 4864632Seric 4874632Seric i = fork(); 4884632Seric if (i < 0) 4894632Seric { 4904632Seric syserr("dowork: cannot fork"); 4914632Seric return; 4924632Seric } 4934632Seric 4944632Seric if (i == 0) 4954632Seric { 4966980Seric char buf[MAXNAME]; 4976980Seric 4984632Seric /* 4994632Seric ** CHILD 5006980Seric ** Change the name of the control file to avoid 5017350Seric ** duplicate deliveries. Then run the file 5027350Seric ** as though we had just read it. 5037350Seric ** We save an idea of the temporary name so we 5047350Seric ** can recover on interrupt. 5054632Seric */ 5064632Seric 5077763Seric /* set basic modes, etc. */ 5087356Seric (void) alarm(0); 5097347Seric FatalErrors = FALSE; 5104632Seric QueueRun = TRUE; 5116991Seric MailBack = TRUE; 5127812Seric CurEnv->e_qf = w->w_name; 5137812Seric CurEnv->e_id = &w->w_name[strlen(QueueDir) + 3]; 5147763Seric 5157763Seric /* don't use the headers from sendmail.cf... */ 5167763Seric CurEnv->e_header = NULL; 5177763Seric chompheader("from: $q", TRUE); 5187763Seric 5197763Seric /* create the link to the control file during processing */ 5207812Seric if (link(w->w_name, queuename(CurEnv, 'l')) < 0) 5216980Seric { 5227812Seric /* being processed by another queuer */ 5236980Seric exit(EX_OK); 5246980Seric } 5256980Seric 5266980Seric /* create ourselves a transcript file */ 5274634Seric openxscrpt(); 5286980Seric 5296980Seric /* do basic system initialization */ 5304632Seric initsys(); 5316980Seric 5326980Seric /* read the queue control file */ 5337812Seric readqf(CurEnv->e_qf); 5347781Seric eatheader(); 5356980Seric 5366980Seric /* do the delivery */ 5377558Seric if (!FatalErrors) 5387558Seric sendall(CurEnv, FALSE); 5396980Seric 5406980Seric /* if still not sent, perhaps we should time out.... */ 5414634Seric # ifdef DEBUG 5427677Seric if (tTd(40, 3)) 543*7860Seric printf("CurTime=%ld, TimeOut=%ld\n", CurTime, 544*7860Seric CurEnv->e_ctime + TimeOut); 5454634Seric # endif DEBUG 546*7860Seric if (CurEnv->e_queueup && CurTime > CurEnv->e_ctime + TimeOut) 5474634Seric timeout(w); 5486980Seric 5496980Seric /* finish up and exit */ 5504632Seric finis(); 5514632Seric } 5524632Seric 5534632Seric /* 5544632Seric ** Parent -- pick up results. 5554632Seric */ 5564632Seric 5574632Seric errno = 0; 5584632Seric while ((i = wait(&xstat)) > 0 && errno != EINTR) 5594632Seric { 5604632Seric if (errno == EINTR) 5614632Seric { 5624632Seric errno = 0; 5634632Seric } 5644632Seric } 5654632Seric } 5664632Seric /* 5674632Seric ** READQF -- read queue file and set up environment. 5684632Seric ** 5694632Seric ** Parameters: 5704632Seric ** cf -- name of queue control file. 5714632Seric ** 5724632Seric ** Returns: 5734632Seric ** none. 5744632Seric ** 5754632Seric ** Side Effects: 5764632Seric ** cf is read and created as the current job, as though 5774632Seric ** we had been invoked by argument. 5784632Seric */ 5794632Seric 5804632Seric readqf(cf) 5814632Seric char *cf; 5824632Seric { 5834632Seric register FILE *f; 5847785Seric char buf[MAXFIELD]; 5857753Seric register char *p; 5867753Seric register int i; 5874632Seric 5884632Seric /* 5894632Seric ** Open the file created by queueup. 5904632Seric */ 5914632Seric 5924632Seric f = fopen(cf, "r"); 5934632Seric if (f == NULL) 5944632Seric { 5954632Seric syserr("readqf: no cf file %s", cf); 5964632Seric return; 5974632Seric } 5984632Seric 5994632Seric /* 6004632Seric ** Read and process the file. 6014632Seric */ 6024632Seric 6037356Seric if (Verbose) 6047356Seric printf("\nRunning %s\n", cf); 6057785Seric while (fgetfolded(buf, sizeof buf, f) != NULL) 6064632Seric { 6074632Seric switch (buf[0]) 6084632Seric { 6094632Seric case 'R': /* specify recipient */ 6106908Seric sendto(&buf[1], 1, (ADDRESS *) NULL, &CurEnv->e_sendqueue); 6114632Seric break; 6124632Seric 6134632Seric case 'H': /* header */ 6144632Seric (void) chompheader(&buf[1], FALSE); 6154632Seric break; 6164632Seric 6174632Seric case 'S': /* sender */ 6184634Seric setsender(newstr(&buf[1])); 6194632Seric break; 6204632Seric 6214632Seric case 'D': /* data file name */ 6226991Seric CurEnv->e_df = newstr(&buf[1]); 6236991Seric TempFile = fopen(CurEnv->e_df, "r"); 6244632Seric if (TempFile == NULL) 6256991Seric syserr("readqf: cannot open %s", CurEnv->e_df); 6264632Seric break; 6274632Seric 628*7860Seric case 'T': /* init time */ 629*7860Seric (void) sscanf(&buf[1], "%ld", &CurEnv->e_ctime); 6304632Seric break; 6314632Seric 6324634Seric case 'P': /* message priority */ 6336908Seric (void) sscanf(&buf[1], "%ld", &CurEnv->e_msgpriority); 6345037Seric 6355037Seric /* make sure that big things get sent eventually */ 6366908Seric CurEnv->e_msgpriority -= WKTIMEFACT; 6374634Seric break; 6384634Seric 6396980Seric case 'C': /* message class */ 6406980Seric (void) sscanf(&buf[1], "%hd", &CurEnv->e_class); 6416980Seric break; 6426980Seric 6435902Seric case 'M': /* define macro */ 6445902Seric define(buf[1], newstr(&buf[2])); 6455902Seric break; 6465902Seric 6474632Seric default: 6484632Seric syserr("readqf(%s): bad line \"%s\"", cf, buf); 6494632Seric break; 6504632Seric } 6514632Seric } 6524632Seric } 6534632Seric /* 6544632Seric ** TIMEOUT -- process timeout on queue file. 6554632Seric ** 6564632Seric ** Parameters: 6574632Seric ** w -- pointer to work request that timed out. 6584632Seric ** 6594632Seric ** Returns: 6604632Seric ** none. 6614632Seric ** 6624632Seric ** Side Effects: 6634632Seric ** Returns a message to the sender saying that this 6644632Seric ** message has timed out. 6654632Seric */ 6664632Seric 6674632Seric timeout(w) 6684632Seric register WORK *w; 6694632Seric { 6707369Seric char buf[MAXLINE]; 671*7860Seric extern char *pintvl(); 6727369Seric 6734634Seric # ifdef DEBUG 6747677Seric if (tTd(40, 3)) 6754634Seric printf("timeout(%s)\n", w->w_name); 6764634Seric # endif DEBUG 6776991Seric message(Arpa_Info, "Message has timed out"); 6784634Seric 6794634Seric /* return message to sender */ 680*7860Seric (void) sprintf(buf, "Cannot send mail for %s", pintvl(TimeOut, FALSE)); 6817369Seric (void) returntosender(buf, &CurEnv->e_from, TRUE); 6824634Seric 6834634Seric /* arrange to remove files from queue */ 684*7860Seric CurEnv->e_dontqueue = TRUE; 6854632Seric } 6865182Seric 6875182Seric # endif QUEUE 688