usrerrenh("4.3.0", "451 Temporary failure");
{ usrerrenh("4.3.0", "451 Temporary failure"); rstat = EX_TEMPFAIL; goto finis; }
rscheck(rwset, p1, p2, e, rmcomm, cnt, logl, host)	char *rwset;	char *p1;	char *p2;	ENVELOPE *e;	bool rmcomm, cnt;	int logl;	char *host;{	char *buf;	int bufsize;	int saveexitstat;	int rstat = EX_OK;	char **pvp;	int rsno;	bool discard = FALSE;	auto ADDRESS a1;	bool saveQuickAbort = QuickAbort;	bool saveSuprErrs = SuprErrs;	char buf0[MAXLINE];	char pvpbuf[PSBUFSIZE];	extern char MsgBuf[];	if (tTd(48, 2))		dprintf("rscheck(%s, %s, %s)\n", rwset, p1,			p2 == NULL ? "(NULL)" : p2);	rsno = strtorwset(rwset, NULL, ST_FIND);	if (rsno < 0)		return EX_OK;	if (p2 != NULL)	{		bufsize = strlen(p1) + strlen(p2) + 2;		if (bufsize > sizeof buf0)			buf = xalloc(bufsize);		else		{			buf = buf0;			bufsize = sizeof buf0;		}		(void) snprintf(buf, bufsize, "%s%c%s", p1, CONDELSE, p2);	}	else	{		bufsize = strlen(p1) + 1;		if (bufsize > sizeof buf0)			buf = xalloc(bufsize);		else		{			buf = buf0;			bufsize = sizeof buf0;		}		(void) snprintf(buf, bufsize, "%s", p1);	}	SuprErrs = TRUE;	QuickAbort = FALSE;	pvp = prescan(buf, '\0', pvpbuf, sizeof pvpbuf, NULL,		      rmcomm ? NULL : TokTypeNoC);	SuprErrs = saveSuprErrs;	if (pvp == NULL)	{		if (tTd(48, 2))			dprintf("rscheck: cannot prescan input\n");/*		syserr("rscheck: cannot prescan input: \"%s\"",			shortenstring(buf, MAXSHORTSTR));		rstat = EX_DATAERR;*/		goto finis;	}	MapOpenErr = FALSE;	(void) rewrite(pvp, rsno, 0, e);	if (MapOpenErr)		usrerrenh("4.3.0", "451 Temporary failure");	if (pvp[0] == NULL || (pvp[0][0] & 0377) != CANONNET ||	    pvp[1] == NULL || (strcmp(pvp[1], "error") != 0 &&			       strcmp(pvp[1], "discard") != 0))	{		goto finis;	}	if (strcmp(pvp[1], "discard") == 0)	{		if (tTd(48, 2))			dprintf("rscheck: discard mailer selected\n");		e->e_flags |= EF_DISCARD;		discard = TRUE;	}	else	{		int savelogusrerrs = LogUsrErrs;		static bool logged = FALSE;		/* got an error -- process it */		saveexitstat = ExitStat;		LogUsrErrs = FALSE;		(void) buildaddr(pvp, &a1, 0, e);		LogUsrErrs = savelogusrerrs;		rstat = ExitStat;		ExitStat = saveexitstat;		if (!logged)		{			if (cnt)				markstats(e, &a1, TRUE);			logged = TRUE;		}	}	if (LogLevel >= logl)	{		char *relay;		char *p;		char lbuf[MAXLINE];		p = lbuf;		if (p2 != NULL)		{			snprintf(p, SPACELEFT(lbuf, p),				", arg2=%s",				p2);			p += strlen(p);		}		if (host != NULL)			relay = host;		else			relay = macvalue('_', e);		if (relay != NULL)		{			snprintf(p, SPACELEFT(lbuf, p),				", relay=%s", relay);			p += strlen(p);		}		*p = '\0';		if (discard)			sm_syslog(LOG_NOTICE, e->e_id,				  "ruleset=%s, arg1=%s%s, discard",				  rwset, p1, lbuf);		else			sm_syslog(LOG_NOTICE, e->e_id,				  "ruleset=%s, arg1=%s%s, reject=%s",				  rwset, p1, lbuf, MsgBuf);	} finis:	/* clean up */	QuickAbort = saveQuickAbort;	setstat(rstat);	if (buf != buf0)		free(buf);	if (rstat != EX_OK && QuickAbort)		longjmp(TopFrame, 2);	return rstat;}