"Block e-mail containing this word" not working

Strator

Verified User
Joined
Jan 19, 2011
Messages
239
Hi,

I am using DirectAdmin's "Block e-mail containing this word" function to filter out certain obnoxious messages or newsletters that cannot be unsubscribed. Works perfectly for me, except that I have a certain message from ebay that keeps coming through although I have quadruple-checked that the words from my filter do match the text in the mail.

Are there known scenarios where the filter fails? Is there a max. length of text the filter will scan? The trigger text is outside of the first 20,000 characters in the mail - might that be the culprit? Thanks!
 
Hello,

Did you check an original text of email? A word can be encoded and it won't be found by a system filter in this case.
 
Yes, I checked the source code and even copied and pasted the search text, just to be on the safe side. Remains a mystery.
 
Nothing out of the ordinary, I'm afraid. Only the plain letters of the words I intend to block, just like the other filters that do actually work.

The reason I'm suspecting a max. length being hardcoded somewhere is that it wouldn't be the first time. For years I've been trying to get spamassassin to scan mails >500k (partly with your help) until I finally gave up. As much as I love DA, it seems that might be a problem with this particular setup.
 
It's a domain filter and has nothing to do with SpamAssassin actually.

Code:
domain_filter:
  driver = redirect
  allow_filter
  no_check_local_user
  condition = "${if exists{/etc/virtual/${domain}/filter}{yes}{no}}"
  user = "${lookup{$domain}lsearch{/etc/virtual/domainowners}{$value}}"
  group = "mail"
  file = /etc/virtual/${domain}/filter
  directory_transport = address_file
  pipe_transport = virtual_address_pipe
  retry_use_local_part
  no_verify

there is no limit on a message size at least in exim.conf. It's a primitive simple.

Try and add debug or/and log writing into domain_filter​ and see whether the email is checked at all.
 
Well, the reason for my reminiscences of the spamassassin threshold is that the situation seems oddly familiar: on the surface, there shouldn't have been a problem (in that case, there was a setting to control it), but in the end it turned out the issue was hardcoded somewhere else, probably in exim (althought that remains speculation).

In this case, I've decided to filter through a keyphrase in the mail title instead - unfortunately, it's less distinctive, but I hope it'll do the trick. Maybe over time, someone else will run into the same problem (probably my future me?) and dig up this thread. For now, thank you for your time and help!
 
As expected, my future me bumped into this thread and noticed that certain non-English characters (like German umlauts) will break the filter. Since I'm assuming there will be similar problems with other languages, I consider this a major disfunctionality.

As icing on the cake, it would be great if the filter would ignore line breaks. When you try to filter for certain phrases, it makes no sense that the filter ignores those phrases just because they happen to be spread over two lines.
 
German umlauts as well as Russian Cyrillic might be encoded or represented differently. Then a body of an email can be base64 encoded, quoted-printable


-
Content-Transfer-Encoding: base64
- Content-Transfer-Encoding: quoted-printable
- Content-Transfer-Encoding: 8bit
- Content-Transfer-Encoding: 7bit
- Content-Transfer-Encoding: binary

Filters might not work with anything different from 7bit, 8bit.

https://www.w3.org/Protocols/rfc1341/5_Content-Transfer-Encoding.html


Please correct me anybody if I'm wrong.
 
...which makes me wonder if this would work with html codes or some other approach. I mean we are a species that can build spaceships, too. Nothing is impossible. :)
 
Back
Top