--- lmtp2nntp_config.c 2002/02/28 12:57:55 1.59
+++ lmtp2nntp_config.c 2002/02/28 14:02:25 1.60
@@ -1619,10 +1619,6 @@
var_rc_t var_rc;
char *res_ptr;
log1(ctx, DEBUG, "expanding variables in header value '%s'", hrI->val);
- var_rc_t var_expand(var_t *var, const char *src_ptr,
- size_t src_len, char **dst_ptr, size_t *dst_len, int
- force_expand);
-
//if ((var_rc = var_expand(cp, strlen(cp), &res_ptr, NULL, ctx_lookup, ctx, &ctx_lookup_cfg, FALSE)) != VAR_OK) {
if ((var_rc = var_expand(ctx->config_varctx, cp, strlen(cp), &res_ptr, NULL, FALSE)) != VAR_OK) {
log3(ctx, ERROR, "expansion of '%s' failed: %s", cp, var_strerror(ctx->config_varctx, rc, &cp) == VAR_OK ? cp : "Unknown Error", rc);
@@ -1650,9 +1646,18 @@
hdNew->ndata = 0;
}
else {
- hdNew->data.s = strdupex(hrI->val);
- hdNew->ndata = 1;
/*FIXME clean up data.m */
+ /* expanding header and other variables into header value */
+ var_rc_t var_rc;
+ char *res_ptr;
+ log1(ctx, DEBUG, "expanding variables in header value '%s'", hrI->val);
+ //if ((var_rc = var_expand(cp, strlen(cp), &res_ptr, NULL, ctx_lookup, ctx, &ctx_lookup_cfg, FALSE)) != VAR_OK) {
+ if ((var_rc = var_expand(ctx->config_varctx, hrI->val, strlen(hrI->val), &res_ptr, NULL, FALSE)) != VAR_OK) {
+ log3(ctx, ERROR, "expansion of '%s' failed: %s", hrI->val, var_strerror(ctx->config_varctx, rc, &cp) == VAR_OK ? cp : "Unknown Error", rc);
+ }
+ log1(ctx, DEBUG, "expansion result '%s'", res_ptr);
+ hdNew->data.s = res_ptr;
+ hdNew->ndata = 1;
}
for (hdI = ctx->msg->hdFirst; hdI != NULL; hdI = hdI->next) { /* for each header */
if (hdI->name == NULL || strlen(hdI->name) == 0)
|