You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Greg Troxel <gd...@lexort.com> on 2026/05/11 22:45:03 UTC

HTML_FONT_SIZE_HUGE firing on html that looks ok

Well, it's not ok to send html mail at all.  But I just got a non-spam,
actual messages from a human, that other than being html, was not at all
spammy.  The HTML_FONT_SIZE_HUGE rule fired.

The LARGE and HUGE rule is:

  body HTML_FONT_SIZE_LARGE	eval:html_range('max_size', '5', '6')
  describe HTML_FONT_SIZE_LARGE	HTML font size is large

  body HTML_FONT_SIZE_HUGE	eval:html_range('max_size', '6', 'inf')
  describe HTML_FONT_SIZE_HUGE	HTML font size is huge


I can't post the whole message, but there is

  <div dir=3D"ltr" style=3D"font-family: Aptos, Aptos_MSFontService, -apple-s=
  ystem, Roboto, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0,=
   0, 0);">

and that's 12 point type, which is hard to say how that appears on
screen, but in my book that's generous/reasonable but not large on paper,
while 10 pt is starting to be too small to read comfortably.  So I would
not flag this size as being at all unreasonable.

The rules seem to be perhaps written for some concept of font size where
0 is normal and then each increment is some step, which dimly reminds me
of that being an MS bug.

The sizes in the message are all 12pt, except that the div for my quoted
text is 11pt.

  <div class=3D"PlainText" style=3D"font-size: 11pt;">


Do other people see HTML_FONT_SIZE_HUGE on messages where it doesn't
seem to fit?



Re: HTML_FONT_SIZE_HUGE firing on html that looks ok

Posted by Bill Cole <sa...@billmail.scconsult.com>.
On 2026-05-12 at 09:53:33 UTC-0400 (Tue, 12 May 2026 15:53:33 +0200)
Matija Nalis <us...@spamassassin.apache.org>
is rumored to have said:

> Alternatively (and likely much better, now that I think of that), one
> could simply update just the rules:
>
> if (version >= 4.000000)
> body HTML_FONT_SIZE_HUGE    eval:html_range('max_size', '24', 'inf')
> endif
>
> if (version < 4.000000)
> body HTML_FONT_SIZE_HUGE    eval:html_range('max_size', '6', 'inf')
> endif

I like this better than further complicating the code determining font 
size.

I have committed a rule change in rules/20_html_tests.cf:

    108	if (version < 4.000000)
    109	  body HTML_FONT_SIZE_LARGE	eval:html_range('max_size', '5', 
'6')
    110	  describe HTML_FONT_SIZE_LARGE	HTML font size is large
    111	
    112	  body HTML_FONT_SIZE_HUGE	eval:html_range('max_size', '6', 
'inf')
    113	  describe HTML_FONT_SIZE_HUGE	HTML font size is huge
    114	endif
    115	
    116	if (version >= 4.000000)
    117	  body HTML_FONT_SIZE_LARGE	eval:html_range('max_size', '18', 
'24')
    118	  describe HTML_FONT_SIZE_LARGE	HTML font size is large
    119	
    120	  body HTML_FONT_SIZE_HUGE	eval:html_range('max_size', '24', 
'inf')
    121	  describe HTML_FONT_SIZE_HUGE	HTML font size is huge
    122	endif


# svn commit -m "Fix HTML_FONT_SIZE_HUGE to work with px (4.x) and 
web-sized (1-7) fonts. As suggested by Matija Nalis on the Users list."
Authentication realm: <https://svn.apache.org:443> ASF Committers
Password for 'billcole': ***************

Sending        rules/20_html_tests.cf
Transmitting file data .done
Committing transaction...
Committed revision 1934147.



-- 
  Bill Cole
  bill@scconsult.com or billcole@apache.org
  (AKA @grumpybozo@toad.social and many *@billmail.scconsult.com 
addresses)
  Please keep discussion mailing list replies *on-list*
  Not Currently Available For Hire

Re: HTML_FONT_SIZE_HUGE firing on html that looks ok

Posted by Matija Nalis <mn...@voyager.hr>.
On Tue, May 12, 2026 at 03:42:01PM +0200, Matija Nalis wrote:
> IMHO, the best solution would be for 4.x codebase to create separately
> named evals for 4.0.x sizes, e.g. `min_size_pt` and `max_site_pt`
> 
> and then have rules:
> 
> body HTML_FONT_SIZE_HUGE_LEGACY    eval:html_range('max_size', '6', 'inf')
> body HTML_FONT_SIZE_HUGE_PT        eval:html_range('max_size_pt', '24', 'inf')
> meta HTML_FONT_SIZE_HUGE HTML_FONT_SIZE_HUGE_LEGACY || HTML_FONT_SIZE_HUGE_PT

Alternatively (and likely much better, now that I think of that), one
could simply update just the rules:

if (version >= 4.000000)
body HTML_FONT_SIZE_HUGE    eval:html_range('max_size', '24', 'inf')
endif

if (version < 4.000000)
body HTML_FONT_SIZE_HUGE    eval:html_range('max_size', '6', 'inf')
endif


(exact version could me modified if it happened in some specific
version, but 3.6 vs 4.x is probably good enough)

> Someone should open a bugzilla issue (and mention it here, so
> interested parties may follow. I unfortunately can't do it at the
> moment)

-- 
Opinions above are GNU-copylefted.

Re: HTML_FONT_SIZE_HUGE firing on html that looks ok

Posted by Matija Nalis <mn...@voyager.hr>.
Thanks for the check, Andrew.

Armed with that knowledge, I've taken a look at differences beween SA
3.4.6 and 4.0.2, and indeed it seems that a compatibility-breaking
change was introduced (I'm guessing in order to support more modern
font sizes; but I have not dug deeply):

<   $self->{max_size} = 3;      # start at default size
<   $self->{min_size} = 3;      # start at default size
>   $self->{max_size} = 16;     # start at default size
>   $self->{min_size} = 16;     # start at default size

Using of SAME eval names to mean DIFFERENT things was unfortunate, as
that means that ANY rules using eval:html_range('max_size', ... ) or
eval:html_range('min_size', ...) will have their compatibility broken
(i.e. if they worked in 3.4 it will break in 4.0, and vice versa).

IMHO, the best solution would be for 4.x codebase to create separately
named evals for 4.0.x sizes, e.g. `min_size_pt` and `max_site_pt`

and then have rules:

body HTML_FONT_SIZE_HUGE_LEGACY    eval:html_range('max_size', '6', 'inf')
body HTML_FONT_SIZE_HUGE_PT        eval:html_range('max_size_pt', '24', 'inf')
meta HTML_FONT_SIZE_HUGE HTML_FONT_SIZE_HUGE_LEGACY || HTML_FONT_SIZE_HUGE_PT

etc.

that way official rules (and their updates) will continue to work in both SA 3.4
and post-4.0.2 (and only 4.0.0-4.0.2 would remain broken).

Someone should open a bugzilla issue (and mention it here, so
interested parties may follow. I unfortunately can't do it at the
moment)

On Tue, May 12, 2026 at 10:06:14AM +0100, Andrew C Aitchison wrote:
> 
> I can reproduce on Ubuntu 26.04 with spamassasin 4.0.2.
> 
> On Tue, 12 May 2026, Matija Nalis wrote:
> 
> > 
> > On Mon, May 11, 2026 at 09:54:23PM -0400, Greg Troxel wrote:
> > > Matija Nalis <mn...@voyager.hr> writes:
> > > 
> > > > On Mon, May 11, 2026 at 06:45:03PM -0400, Greg Troxel wrote:
> > 
> > > It's a problem because it's asserting something about the message that
> > > is not true and makes no sense.  That's a bug even if the default config
> > > only counts it for one millipoint.
> > 
> > I would agree that is a bug; but I can't reproduce your problem in my
> > environment.
> > 
> > > Thanks for pushing me to do that.  I went through and trimmed and
> > > trimmed, checking each time, and converted identifiers to dummy values.
> > > The result is super short and it still fires.
> > 
> > > But the big deal is I'm still getting HTML_FONT_SIZE_HUGE.
> > 
> > That definitely sound wrong; that example of your (while it has HTML)
> > has nothing font-related, so i wouldn't expect HTML_FONT_SIZE_HUGE to
> > trigger.
> > 
> > The HTML_FONT_SIZE_HUGE is NOT triggering on my SA 3.4.1 with your
> > ham.000 (only HTML_MESSAGE and DMARC/etc stuff is).
> > 
> > I know this might sound annoying (that is not my intention!); but are you sure that:
> > 
> > - this is really the exact file you've checking with "spamassassin -D -t" ?
> > - that something in your extra rules did not override HTML_FONT_SIZE_HUGE test?
> > 
> > 
> > >   May 11 21:50:45.236 [29438] dbg: rules: ran eval rule HTML_FONT_SIZE_HUGE ======> got hit (1)
> > > 
> > > SA 4.0.2, perl 5.42.2, NetBSD 10 amd64.  sa-update nightly: rule files
> > > have mod time of 0500 EDT today.  This setup otherwise works well.
> > 
> > 
> > Well, maybe someone with SA 4.0.2 can check how it behaves for them;
> > maybe it's a bug there (maybe only on NetBSD?)
> > 
> > If I were you, I'd:
> > 
> > - wait a little if someone can reproduce the issue with SA 4.0.2
> > 
> > - if nobody reproduces the bug, I'd setup a new NetBSD VM with
> >  completely bare SA (i.e. no custom rules / extra plugins) and try
> >  to reproduce problem there:
> > 
> >  - if you can't reproduce the bug there, there there is something in
> >    your custom setup that is broken, and you need to track it down
> >    by looking at differences to pristine SA (change by change)
> > 
> >  - however if bug is successfully reproduced in pristine NetBSD
> >    Spamassassin 4.0.2, I'd fire up my editor and start adding dbg()
> >    statements in that Mail/SpamAssassin/HTML.pm in anything
> >    mentioning "size" (i.e. sub text_style() primarily) until I found
> >    out what exactly is changing those $self->{max_size} and/or
> >    $self->{min_size})
> > 
> >    If you get to this point but don't know what to add, ask and I'll
> >    try to help.
> > 
> > -- 
> > Opinions above are GNU-copylefted.
> > 
> 
> -- 
> Andrew C. Aitchison                      Kendal, UK
>                    andrew@aitchison.me.uk

-- 
Opinions above are GNU-copylefted.

Re: HTML_FONT_SIZE_HUGE firing on html that looks ok

Posted by Vincent Lefevre <vi...@vinc17.net>.
On 2026-05-12 15:04:37 +0200, Vincent Lefevre wrote:
> On 2026-05-12 14:52:13 +0200, Vincent Lefevre wrote:
> > On 2026-05-12 14:24:47 +0200, Vincent Lefevre wrote:
> > > I can also reproduce on Debian/unstable with the
> > > spamassassin 4.0.2+svn1933012-1 Debian package.
> > 
> > If I output $value in html_range, I get 16 for the max_size test.
> > This is probably due to the fact that HTML.pm contains:
> > 
> >   $self->{max_size} = 16;       # start at default size
> > 
> > and no font sizes appear in the HTML file.
> 
> In any case, 16 will always be too large. On Debian 12 (bookworm),
> with spamassassin 4.0.1-1~deb12u1, there was
> 
>   $self->{max_size} = 3;        # start at default size
>   $self->{min_size} = 3;        # start at default size
> 
> while one now has
> 
>   $self->{max_size} = 16;       # start at default size
>   $self->{min_size} = 16;       # start at default size
> 
> Since 3 is the default (for <font size=...>), why has this been
> changed to 16?

The concerned commit is revision 1924977. Old sizes in
file lib/Mail/SpamAssassin/HTML.pm have been changed to
"font size in pixels" (whatever this means). But the rules
have not been updated: rules/20_html_tests.cf still has

body HTML_FONT_SIZE_LARGE  eval:html_range('max_size', '5', '6')
body HTML_FONT_SIZE_HUGE   eval:html_range('max_size', '6', 'inf')

i.e. refering to the old sizes as in <font size=...>.

-- 
Vincent Lefèvre <vi...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

Re: HTML_FONT_SIZE_HUGE firing on html that looks ok

Posted by Vincent Lefevre <vi...@vinc17.net>.
On 2026-05-12 14:52:13 +0200, Vincent Lefevre wrote:
> On 2026-05-12 14:24:47 +0200, Vincent Lefevre wrote:
> > I can also reproduce on Debian/unstable with the
> > spamassassin 4.0.2+svn1933012-1 Debian package.
> 
> If I output $value in html_range, I get 16 for the max_size test.
> This is probably due to the fact that HTML.pm contains:
> 
>   $self->{max_size} = 16;       # start at default size
> 
> and no font sizes appear in the HTML file.

In any case, 16 will always be too large. On Debian 12 (bookworm),
with spamassassin 4.0.1-1~deb12u1, there was

  $self->{max_size} = 3;        # start at default size
  $self->{min_size} = 3;        # start at default size

while one now has

  $self->{max_size} = 16;       # start at default size
  $self->{min_size} = 16;       # start at default size

Since 3 is the default (for <font size=...>), why has this been
changed to 16?

-- 
Vincent Lefèvre <vi...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

Re: HTML_FONT_SIZE_HUGE firing on html that looks ok

Posted by Vincent Lefevre <vi...@vinc17.net>.
On 2026-05-12 14:24:47 +0200, Vincent Lefevre wrote:
> On 2026-05-12 10:06:14 +0100, Andrew C Aitchison wrote:
> > I can reproduce on Ubuntu 26.04 with spamassasin 4.0.2.
> 
> I can also reproduce on Debian/unstable with the
> spamassassin 4.0.2+svn1933012-1 Debian package.

If I output $value in html_range, I get 16 for the max_size test.
This is probably due to the fact that HTML.pm contains:

  $self->{max_size} = 16;       # start at default size

and no font sizes appear in the HTML file.

-- 
Vincent Lefèvre <vi...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

Re: HTML_FONT_SIZE_HUGE firing on html that looks ok

Posted by Vincent Lefevre <vi...@vinc17.net>.
On 2026-05-12 10:06:14 +0100, Andrew C Aitchison wrote:
> I can reproduce on Ubuntu 26.04 with spamassasin 4.0.2.

I can also reproduce on Debian/unstable with the
spamassassin 4.0.2+svn1933012-1 Debian package.

-- 
Vincent Lefèvre <vi...@vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / Pascaline project (LIP, ENS-Lyon)

Re: HTML_FONT_SIZE_HUGE firing on html that looks ok

Posted by Andrew C Aitchison <sp...@aitchison.me.uk>.
I can reproduce on Ubuntu 26.04 with spamassasin 4.0.2.

On Tue, 12 May 2026, Matija Nalis wrote:

>
> On Mon, May 11, 2026 at 09:54:23PM -0400, Greg Troxel wrote:
>> Matija Nalis <mn...@voyager.hr> writes:
>>
>>> On Mon, May 11, 2026 at 06:45:03PM -0400, Greg Troxel wrote:
>
>> It's a problem because it's asserting something about the message that
>> is not true and makes no sense.  That's a bug even if the default config
>> only counts it for one millipoint.
>
> I would agree that is a bug; but I can't reproduce your problem in my
> environment.
>
>> Thanks for pushing me to do that.  I went through and trimmed and
>> trimmed, checking each time, and converted identifiers to dummy values.
>> The result is super short and it still fires.
>
>> But the big deal is I'm still getting HTML_FONT_SIZE_HUGE.
>
> That definitely sound wrong; that example of your (while it has HTML)
> has nothing font-related, so i wouldn't expect HTML_FONT_SIZE_HUGE to
> trigger.
>
> The HTML_FONT_SIZE_HUGE is NOT triggering on my SA 3.4.1 with your
> ham.000 (only HTML_MESSAGE and DMARC/etc stuff is).
>
> I know this might sound annoying (that is not my intention!); but are you sure that:
>
> - this is really the exact file you've checking with "spamassassin -D -t" ?
> - that something in your extra rules did not override HTML_FONT_SIZE_HUGE test?
>
>
>>   May 11 21:50:45.236 [29438] dbg: rules: ran eval rule HTML_FONT_SIZE_HUGE ======> got hit (1)
>>
>> SA 4.0.2, perl 5.42.2, NetBSD 10 amd64.  sa-update nightly: rule files
>> have mod time of 0500 EDT today.  This setup otherwise works well.
>
>
> Well, maybe someone with SA 4.0.2 can check how it behaves for them;
> maybe it's a bug there (maybe only on NetBSD?)
>
> If I were you, I'd:
>
> - wait a little if someone can reproduce the issue with SA 4.0.2
>
> - if nobody reproduces the bug, I'd setup a new NetBSD VM with
>  completely bare SA (i.e. no custom rules / extra plugins) and try
>  to reproduce problem there:
>
>  - if you can't reproduce the bug there, there there is something in
>    your custom setup that is broken, and you need to track it down
>    by looking at differences to pristine SA (change by change)
>
>  - however if bug is successfully reproduced in pristine NetBSD
>    Spamassassin 4.0.2, I'd fire up my editor and start adding dbg()
>    statements in that Mail/SpamAssassin/HTML.pm in anything
>    mentioning "size" (i.e. sub text_style() primarily) until I found
>    out what exactly is changing those $self->{max_size} and/or
>    $self->{min_size})
>
>    If you get to this point but don't know what to add, ask and I'll
>    try to help.
>
> -- 
> Opinions above are GNU-copylefted.
>

-- 
Andrew C. Aitchison                      Kendal, UK
                    andrew@aitchison.me.uk

Re: HTML_FONT_SIZE_HUGE firing on html that looks ok

Posted by Andrew C Aitchison <sp...@aitchison.me.uk>.
On Tue, 12 May 2026, Greg Troxel wrote:

> Matija Nalis <mn...@voyager.hr> writes:
>
>> The HTML_FONT_SIZE_HUGE is NOT triggering on my SA 3.4.1 with your
>> ham.000 (only HTML_MESSAGE and DMARC/etc stuff is).
>
> 3.4.1 is old and you are overdue for upgrade, but I can tell you know
> that; mentioning it for other readers.
>
>> I know this might sound annoying (that is not my intention!); but are you sure that:
>
> It's fair; I ask the same sorts of questions.
>
>> - this is really the exact file you've checking with "spamassassin -D -t" ?
>
> Really sure.  The SPF stuff showed up as I was editing and rerunning.  I
> can see the input file in the output.
>
>> - that something in your extra rules did not override HTML_FONT_SIZE_HUGE test?
>
> grepping local.cf I find nothing.   So I'm as sure as I can be.
>
>> Well, maybe someone with SA 4.0.2 can check how it behaves for them;
>> maybe it's a bug there (maybe only on NetBSD?)
>>
>> If I were you, I'd:
>>
>> - wait a little if someone can reproduce the issue with SA 4.0.2
>
> This has happened already, on Ubuntu 26.04.  Thanks Andrew!
>
>>   - however if bug is successfully reproduced in pristine NetBSD
>>     Spamassassin 4.0.2, I'd fire up my editor and start adding dbg()
>>     statements in that Mail/SpamAssassin/HTML.pm in anything
>>     mentioning "size" (i.e. sub text_style() primarily) until I found
>>     out what exactly is changing those $self->{max_size} and/or
>>     $self->{min_size})
>
> I think we have arrrived here, except it's not related to NetBSD.  And,
> so far we have zero reports of failure to repo with SA 4.0.2 on any
> platform :-)
>
> It could be related to perl 5.42.0 (just making that up).

I'm on
    This is perl 5, version 40, subversion 1 (v5.40.1) built for
    x86_64-linux-gnu-thread-multi
    (with 48 registered patches, see perl -V for more detail)

so it is a little wider than just 5.42.0

-- 
Andrew C. Aitchison                      Kendal, UK
                    andrew@aitchison.me.uk

Re: HTML_FONT_SIZE_HUGE firing on html that looks ok

Posted by Greg Troxel <gd...@lexort.com>.
Matija Nalis <mn...@voyager.hr> writes:

> The HTML_FONT_SIZE_HUGE is NOT triggering on my SA 3.4.1 with your
> ham.000 (only HTML_MESSAGE and DMARC/etc stuff is). 

3.4.1 is old and you are overdue for upgrade, but I can tell you know
that; mentioning it for other readers.

> I know this might sound annoying (that is not my intention!); but are you sure that:

It's fair; I ask the same sorts of questions.

> - this is really the exact file you've checking with "spamassassin -D -t" ?

Really sure.  The SPF stuff showed up as I was editing and rerunning.  I
can see the input file in the output.

> - that something in your extra rules did not override HTML_FONT_SIZE_HUGE test?

grepping local.cf I find nothing.   So I'm as sure as I can be.

> Well, maybe someone with SA 4.0.2 can check how it behaves for them;
> maybe it's a bug there (maybe only on NetBSD?)
>
> If I were you, I'd:
>
> - wait a little if someone can reproduce the issue with SA 4.0.2

This has happened already, on Ubuntu 26.04.  Thanks Andrew!

>   - however if bug is successfully reproduced in pristine NetBSD
>     Spamassassin 4.0.2, I'd fire up my editor and start adding dbg()
>     statements in that Mail/SpamAssassin/HTML.pm in anything
>     mentioning "size" (i.e. sub text_style() primarily) until I found
>     out what exactly is changing those $self->{max_size} and/or
>     $self->{min_size})

I think we have arrrived here, except it's not related to NetBSD.  And,
so far we have zero reports of failure to repo with SA 4.0.2 on any
platform :-)

It could be related to perl 5.42.0 (just making that up).

Your perl debugging advice appears sound.  Thanks for taking the time to
read and respond.


Re: HTML_FONT_SIZE_HUGE firing on html that looks ok

Posted by Matija Nalis <mn...@voyager.hr>.
On Mon, May 11, 2026 at 09:54:23PM -0400, Greg Troxel wrote:
> Matija Nalis <mn...@voyager.hr> writes:
> 
> > On Mon, May 11, 2026 at 06:45:03PM -0400, Greg Troxel wrote:

> It's a problem because it's asserting something about the message that
> is not true and makes no sense.  That's a bug even if the default config
> only counts it for one millipoint.

I would agree that is a bug; but I can't reproduce your problem in my
environment.

> Thanks for pushing me to do that.  I went through and trimmed and
> trimmed, checking each time, and converted identifiers to dummy values.
> The result is super short and it still fires.

> But the big deal is I'm still getting HTML_FONT_SIZE_HUGE.

That definitely sound wrong; that example of your (while it has HTML)
has nothing font-related, so i wouldn't expect HTML_FONT_SIZE_HUGE to
trigger.

The HTML_FONT_SIZE_HUGE is NOT triggering on my SA 3.4.1 with your
ham.000 (only HTML_MESSAGE and DMARC/etc stuff is). 

I know this might sound annoying (that is not my intention!); but are you sure that:

- this is really the exact file you've checking with "spamassassin -D -t" ?
- that something in your extra rules did not override HTML_FONT_SIZE_HUGE test?


>   May 11 21:50:45.236 [29438] dbg: rules: ran eval rule HTML_FONT_SIZE_HUGE ======> got hit (1)
> 
> SA 4.0.2, perl 5.42.2, NetBSD 10 amd64.  sa-update nightly: rule files
> have mod time of 0500 EDT today.  This setup otherwise works well.


Well, maybe someone with SA 4.0.2 can check how it behaves for them;
maybe it's a bug there (maybe only on NetBSD?)

If I were you, I'd:

- wait a little if someone can reproduce the issue with SA 4.0.2

- if nobody reproduces the bug, I'd setup a new NetBSD VM with
  completely bare SA (i.e. no custom rules / extra plugins) and try
  to reproduce problem there:

  - if you can't reproduce the bug there, there there is something in
    your custom setup that is broken, and you need to track it down
    by looking at differences to pristine SA (change by change)

  - however if bug is successfully reproduced in pristine NetBSD
    Spamassassin 4.0.2, I'd fire up my editor and start adding dbg()
    statements in that Mail/SpamAssassin/HTML.pm in anything
    mentioning "size" (i.e. sub text_style() primarily) until I found
    out what exactly is changing those $self->{max_size} and/or
    $self->{min_size})

    If you get to this point but don't know what to add, ask and I'll
    try to help.

-- 
Opinions above are GNU-copylefted.

Re: HTML_FONT_SIZE_HUGE firing on html that looks ok

Posted by Greg Troxel <gd...@lexort.com>.
Matija Nalis <mn...@voyager.hr> writes:

> On Mon, May 11, 2026 at 06:45:03PM -0400, Greg Troxel wrote:
>> Well, it's not ok to send html mail at all.  But I just got a non-spam,
>> actual messages from a human, that other than being html, was not at all
>> spammy.  The HTML_FONT_SIZE_HUGE rule fired.
>
> OK... and why do you think it is a problem? To wit:

I happen to score that up a bit.  That's my issue.

It's a problem because it's asserting something about the message that
is not true and makes no sense.  That's a bug even if the default config
only counts it for one millipoint.

>> I can't post the whole message, but there is
>
> Well, perhaps you should create minimal representative example then.

Thanks for pushing me to do that.  I went through and trimmed and
trimmed, checking each time, and converted identifiers to dummy values.
The result is super short and it still fires.

> At quick glance, Mail/SpamAssassin/HTML.pm (at least in 3.4.6 version
> of SA) does not trigger on CSS style "font-size: *pt" at all, but
> e.g. on (deprecated) HTML "<font size=*>" which is totally different
> metric from "pt", and can range from 1 to 7 (with 3 being "default text size").

Ah, that's what I semi-remember.  Thanks for the doc pointer.

I have attached my "hample" at end as application/octet-stream so it
will arrive unmunged.

Rerunning with -t, I get the following output:

  Content analysis details:   (5.5 points, 1.0 required)

   pts rule name              description
  ---- ---------------------- --------------------------------------------------
  -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/, no
                              trust
                              [2607:f8b0:4864:20:0:0:0:1133 listed in]
                              [list.dnswl.org]
   1.9 SPF_FAIL               SPF: sender does not match SPF record (fail)
                              [SPF failed: Rejected by SPF record.]
   0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
   0.1 MSGID_PROD_OUTLOOK     Message-Id from prod.outlook.com
   1.0 HTML_FONT_SIZE_HUGE    BODY: HTML font size is huge
   0.1 HTML_MESSAGE           BODY: HTML included in message
   1.8 DMARC_REJECT           DMARC reject policy
   0.6 TXREP                  TXREP: Score normalizing based on sender's reputation

The SPF and DMARC are because I've messed with identifiers, so we should
ignore that.

MSGID_PROD_OUTLOOK is a personal meta-rule building block.
TXREP, well I've been messing with it.

But the big deal is I'm still getting HTML_FONT_SIZE_HUGE.

In the stderr with -D

  May 11 21:50:45.236 [29438] dbg: rules: ran eval rule HTML_FONT_SIZE_HUGE ======> got hit (1)


SA 4.0.2, perl 5.42.2, NetBSD 10 amd64.  sa-update nightly: rule files
have mod time of 0500 EDT today.  This setup otherwise works well.


Re: HTML_FONT_SIZE_HUGE firing on html that looks ok

Posted by Matija Nalis <mn...@voyager.hr>.
On Mon, May 11, 2026 at 06:45:03PM -0400, Greg Troxel wrote:
> Well, it's not ok to send html mail at all.  But I just got a non-spam,
> actual messages from a human, that other than being html, was not at all
> spammy.  The HTML_FONT_SIZE_HUGE rule fired.

OK... and why do you think it is a problem? To wit:

% egrep -hr 'score.* HTML_FONT_SIZE_' /var/lib/spamassassin
score HTML_FONT_SIZE_HUGE 0.001
score HTML_FONT_SIZE_LARGE 0.001

IOW, those are NOT spam indicators at all. There are just there so
you can construct other meta-rules...


> I can't post the whole message, but there is

Well, perhaps you should create minimal representative example then.

>   <div dir=3D"ltr" style=3D"font-family: Aptos, Aptos_MSFontService, -apple-s=
>   ystem, Roboto, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0,=
>    0, 0);">
> 

At quick glance, Mail/SpamAssassin/HTML.pm (at least in 3.4.6 version
of SA) does not trigger on CSS style "font-size: *pt" at all, but
e.g. on (deprecated) HTML "<font size=*>" which is totally different
metric from "pt", and can range from 1 to 7 (with 3 being "default text size").

i.e. https://www.w3docs.com/learn-html/html-font-tag.html

You should probably try to trim your original mail until you find out
what HTML tags are actually triggering that rule and why.

> Do other people see HTML_FONT_SIZE_HUGE on messages where it doesn't
> seem to fit?

No... When I do get it, it seems to be mostly on spammy HTML emails
(but most HTML I get is spam anyway, as I opt out of HTML whenever possible).

-- 
Opinions above are GNU-copylefted.