From 930b519b1a5327041301d04048a282847748d017 Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 15 Sep 2011 16:04:34 +0200 Subject: Let /etc/mailname override the hostname in the mail command Closes bug http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=356348 Initial patch author said (in above bug report): When generating the default From: for outbound messages quilt uses $(hostname -f) to determine the domain part of the e-mail address. Policy 11.6 specifies that this should be overridden by the value specified in /etc/mailname. (see http://www.debian.org/doc/debian-policy/ch-customized-programs.html#s-mail-transport-agents) --- quilt/mail.in | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/quilt/mail.in b/quilt/mail.in index d16b3c1..b9b73b1 100644 --- a/quilt/mail.in +++ b/quilt/mail.in @@ -267,7 +267,13 @@ fi if [ -z "$opt_sender" ] then - hostname=$(hostname -f 2>/dev/null) + if [ -e /etc/mailname ] + then + hostname=$(< /etc/mailname) + else + hostname=$(hostname -f 2>/dev/null) + fi + if [ "$hostname" = "${hostname/.}" ] then hostname=$(hostname) -- cgit