  * Let /etc/mailname override the hostname in the mail command
    (Closes: #356348)

Upstream status: Submitted 060427

---
 quilt/mail.in |   12 +++++++++++-
 1 file changed, 11 insertions(+), 1 deletion(-)

Index: b/quilt/mail.in
===================================================================
--- a/quilt/mail.in
+++ b/quilt/mail.in
@@ -263,7 +263,17 @@
 
 if [ -z "$opt_sender" ]
 then
-	hostname=$(hostname -f 2>/dev/null)
+	hostname=nowhere
+	if [ -e /etc/mailname ] ; 
+	then
+		hostname=`cat /etc/mailname`
+	fi
+	
+	if [ "$hostname" = "${hostname/.}" ]
+	then
+		hostname=$(hostname -f 2>/dev/null)
+	fi
+	
 	if [ "$hostname" = "${hostname/.}" ]
 	then
 		hostname=$(hostname)
