Victor Duchovni:
> On Thu, Feb 24, 2011 at 05:55:05PM -0500, Gurusamy Sarathy wrote:
> 
> > Sorry, didn't mean to suggest it is a missing feature--it does look
> > like a bug to me.  The documented form doesn't work.
> > 
> > Feb 23 10:32:46 vm-rhes5-01 postfix/smtp[1062]: fatal: valid hostname or 
> > network address required in server description: 
> > [IPv6:fe80::250:56ff:fe82:54b5]
> 
> Yep, indeed host_port() seems to pass "ipv6:..." to valid_hostaddr(),
> which calls valid_ipv6_hostaddr(), which is not prepared for the
> "ipv6:" prefix.
> 
> Perhaps the call to valid_hostaddr() should be replaced by a call to
> valid_mailhost_addr(), and the result used to update the "bare" host
> address returned from host_port().
> 
> Perhaps the simpler patch below will do the job. Please drop the list
> a note when you have checked whether this also solves the problem.
> 
> Index: src/util/host_port.c
> *** src/util/host_port.c      6 Feb 2010 07:35:12 -0000       1.1.1.1
> --- src/util/host_port.c      25 Feb 2011 05:57:57 -0000
> ***************
> *** 136,142 ****
>        * network addresses instead of requiring proper [ipaddress] forms.
>        */
>       if (*host != def_host && !valid_hostname(*host, DONT_GRIPE)
> !     && !valid_hostaddr(*host, DONT_GRIPE))
>       return ("valid hostname or network address required");
>       if (*port != def_service && ISDIGIT(**port) && !alldig(*port))
>       return ("garbage after numerical service");
> --- 136,142 ----
>        * network addresses instead of requiring proper [ipaddress] forms.
>        */
>       if (*host != def_host && !valid_hostname(*host, DONT_GRIPE)
> !     && (*host = valid_mailhost_addr(*host, DONT_GRIPE)) == 0)

The IPV6: prefix is required in "SMTP email" context but not
elsewhere.

The practical solution is to strip the IPV6: prefix if it exists,
while allowing address forms without IPV6: to avoid breaking existing
configurations.

        Wietse

Reply via email to