Sendmail 8.13.3 Programmer's Guide

Sample Program
Milter Sample Program
Chapter 566
(void) mlfi_cleanup(ctx, FALSE);
return SMFIS_TEMPFAIL;
}
snprintf(buf, len, "%s, %s", helohost, tls);
if (priv->mlfi_helofrom != NULL)
free(priv->mlfi_helofrom);
priv->mlfi_helofrom = buf;
/* continue processing */
return SMFIS_CONTINUE;
}
sfsistat
mlfi_envfrom(ctx, argv)
SMFICTX *ctx;
char **argv;
{
int fd = -1;
int argc = 0;
struct mlfiPriv *priv = MLFIPRIV;
char *mailaddr = smfi_getsymval(ctx, "{mail_addr}");
/* open a file to store this message */
if ((priv->mlfi_fname = strdup("/tmp/msg.XXXXXX")) == NULL)
{
(void) mlfi_cleanup(ctx, FALSE);
return SMFIS_TEMPFAIL;
}
if ((fd = mkstemp(priv->mlfi_fname)) == -1)
{
(void) mlfi_cleanup(ctx, FALSE);
return SMFIS_TEMPFAIL;
}
if ((priv->mlfi_fp = fdopen(fd, "w+")) == NULL)
{
(void) close(fd);
(void) mlfi_cleanup(ctx, FALSE);
return SMFIS_TEMPFAIL;
}
/* count the arguments */
while (*argv++ != NULL)
++argc;