You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Matt Anton via users <us...@spamassassin.apache.org> on 2023/01/09 01:34:58 UTC

TxRep records unreliably on MySQL

Hello list,

After an upgrade to SA-4.0.0 I decided to give TxRep a try after using 
AWL since it was introduced.
I set up TxRep accordingly to SA’s documentation with a mysql-5.7.40 
server, give it a first try by sending an email to the box where SA is 
running and saw TxRep just has recorded unreliably onto the sql table:

#v+
root@localhost [spamassassin]> describe txrep;
+----------+--------------+------+-----+-------------------+-----------------------------+
| Field    | Type         | Null | Key | Default           | Extra       
                 |
+----------+--------------+------+-----+-------------------+-----------------------------+
| username | varchar(100) | NO   | PRI |                   |             
                 |
| email    | varchar(255) | NO   | PRI |                   |             
                 |
| ip       | varchar(40)  | NO   | PRI |                   |             
                 |
| msgcount | int(11)      | NO   |     | 0                 |             
                 |
| totscore | float        | NO   |     | 0                 |             
                 |
| signedby | varchar(255) | NO   | PRI |                   |             
                 |
| last_hit | timestamp    | NO   | MUL | CURRENT_TIMESTAMP | on update 
CURRENT_TIMESTAMP |
+----------+--------------+------+-----+-------------------+-----------------------------+
7 rows in set (0,00 sec)

root@localhost [spamassassin]> select * from txrep;
+----------+-------------------------------------------------------+------+----------+----------+------------+---------------------+
| username | email                                                 | ip  
  | msgcount | totscore | signedby   | last_hit            |
+----------+-------------------------------------------------------+------+----------+----------+------------+---------------------+
| vscan    | 209.85.218.51                                         | 
none |        1 |   -0.217 |            | 2023-01-09 01:25:46 |
| vscan    | aac3c57398484c78fd317abe6061e81c4b9296f2@sa_generated | 
none |        1 |   -0.217 | 1673223945 | 2023-01-09 01:25:46 |
| vscan    | gmail.com                                             | 
none |        1 |   -0.217 | gmail.com  | 2023-01-09 01:25:46 |
| vscan    | mail-ej1-f51.google.com                               | 
none |        1 |   -0.217 | helo       | 2023-01-09 01:25:46 |
| vscan    | user@gmail.com                                        | 
none |        1 |   -0.217 | gmail.com  | 2023-01-09 01:25:46 |
+----------+-------------------------------------------------------+------+----------+----------+------------+---------------------+
5 rows in set (0,00 sec)
#v-

Anyone can tell me how the hell it is logging for example: an address in 
the email column or garbage on the signedby table?

SQL statements used to create txrep table is the one supplied by 
SA-4.0.0 (beside table’s name, this is the same as ones AWL need).

The following TxRep settings were been used in the global local.cf:

#v+
use_txrep 1
txrep_ipv4_mask_len 32
txrep_ipv6_mask_len 128
auto_welcomelist_distinguish_signed 1
txrep_spf 1
#v-

Cheers,

-- 
matt [at] lv223.org
GPG key ID: 7D91A8CA

Re: TxRep records unreliably on MySQL

Posted by Matt Anton via users <us...@spamassassin.apache.org>.
Le Mon, 09 Jan 2023 08:59:39 -0500,
Greg Troxel <gd...@lexort.com> a écrit :

> The perl source code for TxRep.  On my system:
> 
>   /usr/pkg/lib/perl5/vendor_perl/5.36.0/Mail/SpamAssassin/Plugin/TxRep.pm

Well, as my perl skills-fu are near 0, I'll stick to AWL as it is
working as it should since nearly a decade now.
TxRep on the paper brings neat ideas but if it requires me to a perl
guru to fix its code, its a no go.

> Maybe it should; someone has to read the code and figure this out.  I
> sort of intend to at some point, but haven't.

As you said, this plugin is not 100% baked as of now.

Cheers,

-- 
matt [at] lv223.org
GPG key ID: 7D91A8CA


Re: TxRep records unreliably on MySQL

Posted by Greg Troxel <gd...@lexort.com>.
"Matt Anton via users" <us...@spamassassin.apache.org> writes:

> Here's what I'm having on the SQL spamassassin db:
>
> <https://pastebin.com/raw/pxxYwVgG>

Thanks, much easier!

>> 1) txrep seems not 100% baked.   I suggest reading the code to see how
>> this happened.
>
> What code are you talking about?

The perl source code for TxRep.  On my system:

  /usr/pkg/lib/perl5/vendor_perl/5.36.0/Mail/SpamAssassin/Plugin/TxRep.pm

>> 2) txrep with bdb only has keys and values and it does overload the
>> key for address and name.  So perhaps this is incompletey moving to
>> the more complicated scheme.
>
> And there you completely lost me ;)
> I naively thought TxRep would record in a same way that AWL did (sql
> schema for both plugins are the same).

Maybe it should; someone has to read the code and figure this out.  I
sort of intend to at some point, but haven't.

Re: TxRep records unreliably on MySQL

Posted by Matt Anton via users <us...@spamassassin.apache.org>.
Hi Greg,

Le Mon, 09 Jan 2023 08:09:06 -0500,
Greg Troxel <gd...@lexort.com> a écrit :

> Your mail was miswrapped and thus hard to read.

Thanks for your reply.
Yeh the flowed mangled lines endings my bad and probably.

Here's what I'm having on the SQL spamassassin db:

<https://pastebin.com/raw/pxxYwVgG>

> 1) txrep seems not 100% baked.   I suggest reading the code to see how
> this happened.

What code are you talking about?

> 2) txrep with bdb only has keys and values and it does overload the
> key for address and name.  So perhaps this is incompletey moving to
> the more complicated scheme.

And there you completely lost me ;)
I naively thought TxRep would record in a same way that AWL did (sql
schema for both plugins are the same).

-- 
matt [at] lv223.org
GPG key ID: 7D91A8CA


Re: TxRep records unreliably on MySQL

Posted by Greg Troxel <gd...@lexort.com>.
"Matt Anton via users" <us...@spamassassin.apache.org> writes:

> After an upgrade to SA-4.0.0 I decided to give TxRep a try after using 
> AWL since it was introduced.
> I set up TxRep accordingly to SA’s documentation with a mysql-5.7.40 
> server, give it a first try by sending an email to the box where SA is 
> running and saw TxRep just has recorded unreliably onto the sql table:

Your mail was miswrapped and thus hard to read.

1) txrep seems not 100% baked.   I suggest reading the code to see how
this happened.

2) txrep with bdb only has keys and values and it does overload the key
for address and name.  So perhaps this is incompletey moving to the more
complicated scheme.