Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible regression: "NettAddr::IP IPv4-mapped IPv6 address expected (EInvalidOptionValue)" #22

Closed
GWHAYWOOD opened this issue Aug 13, 2024 · 7 comments · Fixed by #23
Closed

Comments

@GWHAYWOOD
Copy link

Sample exception handler output when "redirect" or "include" leads to a record containing a "ptr:" mechanism:

Aug 9 16:38:04 mail6 x3[5932]:
xm_write_log(): xm_die_handler(978):
[NetAddr::IP IPv4-mapped IPv6 address expected (EInvalidOptionValue)
at /usr/local/share/perl/5.32.1/Mail/SPF/Util.pm line 128.],
[[email protected]],
[66.163.191.21]

This is I believe the result of calling

Mail::SPF::Request->new(
versions => [1],
scope => 'mfrom',
identity => '[email protected]',
ip_address => '66.163.191.21',
helo_identity => 'sonic328-46.consmr.mail.ne1.yahoo.com',
);

although as you will appreciate most of the values are held in assorted Perl variables.

@bigio
Copy link
Contributor

bigio commented Aug 23, 2024

Unfortunately I cannot reproduce the issue with the above code/data.
Could you provide more info to reproduce the issue ? Thanks.

@GWHAYWOOD
Copy link
Author

Thanks for trying. I'll see what I can do.

@GWHAYWOOD
Copy link
Author

Ah. My belief was mistaken. I think I have led you up the garden path, for which I apologize.

The request object is indeed created in the code

my $spf_request_object = eval { Mail::SPF::Request->new(...) };

using the data given in my OP, but the exception actually occurs on this call

my $spf_result_object = $spf_server_object->process($spf_request_object);

The request object to be processed was created by the preceding call to Mail::SPF::Request->new(...).

I'm very sorry if I've wasted your time. :(

Will you need to know more about the creation of $spf_server_object to investigate this?

@bigio
Copy link
Contributor

bigio commented Aug 23, 2024

The sample I am using to test is:

use Mail::SPF;

my $s = eval { Mail::SPF::Server->new(); };
my $r = Mail::SPF::Request->new(
versions => [1],
scope => 'mfrom',
identity => '[email protected]',
ip_address => '66.163.191.21',
helo_identity => 'sonic328-46.consmr.mail.ne1.yahoo.com',
);
print $s->process($r);

Maybe the initialization is different.

@GWHAYWOOD
Copy link
Author

I have taken an axe to my code to create from it a test harness to try to reproduce the exceptions.

This is on the same machine, so it uses exactly the same perl and the same modules.

So far, I too have failed to reproduce the issue.

I will continue to investigate but for now the ball is firmly back in my court.

Thank you for your patience.

@GWHAYWOOD
Copy link
Author

Oh, rats. I clean forgot to hook the handler...

$ cat test_spf_object.pl
#!/usr/bin/perl
use Net::DNS;
use Mail::SPF;
sub xm_DIE_handler { print "$_[0]\n"; }
$SIG{DIE} = &xm_DIE_handler;
my $spf_server_object = Mail::SPF::Server->new();
my $spf_request_object = Mail::SPF::Request->new( versions => [1], scope => 'mfrom', identity => '[email protected]', ip_address => '66.163.191.21' );
my $spf_result_object = $spf_server_object->process($spf_request_object);

$ ./test_spf_object.pl
neutral-by-default (Default neutral result due to no mechanism matches)
NetAddr::IP IPv4-mapped IPv6 address expected (EInvalidOptionValue) at /usr/local/share/perl/5.32.1/Mail/SPF/Util.pm line 128.

pass (Mechanism 'ptr:yahoo.com' matched)
pass (Mechanism 'ptr:yahoo.com' matched)
pass (Mechanism 'ptr:yahoo.com' matched)
pass (Mechanism 'ptr:yahoo.com' matched)
pass (Mechanism 'ptr:yahoo.com' matched)
$

@GWHAYWOOD
Copy link
Author

Thank you, github, for bowdlerizing my code again.

Let's try with triple backticks:

$ cat test_spf_object.pl
#!/usr/bin/perl
use Net::DNS;
use Mail::SPF;
sub xm_DIE_handler { print "$_[0]\n"; }
$SIG{__DIE__} = \&xm_DIE_handler;
my $spf_server_object = Mail::SPF::Server->new();
my $spf_request_object = Mail::SPF::Request->new( versions => [1], scope => 'mfrom', identity => '[email protected]', ip_address => '66.163.191.21' );
my $spf_result_object = $spf_server_object->process($spf_request_object);

$ ./test_spf_object.pl
neutral-by-default (Default neutral result due to no mechanism matches)
NetAddr::IP IPv4-mapped IPv6 address expected (EInvalidOptionValue) at /usr/local/share/perl/5.32.1/Mail/SPF/Util.pm line 128.

pass (Mechanism 'ptr:yahoo.com' matched)
pass (Mechanism 'ptr:yahoo.com' matched)
pass (Mechanism 'ptr:yahoo.com' matched)
pass (Mechanism 'ptr:yahoo.com' matched)
pass (Mechanism 'ptr:yahoo.com' matched)
$

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants