Subject: bug#68685: [BUG] default From: when composing new messages ignores user-mail-address (part1) and uses message-user-fqdn (part2)!

From: Manuel Giraud <[email-masked]>
Date: Wed, 24 Jan 2024 14:25:43 +0100

Hi again,

Ok, so I have a look at it and it seems to me that this behaviour comes
from 'message-user-mail-address' from message.el:

--8<---------------cut here---------------start------------->8---
(defun message-user-mail-address ()
  "Return the pertinent part of `user-mail-address'."
  (when (and user-mail-address
	     (string-match "@.*\\." user-mail-address))
    (if (string-search " " user-mail-address)
	(nth 1 (mail-extract-address-components user-mail-address))
      user-mail-address)))
--8<---------------cut here---------------end--------------->8---

The 'string-match' call checks that there is at least one dot in the
mail host part.  Otherwise, message will build a user mail address using
'message-user-fqdn'.

I think it is more a bug in the documentation of 'message-user-fqdn' or
'user-mail-address' because from the point of view of creating a message
to be *sent* it makes sense to require a FQDN.
-- 
Manuel Giraud