Mercurial > sm-archive
changeset 7:5241a079fe03
initial version
author | carl |
---|---|
date | Fri, 10 Mar 2006 12:26:37 -0800 |
parents | 0b03e7656abf |
children | ed73e6361570 |
files | src/sm-archive.cpp |
diffstat | 1 files changed, 15 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/sm-archive.cpp Fri Mar 10 12:14:57 2006 -0800 +++ b/src/sm-archive.cpp Fri Mar 10 12:26:37 2006 -0800 @@ -176,6 +176,19 @@ return SMFIS_CONTINUE; } +void add_target(mlfiPriv &priv, SMFICTX *ctx, char *target); +void add_target(mlfiPriv &priv, SMFICTX *ctx, char *target) +{ + if (target) { + smfi_addrcpt(ctx, target); + if (debug_syslog > 1) { + char msg[maxlen]; + snprintf(msg, sizeof(msg), "adding recipient <%s>", target); + my_syslog(&priv, msg); + } + } +} + sfsistat mlfi_envrcpt(SMFICTX *ctx, char **rcpt) { mlfiPriv &priv = *MLFIPRIV; @@ -188,11 +201,11 @@ my_syslog(&priv, msg); } char *target = dc.find_to(rcptaddr); - if (target) smfi_addrcpt(ctx, target); + add_target(priv, ctx, target); free(rcptaddr); if (!priv.processed_from) { target = dc.find_from(priv.mailaddr); - if (target) smfi_addrcpt(ctx, target); + add_target(priv, ctx, target); priv.processed_from = true; } return SMFIS_CONTINUE;