Since a couple of days I'm receiving a lot of spam without a body. Unfortunately it isn't filtered by the maildroprc rules below. A X-Spam-Flag: YES header is present but maildrop doesn't seem to be able to process messages without a body. "Message 1" below is NOT filtered correctly. "Message 2" and "Message 3" are filtered correctly.
I'm using maildrop 2.7.1 (Debian Jessie). The issue exists since commit e0a0a6eba9f31aea09624b3ea21fb75107c96780. Reverting this commit solved the issue. But that's obviously not what I want to do.
Since a couple of days I'm receiving a lot of spam without a body. Unfortunately it isn't filtered by the maildroprc rules below. A
X-Spam-Flag: YES
header is present but maildrop doesn't seem to be able to process messages without a body. "Message 1" below is NOT filtered correctly. "Message 2" and "Message 3" are filtered correctly.I'm using maildrop 2.7.1 (Debian Jessie). The issue exists since commit e0a0a6eba9f31aea09624b3ea21fb75107c96780. Reverting this commit solved the issue. But that's obviously not what I want to do.
I've been debugging for a while, but the lack of knowledge holds me from finding the issue and a proper solution (or a patch that already fixed the issue). What I've found out is that
rfc2045_decodemsgtoutf8()
is called fromsearch.C
(https://github.com/svarshavchik/courier-libs/blob/master/maildrop/search.C#L216). After thatrfc2045header_get()
is called (https://github.com/svarshavchik/courier-libs/blob/master/rfc2045/rfc2045decodemsgtoutf8.c#L125). And thenrfc2045header_get()
returns(0)
becausec == -1
in case of "Message 1" (https://github.com/svarshavchik/courier-libs/blob/master/rfc2045/rfc2045header.c#L180). Thatif
statement isfalse
in case of "Message 2" and "Message 3".How to solve this? :confused:
RFC2822 says a body is optional:
maildroprc
Message 1 (isn't filtered to $DEFAULT/.Spam)
Message 2 (note the extra line at the end)
Message 3