- /*
- ** If we don't want to wait around for actual delivery, this
- ** is a good time to fork off.
- ** We have examined what we can without doing actual
- ** delivery, so we will inform our caller of
- ** whatever we can now.
- ** Since the parent process will go away immediately,
- ** the child will be caught by init.
- ** If the fork fails, we will just continue in the
- ** parent; this is perfectly safe, albeit
- ** slower than it must be.
- */
-
-# ifdef QUEUE
- if (Mode == MD_QUEUE)
- {
- register ADDRESS *q;
-
- for (q = CurEnv->e_sendqueue; q != NULL; q = q->q_next)
- {
- if (!bitset(QDONTSEND, q->q_flags))
- {
- CurEnv->e_to = q->q_paddr;
- message(Arpa_Info, "queued");
- if (LogLevel > 4)
- logdelivery("queued");
- }
- CurEnv->e_to = NULL;
- }
- }
- if (Mode == MD_QUEUE || Mode == MD_FORK ||
- (Mode != MD_VERIFY && SuperSafe))
- queueup(CurEnv, TRUE);
-
- if (Mode == MD_FORK)
- {
- if (fork() > 0)
- {
- /* parent -- quit */
- exit(ExitStat);
- }
-# ifdef LOG
- if (LogLevel > 11)
- syslog(LOG_DEBUG, "background delivery, pid=%d", getpid());
-# endif LOG
- }
- else if (Mode == MD_QUEUE)
- {
- CurEnv->e_df = CurEnv->e_qf = NULL;
- CurEnv->e_dontqueue = TRUE;
- finis();
- }
-