/* continue processing */ return SMFIS_CONTINUE;
}
sfsistat
mlfi_body(ctx, bodyp, bodylen) SMFICTX *ctx; u_char *bodyp; size_t bodylen;
{
/* output body block to log file */
if (fwrite(bodyp, bodylen, 1,
{
/* write failed */
(void) mlfi_cleanup(ctx, false); return SMFIS_TEMPFAIL;
}
/* continue processing */ return SMFIS_CONTINUE;
}
sfsistat
mlfi_eom(ctx)
SMFICTX *ctx;
{
return mlfi_cleanup(ctx,true);
}
Sfsistat
mlfi_close(ctx) SMFICTX *ctx;
{
return SMFIS_ACCEPT;
}
sfsistat
mlfi_abort(ctx) SMFICTX *ctx;
{
return mlfi_cleanup(ctx, false);
}
sfsistat
mlfi_cleanup(ctx,ok) SMFICTX *ctx; bool ok;
{
sfsistat rstat = SMFIS_CONTINUE; struct mlfiPriv *priv = MLFIPRIV; char *p;
char host[512]; char hbuf[1024];
if (priv == NULL) return rstat;
/* close the archive file */
if
{
/* failed; we have to wait until later */ rstat = SMFIS_TEMPFAIL;
(void)
}
else if (ok)
{
/* add a header to the message announcing our presence
*/if (gethostname(host, sizeof host) < 0) snprintf(host, sizeof host, "localhost");
p =
p =
else
p++;
snprintf(hbuf, sizeof hbuf, "%s@%s", p, host);
}
else
{
/* message was aborted
}
/* release private memory */
/* return status */ return rstat;
}
struct smfiDesc smfilter =