From e374ed13a73618e8f5d4509dacb1e264791cd57b Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Wed, 17 Nov 2010 15:23:27 +0000 Subject: Parse MAIL FROM and RCPT TO properly, and skip authenticated. --- common/smtppass.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'common') diff --git a/common/smtppass.c b/common/smtppass.c index 8cc0522..00347d9 100644 --- a/common/smtppass.c +++ b/common/smtppass.c @@ -1075,18 +1075,21 @@ static int smtp_passthru(spctx_t* ctx) auth_started = 1; } - else if(is_first_word(C_LINE, FROM_CMD, KL(FROM_CMD)) || - is_first_word(C_LINE, TO_CMD, KL(TO_CMD))) + else if(check_first_word(C_LINE, FROM_CMD, KL(FROM_CMD), SMTP_DELIMS) > 0 || + check_first_word(C_LINE, TO_CMD, KL(TO_CMD), SMTP_DELIMS) > 0) { - r = cb_check_pre(ctx); - if(r < 0) + if(!should_skip_processing(ctx)) { - RETURN(-1); - } - else if(r == 0) - { - cleanup_context(ctx); - continue; + r = cb_check_pre(ctx); + if(r < 0) + { + RETURN(-1); + } + else if(r == 0) + { + cleanup_context(ctx); + continue; + } } } -- cgit v1.2.3