From c14375d20c3628e074af585c399b4e342ed37e07 Mon Sep 17 00:00:00 2001 From: Vsevolod Stakhov Date: Fri, 19 Nov 2021 14:46:11 +0000 Subject: [Minor] Treat empty `from` protocol header as canonical `<>` Issue: #3983 --- src/libserver/protocol.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/libserver/protocol.c') diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index 654f16113..65d0900df 100644 --- a/src/libserver/protocol.c +++ b/src/libserver/protocol.c @@ -499,6 +499,10 @@ rspamd_protocol_handle_headers (struct rspamd_task *task, case 'f': case 'F': IF_HEADER (FROM_HEADER) { + if (hv_tok->len == 0) { + /* Replace '' with '<>' to fix parsing issue */ + RSPAMD_FTOK_ASSIGN(hv_tok, "<>"); + } task->from_envelope = rspamd_email_address_from_smtp ( hv_tok->begin, hv_tok->len); -- cgit v1.2.3