Re: Porting MailDrop to Alpine

Bengt Thuree <[email protected]> Wed, 21 Jun 2023 16:13:28 +1000
Newsgroups gmane.mail.maildrop
Message-ID <CAB8vGXb+L3D56cD6N9XkPPA7PKQVaS6AqUP-O5pYxrGU4j2-4w@mail.gmail.com>
--===============1149565440249251824==
Content-Type: multipart/alternative; boundary="00000000000029af9d05fe9dab04"

--00000000000029af9d05fe9dab04
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hmmm
Looks like iconv implementation is a bit wrong?

https://sourceware.org/bugzilla/show_bug.cgi?id=3D14008

https://wiki.musl-libc.org/functional-differences-from-glibc.html

Bengt

On Wed, 21 June 2023, 10:28 Sam Varshavchik, <[email protected]> wrote:

> Bengt Thuree writes:
>
> > =C2=AB HTML content follows =C2=BB
> >
> >
> > Hi Sam,
> >
> > And thank you very much for your reply and explanation. Much appreciate=
d.
> > I will dig a bit deeper and try to figure out what is happening here.
> > My C is a bit rusty though, but good time to refresh it.
> >
> >
> > Any suggestions on an area to look more into?
>
> The current version of the iconv(3) manual page:
>
> https://man7.org/linux/man-pages/man3/iconv.3.html
>
> courier-unicode expects iconv to return EILSEQ, as described by the first
> failure case, there. This will be encountered by convert_flush_iconv()
> which
> eventually gets called from unicode_convert_deinit().
>
> This does require not merely knowing C, but having debugging know-how, to
> debug the code and see exactly what iconv returns.
>
> From https://man7.org/linux/man-pages/man3/iconv_open.3.html the closest
> matching description of your observed results is the //IGNORE option,
> where
> unrepresentable characters get discarded; but there is no option to
> replace
> them with a substitute character.
>
> Reading up on Alpine Linux, it seems to be using its own C library, so it
> looks to me like its implementation of iconv differs in behavior from the
> one in glibc. Perhaps there's a way to set it up to match glibc's iconv
> behavior, in this instance.
>
> _______________________________________________
> Courier-maildrop mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/courier-maildrop
>

--00000000000029af9d05fe9dab04
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"auto"><div><div dir=3D"auto">Hmmm</div><div dir=3D"auto">Looks =
like iconv implementation is a bit wrong?</div><div dir=3D"auto"><br></div>=
<a href=3D"https://sourceware.org/bugzilla/show_bug.cgi?id=3D14008">https:/=
/sourceware.org/bugzilla/show_bug.cgi?id=3D14008</a></div><div dir=3D"auto"=
><br></div><div dir=3D"auto"><a href=3D"https://wiki.musl-libc.org/function=
al-differences-from-glibc.html">https://wiki.musl-libc.org/functional-diffe=
rences-from-glibc.html</a></div><div dir=3D"auto"><br></div><div dir=3D"aut=
o">Bengt=C2=A0<br><br><div class=3D"gmail_quote" dir=3D"auto"><div dir=3D"l=
tr" class=3D"gmail_attr">On Wed, 21 June 2023, 10:28 Sam Varshavchik, &lt;<=
a href=3D"mailto:[email protected]">[email protected]</a>&gt; wrote=
:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bor=
der-left:1px #ccc solid;padding-left:1ex">Bengt Thuree writes:<br>
<br>
&gt; =C2=AB HTML content follows =C2=BB<br>
&gt;<br>
&gt;<br>
&gt; Hi Sam,<br>
&gt;<br>
&gt; And thank you very much for your reply and explanation. Much appreciat=
ed.<br>
&gt; I will dig a bit deeper and try to figure out what is happening here.<=
br>
&gt; My C is a bit rusty though, but good time to refresh it.<br>
&gt;<br>
&gt;<br>
&gt; Any suggestions on an area to look more into?<br>
<br>
The current version of the iconv(3) manual page:<br>
<br>
<a href=3D"https://man7.org/linux/man-pages/man3/iconv.3.html" rel=3D"noref=
errer noreferrer" target=3D"_blank">https://man7.org/linux/man-pages/man3/i=
conv.3.html</a><br>
<br>
courier-unicode expects iconv to return EILSEQ, as described by the first=
=C2=A0 <br>
failure case, there. This will be encountered by convert_flush_iconv() whic=
h=C2=A0 <br>
eventually gets called from unicode_convert_deinit().<br>
<br>
This does require not merely knowing C, but having debugging know-how, to=
=C2=A0 <br>
debug the code and see exactly what iconv returns.<br>
<br>
From <a href=3D"https://man7.org/linux/man-pages/man3/iconv_open.3.html" re=
l=3D"noreferrer noreferrer" target=3D"_blank">https://man7.org/linux/man-pa=
ges/man3/iconv_open.3.html</a> the closest=C2=A0 <br>
matching description of your observed results is the //IGNORE option, where=
=C2=A0 <br>
unrepresentable characters get discarded; but there is no option to replace=
=C2=A0 <br>
them with a substitute character.<br>
<br>
Reading up on Alpine Linux, it seems to be using its own C library, so it=
=C2=A0 <br>
looks to me like its implementation of iconv differs in behavior from the=
=C2=A0 <br>
one in glibc. Perhaps there&#39;s a way to set it up to match glibc&#39;s i=
conv=C2=A0 <br>
behavior, in this instance.<br>
<br>
_______________________________________________<br>
Courier-maildrop mailing list<br>
<a href=3D"mailto:[email protected]" target=3D"_blank"=
 rel=3D"noreferrer">[email protected]</a><br>
<a href=3D"https://lists.sourceforge.net/lists/listinfo/courier-maildrop" r=
el=3D"noreferrer noreferrer" target=3D"_blank">https://lists.sourceforge.ne=
t/lists/listinfo/courier-maildrop</a><br>
</blockquote></div></div></div>

--00000000000029af9d05fe9dab04--


--===============1149565440249251824==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============1149565440249251824==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Courier-maildrop mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/courier-maildrop

--===============1149565440249251824==--