]> source.dussan.org Git - rspamd.git/commitdiff
[Minor] Treat empty `from` protocol header as canonical `<>`
authorVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 19 Nov 2021 14:46:11 +0000 (14:46 +0000)
committerVsevolod Stakhov <vsevolod@highsecure.ru>
Fri, 19 Nov 2021 14:46:11 +0000 (14:46 +0000)
Issue: #3983

src/libserver/protocol.c

index 654f16113066cba4e66a25c64504b5287a3c8486..65d0900df0b7166fb0eb6ddc765f0c4476e3d42f 100644 (file)
@@ -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);