[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [msmtp-users] msmtp: runtime fails with "Bad value for ai_flags"



Hi Martin,

On Jan 2, 2015, at 2:45 AM, Martin Lambers <marlam@...23...> wrote:

> On Wed, 31 Dec 2014 17:00:24 -0600, Lonnie Abelbeck wrote:
>> msmtp: cannot locate host foo.example.com: Bad value for ai_flags
>> msmtp: could not send mail...
>> 
>> [...]

> In my opinion, AI_IDN should only be defined if it is actually
> supported. Otherwise, you need to build with a fall back code path that
> uses libidn, and if you need that anyway, then why bother with an
> unreliable AI_IDN? There's nothing to gain, you just make the code less
> readable.

Agreed.


> I suggest --enable-gai-idn. 
> 
> See the attached patch.

I tested your patch and it works for me with --disable-gai-idn defined.

Ship it! :-)

BTW, I had a hair-pulling time getting the patched configure.ac working, normally in Buildroot setting "MSMTP_AUTORECONF = YES" would all that would be needed, but when the AUTORECONF occurred I got...
--
configure.ac:44: warning: macro `AM_GNU_GETTEXT' not found in library
configure.ac:44: error: possibly undefined macro: AM_GNU_GETTEXT
--
So then I patched your aclocal.m4 to include the gettext.m4 stuff, but then your Makefile got upset calling your build-aux autoconf scripts.  Long story short, I was able to manually patch your configure.ac, then manually regenerate the configure and aclocal.m4 and patch those for testing.

It seems Buildroot's HOST autoconf sets "ac_cv_prog_gnu_m4_gnu=no".


> An unrelated question: why are you using glibc without IDN support?
> Libidn is included in the glibc sources; I cannot see a reason to
> disable it.

Well, good question...  We (AstLinux: http://www.astlinux.org ) have a quite optimized ~ 50 MB image, more of an "appliance" than a "distro".  We use Buildroot to cross-compile and an external eglibc toolchain created by crosstool-ng.  By default crosstool-ng does not include libidn in eglibc, and there was a related crosstool-ng issue a couple years ago, but is probably fixed today.  Regardless we don't enable anything we don't think we need.

I searched all the packages we include, and only your latest msmtp uses AI_IDN and darkstat uses NI_IDN but since darkstat's autoconf doesn't define _GNU_SOURCE, "#ifdef NI_IDN" is not true and not used.

So, I say keep it simple, and your --disable-gai-idn configure option is a good solution.


Thanks for your timely attention.

Lonnie


> 
> Regards,
> Martin<msmtp-gai-idn.diff>------------------------------------------------------------------------------