diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-06-11 15:26:32 +0100 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2020-06-11 15:26:32 +0100 |
commit | 4d1cd2128212c4db4aa8b654cb6baa2b4de3378d (patch) | |
tree | d73814bf537d1d64b992dd4fdc9a1b70e0f1ee4e /src/libmime/message.c | |
parent | b2d80e6066657216572090743ce45604a2e6ccb6 (diff) | |
download | rspamd-4d1cd2128212c4db4aa8b654cb6baa2b4de3378d.tar.gz rspamd-4d1cd2128212c4db4aa8b654cb6baa2b4de3378d.zip |
[Minor] Avoid code duplication
Diffstat (limited to 'src/libmime/message.c')
-rw-r--r-- | src/libmime/message.c | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/src/libmime/message.c b/src/libmime/message.c index eec992552..f2f22f6fe 100644 --- a/src/libmime/message.c +++ b/src/libmime/message.c @@ -1127,26 +1127,22 @@ rspamd_message_parse (struct rspamd_task *task) * Exim somehow uses mailbox format for messages being scanned: * From xxx@xxx.com Fri May 13 19:08:48 2016 * - * So we check if a task has non-http format then we check for such a line - * at the beginning to avoid errors + * So we check if a task has this line to avoid possible issues */ - if (task->cmd != CMD_CHECK_V2 || (task->protocol_flags & - RSPAMD_TASK_PROTOCOL_FLAG_LOCAL_CLIENT)) { - if (len > sizeof ("From ") - 1) { - if (memcmp (p, "From ", sizeof ("From ") - 1) == 0) { - /* Skip to CRLF */ - msg_info_task ("mailbox input detected, enable workaround"); - p += sizeof ("From ") - 1; - len -= sizeof ("From ") - 1; - - while (len > 0 && *p != '\n') { - p ++; - len --; - } - while (len > 0 && g_ascii_isspace (*p)) { - p ++; - len --; - } + if (len > sizeof ("From ") - 1) { + if (memcmp (p, "From ", sizeof ("From ") - 1) == 0) { + /* Skip to CRLF */ + msg_info_task ("mailbox input detected, enable workaround"); + p += sizeof ("From ") - 1; + len -= sizeof ("From ") - 1; + + while (len > 0 && *p != '\n') { + p ++; + len --; + } + while (len > 0 && g_ascii_isspace (*p)) { + p ++; + len --; } } } |