diff options
author | Martin Quinson <mquinson@debian.org> | 2011-09-15 16:04:34 +0200 |
---|---|---|
committer | Andreas Gruenbacher <agruen@linbit.com> | 2011-09-15 16:10:59 +0200 |
commit | 930b519b1a5327041301d04048a282847748d017 (patch) | |
tree | 0712c1fea1bf8baa29ba3a32aa8a003767527b88 | |
parent | 814257147f1d4e4f8f6407a097ed3e3e11271358 (diff) | |
download | quilt-930b519b1a5327041301d04048a282847748d017.tar.gz |
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)
-rw-r--r-- | quilt/mail.in | 8 |
1 files changed, 7 insertions, 1 deletions
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) |