sup

A curses threads-with-tags style email client

sup.git

git clone https://supmua.dev/git/sup/
commit 4a77a4741ea907b193b04fd52da2715ebfd0ceb8
parent 625148ecb7e37334619838dd274f43e73635d9d7
Author: Dan Callaghan <djc@djc.id.au>
Date:   Mon,  9 May 2022 20:42:11 +1000

Socket.gethostbyname -> Addrinfo.getaddrinfo

This seems like an unreliable way to guess the host's FQDN but I suppose
it's better than nothing...

Diffstat:
M lib/sup.rb | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/sup.rb b/lib/sup.rb
@@ -353,7 +353,7 @@ EOM
       name ||= ENV["USER"]
       email = ENV["USER"] + "@" +
         begin
-          Socket.gethostbyname(Socket.gethostname).first
+          Addrinfo.getaddrinfo(Socket.gethostname, 'smtp').first.getnameinfo.first
         rescue SocketError
           Socket.gethostname
         end