[Rspamd-Users] Remove symbol / weight problem

Jesse Norell jesse at kci.net
Mon May 24 15:20:35 UTC 2021


On Fri, 2021-05-21 at 11:08 -0700, Gregory Sloop wrote:
> So, I have 7z defined with a large weight in bad_extensions = 40, I
> think.
> Then I have these defs (along with other unrelated defs)
> 
> I'll explain what this does. It identifies if the mail is 
> from joe at sixpax.com, and 
> to sally at halfrax.com, and 
> if it's got an attchment with a .7z extension.
> 
> Finally the last combo checks that all those symbols exist (are
> active? I'm not sure the correct terminology) along with
> MIME_BAD_EXTENSION" and it unsets the score and symbol of
> MIME_BAD_EXTENSION.
> 
> However, when I process a message using the rspamd UI in the
> "scan/learn" tab, I see that all those symbols are there, but
> MIME_BAD_EXTENSION doesn't get unset.
> 
> ---
> awl_some.sender_sender {
> 	type = "from";
> 	filter = "from(smtp)";
> 	map =  ["joe at sixpax.com"];
> }
> 
> 
> awl_other.recipient_recipient {
> 	type = "rcpt";
> 	filter = "email:addr";
> 	map =  ["sally at halfrax.com"];
> }
> 
> awl_filetype_7z {
> 	type = "filename";
> 	filter = "extension";
> 	map =  ["7z"];
> }
> 
> 
> awl_allow_through {
> 	expression = "awl_some.sender_sender &
> awl_other.recipient_recipient & awl_filetype_7z &
> ^MIME_BAD_EXTENSION";
> }
> 
> ---
> Following is an output of those symbols from the scan/learn symbols
> output.
> 
> ---
> MIME_BAD_EXTENSION (80) [7z,pdf]
> awl_filetype_7z (0) [7z]
> awl_some.sender_sender (0) [joe at sixpax.com]
> awl_other.recipient_recipient (0) [sally at halfrax.com]
> 
> ---
> 
> I've tried a number of different things, but nothing seems to work as
> I'd expect.
> Any pointers at what I'm doing wrong?
> 
> TIA


Just a couple thoughts, awl_allow_through is defined in
local.d/composites.conf (and the other rules are not)?  Your expression
uses '&' where the examples use '|', maybe try that?  Eg.

awl_allow_through {
        expression = "(awl_some.sender_sender &
awl_other.recipient_recipient & awl_filetype_7z) |
^MIME_BAD_EXTENSION";
}

-- 
Jesse Norell




More information about the Users mailing list