quilt-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Quilt-dev] support-envelope-sender.diff


From: Gary V. Vaughan
Subject: [Quilt-dev] support-envelope-sender.diff
Date: Mon, 19 Sep 2005 05:15:01 +0100

The -f option to hostname is very linux specific; even coreutils hostname
doesn't support it.  Add a user overridable HOSTNAME variable that, by
default, sets itself to the first of `hostname -f` or `hostname` that
succeeds.  With this patch, quilt mail works on Linux and Mac OS (at least)
without any further intervention, and allows others to set HOSTNAME
otherwise.

Because I am behind a NAT firewall, hostname cannot return an externally
visible fqdn for my machines.  Similarly, my MTA's default choice for the
envelope sender is not an externally visible domain, so mail is rejected
by the recipient MTA when the reverse lookup fails.  This patch also adds
an MTA_ARGS option that the user can set to give a suitable envelope
sender value to the MTA to work around this problem.

 quilt.quiltrc |    8 ++++++++
 quilt/mail.in |   10 ++++++----
 2 files changed, 14 insertions(+), 4 deletions(-)

Index: quilt-HEAD/quilt/mail.in
===================================================================
--- quilt-HEAD.orig/quilt/mail.in
+++ quilt-HEAD/quilt/mail.in
@@ -7,6 +7,8 @@
 #  See the COPYING and AUTHORS files for more details.
 
 : ${EDITOR:=vi}
+: ${HOSTNAME:=$(hostname -f 2>/dev/null || hostname)}
+: ${LOGNAME:=$(whoami)}
 
 # Read in library functions
 if [ "$(type -t patch_file_name)" != function ]
@@ -52,7 +54,7 @@ with a template for the introductory mes
 msgid()
 {
        local timestamp=$(@DATE@ --utc "+%Y%m%d%H%M%S.%N")
-       echo "address@hidden(hostname -f)"
+       echo "address@hidden"
 }
 
 process_mail()
@@ -66,13 +68,13 @@ process_mail()
                                  --extract-recipients Bcc \
                                  < $tmpfile)
        if [ -n "$opt_send" ]; then
-               echo @MTA@ "$@"
+               echo @MTA@ $MTA_ARGS "$@"
                @SCRIPTS@/edmail --charset $opt_charset \
                                 --remove-header Bcc "$@" < $tmpfile \
-               | @MTA@ "$@"
+               | @MTA@ $MTA_ARGS "$@"
        else
                local from_date=$(@DATE@ "+%a %b %e %H:%M:%S %Y")
-               echo "From ${LOGNAME:-$(whoami)address@hidden(hostname -f) 
$from_date"
+               echo "From ${LOGNAME:-$(whoami)address@hidden:-(hostname -f)} 
$from_date"
                sed -e 's/^From />From /' $tmpfile
                echo
        fi
Index: quilt-HEAD/quilt.quiltrc
===================================================================
--- quilt-HEAD.orig/quilt.quiltrc
+++ quilt-HEAD/quilt.quiltrc
@@ -22,6 +22,14 @@ QUILT_PATCHES_PREFIX=yes
 # sourcing this configuration file, or vi if $EDITOR wasn't set).
 #EDITOR=nedit
 
+# Use this if hostname(1) doesn't return a fully qualified domain name,
+# or if the value it returns is not an externally visible domain:
+#HOSTNAME=$(hostname -f 2>/dev/null || hostname)
+
+# Use this to set the envelope sender if you use a smarthost behind NAT
+# for example.
+#MTA_ARGS="-f address@hidden"
+
 # The following ``mail'' command filter recognizes the format we use for
 # kernel patches inside SUSE. The format is as follows (slightly
 # simplified; Signed-off-by and Acked-by lines optional):
-- 
Gary V. Vaughan      ())_.  address@hidden,gnu.org}
Research Scientist   ( '/   http://tkd.kicks-ass.net
GNU Hacker           / )=   http://www.gnu.org/software/libtool
Technical Author   `(_~)_   http://sources.redhat.com/autobook




reply via email to

[Prev in Thread] Current Thread [Next in Thread]