Patch to Postfix.pm to fix IPv6 address parsing

Steve Freegard steve.freegard at fsl.com
Mon Apr 20 12:03:56 IST 2009


Patrick Vande Walle wrote:
> On Mon, 20 Apr 2009 09:26:48 +0100, Julian Field
> <MailScanner at ecs.soton.ac.uk> wrote:
> 
>>> -      } elsif ($recdata =~ /^Received: .+\[([\dabcdef.:]+)\]/i) {
>>> +# Linux adds "IPv6:" on the front of the IPv6 address, so remove it
>>> +    if ($recdata =~ /^Received: .+\[(?:IPv6:)?([\dabcdef.:]+)\]/i) {
>>>           unless ($read1strcvd) {
>>>             $ipfromheader = $1;
>>>    
>> Are you sure you meant $1 and not $2 here?

(?:) is non-capturing, so $1 is correct.


More information about the MailScanner mailing list