diff options
author | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-02-07 17:24:51 +0000 |
---|---|---|
committer | Vsevolod Stakhov <vsevolod@highsecure.ru> | 2019-02-07 17:24:51 +0000 |
commit | 841dbfe275d0863c272420ac718ea5f478552c4d (patch) | |
tree | 46efe0fdcb786603cc4bc34e6f5979c07730c4ef /src/libmime/mime_headers.c | |
parent | 1e0caa55d3f1910973694d6481a13c689212a1cd (diff) | |
download | rspamd-841dbfe275d0863c272420ac718ea5f478552c4d.tar.gz rspamd-841dbfe275d0863c272420ac718ea5f478552c4d.zip |
[Minor] Fix `with` parsing
Diffstat (limited to 'src/libmime/mime_headers.c')
-rw-r--r-- | src/libmime/mime_headers.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/libmime/mime_headers.c b/src/libmime/mime_headers.c index 20c1e2ee9..ca44c4765 100644 --- a/src/libmime/mime_headers.c +++ b/src/libmime/mime_headers.c @@ -1427,7 +1427,7 @@ rspamd_smtp_received_parse (struct rspamd_task *task, RSPAMD_FTOK_ASSIGN (&t2, "esmtp"); - if (rspamd_ftok_starts_with (&t1, &t2) == 0) { + if (rspamd_ftok_starts_with (&t1, &t2)) { /* * esmtp, esmtps, esmtpsa */ @@ -1440,6 +1440,7 @@ rspamd_smtp_received_parse (struct rspamd_task *task, rh->type = RSPAMD_RECEIVED_ESMTPS; rh->flags |= RSPAMD_RECEIVED_FLAG_SSL; } + continue; } else if (t1.len == t2.len + 2) { if (t1.begin[t2.len - 1] == 's' && @@ -1448,9 +1449,11 @@ rspamd_smtp_received_parse (struct rspamd_task *task, rh->flags |= RSPAMD_RECEIVED_FLAG_AUTHENTICATED; rh->flags |= RSPAMD_RECEIVED_FLAG_SSL; } + continue; } else if (t1.len == t2.len) { rh->type = RSPAMD_RECEIVED_ESMTP; + continue; } } @@ -1458,23 +1461,26 @@ rspamd_smtp_received_parse (struct rspamd_task *task, if (rspamd_ftok_cmp (&t1, &t2) == 0) { rh->type = RSPAMD_RECEIVED_LMTP; + continue; } RSPAMD_FTOK_ASSIGN (&t2, "imap"); if (rspamd_ftok_cmp (&t1, &t2) == 0) { rh->type = RSPAMD_RECEIVED_IMAP; + continue; } RSPAMD_FTOK_ASSIGN (&t2, "local"); if (rspamd_ftok_cmp (&t1, &t2) == 0) { rh->type = RSPAMD_RECEIVED_LOCAL; + continue; } RSPAMD_FTOK_ASSIGN (&t2, "http"); - if (rspamd_ftok_starts_with (&t1, &t2) == 0) { + if (rspamd_ftok_starts_with (&t1, &t2)) { if (t1.len == t2.len + 1) { if (t1.begin[t2.len] == 's') { rh->type = RSPAMD_RECEIVED_HTTP; @@ -1484,6 +1490,8 @@ rspamd_smtp_received_parse (struct rspamd_task *task, else if (t1.len == t2.len) { rh->type = RSPAMD_RECEIVED_HTTP; } + + continue; } } |