fastmail / mail-dkim

Mail::DKIM Perl module, forked from svn://svn.code.sf.net/p/dkimproxy/code/Mail-DKIM/trunk
8 stars 6 forks source link

Argument "1.20200513.1" isn't numeric #8

Closed riesebie closed 4 years ago

riesebie commented 4 years ago

Running /usr/bin/sa-learn --sync via a cronjob of amavisd-new complains about wrong arguments:

Argument "1.20200513.1" isn't numeric in numeric ge (>=) at /usr/share/perl5/Mail/SpamAssassin/Plugin/DKIM.pm line 686.

Argument "1.20200513.1" isn't numeric in numeric ge (>=) at /usr/share/perl5/Mail/SpamAssassin/Plugin/DKIM.pm line 809.

This seems to be caused by the new versioning of libmail-dkim-perl.

realsimix commented 4 years ago

Maybe the second dot could just be removed to make a numeric version check possible again?

gregoa commented 4 years ago

I believe that "1.20200513.1" is a perfectly valid version string, and that the SpamAssassin plugin shouldn't do a numerical comparsion on it. (Of course I also won't complain if it's changed :))

riesebie commented 4 years ago

What is the story behind changing the version numbering?

realsimix commented 4 years ago

Sure, "1.20200513.1" is a valid version string just like "aa.bb.cc" would also be valid. Only problem is that it breaks other applications using it.

Now, let's have a look at how mail-dkim itself does version checks in Mail-DKIM-1.20200513.1/lib/Mail/DKIM/PublicKey.pm:

            # join with no intervening spaces, RFC 6376
            if ( Net::DNS->VERSION >= 0.69 ) {

                # must call txtdata() in a list context
                $strn = join '', $rr->txtdata;
            }

It does an arithmetic version check, like dozens of other perl programs do. That's why you may call the version string valid, but I won't call it perfect :-1:

marcbradshaw commented 4 years ago

This was added to make it easier to have multiple releases on a single day, that said, I have no strong attachment to it.