I was trying to add an entry to my database using fuzzy-find and the digest reported in the debugging log output.
% fuzzy-find --learn-spam --score=10 265236:171:518:256::8:4:4:5:29022::19:4:28:11:26214::28:20:9:21:20377::17:41:10:30:5039::247:210:219:222:358::83:74:80:77:344
The command would add an entry to the database, but it would not be found when I ran spamassassin again.
I think the problem is that $key is not initialized when providing the digest on the command-line. The following patch fixed the issue for me:
-
bin/fuzzy-find
| old |
new |
|
| 117 | 117 | while (@ARGV) { |
|---|
| 118 | 118 | my $file = shift @ARGV; |
|---|
| 119 | 119 | my @data = (); |
|---|
| 120 | | if ($file =~ m/(\d+):(\d+):(\d+):(\d+)/) { |
|---|
| | 120 | my $key = ''; |
|---|
| | 121 | if ($file =~ m/(\d+):(\d+):(\d+):(\d+)::(.*)/) { |
|---|
| | 122 | push @data, $1,$2,$3,$4; |
|---|
| | 123 | $key = $5; |
|---|
| | 124 | } |
|---|
| | 125 | elsif ($file =~ m/(\d+):(\d+):(\d+):(\d+)/) { |
|---|
| 121 | 126 | push @data, $1,$2,$3,$4; |
|---|
| 122 | 127 | } elsif ($file eq ':::0') { |
|---|
| 123 | 128 | $key = $file; |
| … | … | |
| 125 | 130 | } else { |
|---|
| 126 | 131 | next unless -r $file; |
|---|
| 127 | 132 | } |
|---|
| 128 | | my $key = ''; |
|---|
| 129 | 133 | my $ctype = ''; |
|---|
| 130 | 134 | my $ftype = 0; |
|---|
| 131 | 135 | unless (@data) { |