Greylist issues with IPv6

Bugs in eFa 4
Post Reply
glemme
Posts: 2
Joined: 05 Aug 2020 02:42

Greylist issues with IPv6

Post by glemme »

Somehow greylisting does not work properly when running IPv6.

the sending server is acting correctly and tries to resubmit the message but still keeps on being greylisted.

Have disabled IPv6 for now to solve it. But would like to have it on and still have grey listing working.
glemme
Posts: 2
Joined: 05 Aug 2020 02:42

Re: Greylist issues with IPv6

Post by glemme »

And to follow up on myself.

I tried whitelisting IPv6 senders. But still ended up in greylist.
hunter-nl
Posts: 9
Joined: 02 Apr 2014 10:07

Re: Greylist issues with IPv6

Post by hunter-nl »

This is because the used ipv6 non EUI64 addresses the mailservers using. Like google mailservers uses many many many unique non EUI64 ipv6 addresses. And then it takes a very long time to get through the greylisting...

You can patch this by change the following function in /usr/sbin/sqlgrey

Code: Select all

sub ipv6_smart($) {
    my $addr = ipv6_normalise(shift);
    if (ipv6_is_eui64($addr) and ipv6_is_global_unicast($addr)) {
        ## For EUI64 return just the prefix/64
        return join(":", (split(/:/, $addr))[0..3]);
    } else {
        ## For Non-EUI64 or Non-Global-Unicast return the address
        return $addr;
    }
}
Into (see the else section for the difference ;) )

Code: Select all

sub ipv6_smart($) {
    my $addr = ipv6_normalise(shift);
    if (ipv6_is_eui64($addr) and ipv6_is_global_unicast($addr)) {
        ## For EUI64 return just the prefix/64
        return join(":", (split(/:/, $addr))[0..3]);
    } else {
        ## For Non-EUI64 or Non-Global-Unicast return the address
        #return $addr;
        return join(":", (split(/:/, $addr))[0..3]);
    }
}
It will now whitelist IPv6 /64 prefixes instead of each unique non EUI64 ipv6 /128 address.
User avatar
pdwalker
Posts: 1553
Joined: 18 Mar 2015 09:16

Re: Greylist issues with IPv6

Post by pdwalker »

shawniverson, is this a change that should be pushed up to the sqlgrey folks?
User avatar
shawniverson
Posts: 3649
Joined: 13 Jan 2014 23:30
Location: Indianapolis, Indiana USA
Contact:

Re: Greylist issues with IPv6

Post by shawniverson »

Post Reply