From 9d90c0e2874753692b1af9302ec5afbe3c94aa20 Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Tue, 27 May 2008 12:50:55 +0000 Subject: - Make the XFOWARD HELO available as a environment variable in scripts. [Glenn Matthys] --- common/smtppass.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'common/smtppass.c') diff --git a/common/smtppass.c b/common/smtppass.c index 5532927..afdff03 100644 --- a/common/smtppass.c +++ b/common/smtppass.c @@ -657,6 +657,12 @@ static void cleanup_context(spctx_t* ctx) ctx->xforwardaddr = NULL; } + if(ctx->xforwardhelo) + { + free(ctx->xforwardhelo); + ctx->xforwardhelo = NULL; + } + ctx->logline[0] = 0; } @@ -1132,6 +1138,14 @@ static int smtp_passthru(spctx_t* ctx) if(ctx->xforwardaddr) strcpy(ctx->xforwardaddr, t); } + + if((t = parse_xforward (C_LINE + KL(XFORWARD_CMD), "HELO"))) + { + ctx->xforwardhelo = (char*)reallocf(ctx->xforwardhelo, strlen(t) + 1); + if(ctx->xforwardhelo) + strcpy(ctx->xforwardhelo, t); + } + } /* RSET */ @@ -1778,6 +1792,9 @@ void sp_setup_forked(spctx_t* ctx, int file) if(ctx->xforwardaddr) setenv("REMOTE", ctx->xforwardaddr, 1); + if(ctx->xforwardhelo) + setenv("REMOTE_HELO", ctx->xforwardhelo, 1); + if(spio_valid(&(ctx->server))) setenv("SERVER", ctx->server.peername, 1); -- cgit v1.2.3