• Omar Polo [2023-12-14 23:33]:
> On 2023/12/14 21:36:44 +0100, Kirill Miazine <[email protected]> wrote:
> > [...]
> > cvs checkout took looong time, so I took src.tar.gz from 7.4, applied
> > patch there.
> >
> > diff worked for static maps, at least. tested on this config:
>
> thanks for testing the diff
>
> > [...]
> >
> > but didn't work with "table helo-names file:/etc/mail/helo-names",
> > however, which contained:
> >
> > 127.0.0.1 localhost1
> > ::1 localhost2
> > [::1] localhost3
> > ipv6:::1 localhost4
>
> Unfortunately this is expected,
You mentioned that you didn't think makemap as-is supports ipv6
addresses, but that diff should at least fix the usage in other tables,
so I gave plain file-based tables a try, too.
> see table_static.c around line 172. File tables are split on ":" too
> so "::1 localhost2" becomes "" -> ":1 localhost2"
>
> It's not clearly documented, but table(5) says
>
> : A file table can be converted to a Berkeley database using the makemap(8)
> : utility with no syntax change.
>
> and makemap(8) then specifies
>
> : The database key and value may optionally be separated by the colon
> : character.
>
> It sucks, it should be documented in table(5) too at least. (and even
> then, I'm failing to see the value of splitting on : too given that it
> breaks ipv6 addresses.)
Yup, I noticed that too, and mentioned in my original email.
Until being bitten by the bug, I was sure that keys and values in
a file based table are separated by spaces:
A mapping will be written with each key and value on a line,
whitespaces separating both columns.
Actually, here table(5) also contradicts with aliases(5):
In a primary domain context, the key is the user part of the
recipient address, whilst the value is one or many recipients as described
in
aliases(5):
user1 otheruser
user2 otheruser1,otheruser2
user3 [email protected]
No colons... But in aliases(5)
Within the file, ‘#’ is a comment delimiter; anything placed after it is
discarded. The file consists of key/value mappings of the form:
key: value1, value2, value3, ...
Default /etc/aliases has colons, so colon can't be removed for aliases
easily...
> After a closer look I noticed that there might be something wrong with
> my diff, tracing table_static_priv_add() i noticed a weird 'pattern':
>
> : adding [fe80::fce1:baff:fed3:6e35%tap0] -> (null)
> : adding [[fe80::fce1:baff:fed3:6e35%tap0]] -> (null)
> : adding [ipv6:[fe80::fce1:baff:fed3:6e35%tap0]] -> (null)
>
> that I'm not sure was present also before, so I'll have to take a closer
> look.
>
--
-- Kirill Miazine <[email protected]>