Пример #1
0
qu2bb_send () {
    short   result;
    char    info[LINESIZE],
            sender[LINESIZE];

#ifdef DEBUG
    ll_log (logptr, LLOGBTR, "qu2bb_send()");
#endif

    if (rp_isbad (result = qu_pkinit ()))
	return result;
    if (rp_isbad (result = bb_sbinit ()))
	return result;

    while (rp_gval ((result = qu_rinit (info, sender))) == RP_OK) {
#ifdef	DEBUG
	ll_log (logptr, LLOGGEN, "info=%s sender=%s", info, sender);
#endif
	if (rp_isbad (result = bb_winit (info, sender)))
	    return result;
	if (rp_isbad (result = qu2bb_each (sender)))
	    return result;
    }

    if (rp_gval (result) != RP_DONE) {
	ll_log (logptr, LLOGTMP, "not DONE [%s]", rp_valstr (result));
	return RP_RPLY;
    }

    qu_pkend ();
    bb_sbend ();

    return result;
}
Пример #2
0
mq_winit ()                       /* initialize to write queued msgs    */
{                                 /* set-up for queue file names        */
#ifdef DEBUG
    ll_log (logptr, LLOGBTR, "mq_init ()");
#endif

    /* multcpy used to get pointer to end of base strings */

    mq_tunique = multcpy (mq_tfname, tquedir, (char *)0);
    mq_aunique = multcpy (mq_afname, aquedir, (char *)0);
    mq_munique = multcpy (mq_mfname, mquedir, (char *)0);
}
Пример #3
0
lo_slave ()
{
	char	buf[2*LINESIZE];
	register int	  result;
	Mdlvry	mdlv;	/* A fake construct */
	Mdlvry	*mp;

#ifdef DEBUG
	ll_log (logptr, LLOGFTR, "lo_slave()");
#endif
	mp = &mdlv;
	printx ("\n");
	/* The production system of delivery attempts */

	/* FIRST Attempt: alias file specified file or pipe delivery */

	switch (*lo_parm) {
	case '|':	/* send to special process	    */
		printx ("(sending message to piped process)\r\n\t");
		sprintf (buf, "default - | A \"%s\"", lo_parm+1);
		if( parse_line(mp, buf) != OK)
			ll_log (logptr, LLOGTMP, "problem parsing '%s'", buf);
		return ( lo_dorules(mp, mp+1) );
	case '^':
		printx ("(sending message to process unformatted)\r\n\t");
		sprintf (buf, "default - ^ A \"%s\"", lo_parm + 1);
		if( parse_line (mp, buf) != OK)
			ll_log (logptr, LLOGTMP, "problem parsing '%s'", buf);
		return ( lo_dorules(mp, mp+1) );
	case '/':
		printx ("(placing into mail file '%s')\r\n\t", lo_parm+1);
		sprintf (buf, "default - > A \"%s\"", lo_parm +1 );
		if( parse_line (mp, buf) != OK)
			ll_log (logptr, LLOGTMP, "problem parsing '%s'", buf);
		return (lo_dorules (mp, mp + 1));
	}

	/*
	 * SECOND Attempt: user's .maildelivery file
	 */
	sprintf(buf,"%s/%s/%s",mldfldir,lo_pw->pw_name,dlvfile);
	if (rp_isgood (result = lo_dlvfile(buf))
			|| result != RP_MECH)
		return (result);

	/* THIRD Attempt: system delivery file */

	if (rp_isgood (result = lo_dlvfile(sysdlvfile))
			|| result != RP_MECH)
		return (result);

	/* FOURTH Attempt: regular deliver to the mailbox */

	printx ("trying normal delivery\r\n");
/*	sprintf (buf, "%s/%s",
		(mldfldir == 0 || isnull(mldfldir[0])) ? "." : mldfldir,
		(mldflfil == 0 || isnull(mldflfil[0])) ? lo_pw->pw_name : mldflfil);*/
	sprintf(buf,"%s/%s/%s",mldfldir,lo_pw->pw_name,mldflfil);

	return (lo_dofile (buf));
}