#1040499 mail uses short hostname for return address, instead of fqdn

Package:
mailutils
Source:
mailutils
Description:
GNU mailutils utilities for handling mail
Submitter:
David Mandelberg
Date:
2024-01-22 04:30:03 UTC
Severity:
normal
#1040499#5
Date:
2023-07-06 19:52:23 UTC
From:
To:
After a recent upgrade, the mail command switched from using
<username>@<fqdn> to using <username>@<short-hostname> for the default
return address. I don't see anything in the changelog, so I'm guessing
that wasn't an intentional change? I do see "Remove leftover uses of
gethostby* functions." in the changelog which might be related though?

Here are some debug logs in case it helps. On another host with
mailutils 1:3.15-4, the "mu_mailer_send_message(): using From" line
shows the fqdn instead of the short hostname.

dseomn@solaria:~$ hostname
solaria
dseomn@solaria:~$ hostname --fqdn
solaria.mandelberg.org
dseomn@solaria:~$ echo test | mail.mailutils
--debug-level='acl;config;mailbox;mailer;auth' --no-config 
--config-verbose root
mail.mailutils: sendmail binary: /usr/sbin/sendmail
mail.mailutils: Getting auth info for UID 1000
mail.mailutils: Trying system...
mail.mailutils: system yields 0=Success
mail.mailutils: source=system, name=dseomn, passwd=x, uid=1000,
gid=1000, gecos=David Mandelberg,,,, dir=/home/dseomn, shell=/bin/bash,
mailbox=/var/mail/dseomn, quota=0, change_uid=1
mail.mailutils: Getting auth info for UID 1000
mail.mailutils: Trying system...
mail.mailutils: system yields 0=Success
mail.mailutils: source=system, name=dseomn, passwd=x, uid=1000,
gid=1000, gecos=David Mandelberg,,,, dir=/home/dseomn, shell=/bin/bash,
mailbox=/var/mail/dseomn, quota=0, change_uid=1
mail.mailutils: mu_mailer_send_message(): using From: dseomn@solaria
mail.mailutils: exec /usr/sbin/sendmail argv: /usr/sbin/sendmail -oi -f
dseomn@solaria -t
mail.mailutils: Sending headers...
mail.mailutils: Header: To: root
mail.mailutils: Header: User-Agent: mail (GNU Mailutils 3.16)
mail.mailutils: Header: Date: Thu,  6 Jul 2023 15:48:20 -0400
mail.mailutils: Header:
mail.mailutils: Sending body...
mail.mailutils: /usr/sbin/sendmail exited with: 0

#1040499#10
Date:
2024-01-22 04:18:59 UTC
From:
To:
I too am seeing this issue on a freshly installed unstable system. I was
initially unable to reproduce the issue on a copy of mailutils compiled
manually (without the Debian scripts). After some comparison of the two
builds, I was able to finally reproduce by adding the
-fstack-protector-strong flag to CFLAGS.

It seems the getaddrinfo call on line 86 of libmailutils/base/hostname.c
is somehow broken by this flag, though this is far outside my wheelhouse
and I do not really understand what the flag does in detail or how it
would possibly affect things.