From: Vsevolod Stakhov Date: Fri, 19 Nov 2021 14:46:11 +0000 (+0000) Subject: [Minor] Treat empty `from` protocol header as canonical `<>` X-Git-Tag: 3.2~245 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=c14375d20c3628e074af585c399b4e342ed37e07;p=thirdparty%2Frspamd.git [Minor] Treat empty `from` protocol header as canonical `<>` Issue: #3983 --- diff --git a/src/libserver/protocol.c b/src/libserver/protocol.c index 654f161130..65d0900df0 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);