#680619 nullmailer: dpkg-reconfigure corrupts IPv6 zone index in "remotes"

Package:
nullmailer
Source:
nullmailer
Description:
simple relay-only mail transport agent
Submitter:
Nick Leverton
Date:
2023-06-28 15:57:03 UTC
Severity:
normal
Tags:
#680619#5
Date:
2012-07-07 12:33:30 UTC
From:
To:
Nullmailer now supports IPv6 and the Debian packages allows IPv6 literals
in debconf by wrapping them in [ ].

However the maintainer scripts don't cope with IPv6 link-local address
literals having a zone index such as [fe80:5054:ff:fef4:ef81%eth1] which
(in this example) gets corrupted to just "1 e".

Nick

#680619#16
Date:
2022-11-06 15:36:34 UTC
From:
To:
Same behavior happens with passwords: scripts strip square brackets from them too, regardless of the smarthost being an IPv6 address or anything else.
#680619#21
Date:
2023-06-09 17:27:50 UTC
From:
To:
Pretty sure the following contraption in the postinst script is responsible:

Unfortunately I am not completely sure what happens here (and what could
possibly removed or fixed).

Jörg

#680619#26
Date:
2023-06-28 08:54:24 UTC
From:
To:
Pretty sure this also affects passwords with special characters.  I'm not sure what problem the postinst script is trying to solve.
#680619#31
Date:
2023-06-28 15:53:29 UTC
From:
To:
Jay <j__n@yahoo.com> writes:

        This is a colon-separated list of remote servers to which to send each
        message. Each entry contains a remote host name or address followed by
        an optional protocol string 'host protocol'. The protocol name defaults
        to smtp, and may be followed by command-line arguments for that module.
        .
        Examples:
        .
          smarthost
          smarthost smtp --port=10025
          mail.example.com smtp --user=foo --pass=bar
          192.168.1.254 qmqp
          [fe80::5054:ff:fef4:ef81] smtp

Into a syntax compatible with /etc/nullmailer/remotes
(see remotes(5)).

I didn't write that sed snippet, but I guess the intent is to stick to
posix tools to minimized dependencies.

I suspect part of the answer is not to use : as an input separator.
Apparently debconf can handle multiline strings directly using
"debconf-escape", so maybe that can replace the broken sed.