[Reportbug-commits] [SCM] Reportbug - reports bugs in the Debian distribution branch, master, updated. 6.0-69-g0ea48fa

Sandro Tosi morph at debian.org
Tue Nov 1 12:50:46 UTC 2011


The following commit has been merged in the master branch:
commit 0ea48fa3797aea17f4050e90115646aee7ba61c1
Author: Sandro Tosi <morph at debian.org>
Date:   Tue Nov 1 13:50:27 2011 +0100

    Implement a new --envelope-from cli option (and the corresponding one in the configuration file), to allow to select the Envelope From (aka Return-path) mail header different than the default, the From address. It reverts the change in #614879; thanks to Kevin Locke for the report and discussion; Closes: #640249

diff --git a/bin/reportbug b/bin/reportbug
index a5eddb3..53097e7 100755
--- a/bin/reportbug
+++ b/bin/reportbug
@@ -973,6 +973,8 @@ def main():
     parser.add_option('--max-attachment-size', type="int", dest='max_attachment_size', help="Specify the maximum size in byte for an attachment [default: 10485760].")
     parser.add_option('--latest-first', action='store_true', dest='latest_first', default=False,
                       help='Order bugs to show the latest first')
+    parser.add_option('--envelope-from', dest='envelopefrom',
+                      help='Specify the Envelope From (Return-path) address used to send the bug report')
 
 
     (options, args) = parser.parse_args()
@@ -2179,7 +2181,8 @@ For more details, please see: http://www.debian.org/devel/wnpp/''')
                 self.options.template, self.options.outfile, self.options.mta,
                 self.options.kudos, self.options.smtptls, smtphost,
                 self.options.smtpuser, self.options.smtppasswd,
-                self.options.paranoid, self.options.draftpath)
+                self.options.paranoid, self.options.draftpath,
+                self.options.envelopefrom)
 
         if self.options.exitprompt:
             ui.get_string('Please press ENTER to exit reportbug: ')
diff --git a/debian/changelog b/debian/changelog
index ed433aa..a7dfd5c 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-reportbug (6.2.3) UNRELEASED; urgency=low
+reportbug (6.3) UNRELEASED; urgency=low
 
   * reportbug/utils.py
     - add 'oldstable' to the list of distributions, so not to confuse 'APT
@@ -16,8 +16,13 @@ reportbug (6.2.3) UNRELEASED; urgency=low
       source package (either by using --src cli option or by selecting the
       source pkg in the menu); thanks to Julian Andres Klode for the report;
       Closes: #644194
+  * Implement a new --envelope-from cli option (and the corresponding one in the
+    configuration file), to allow to select the Envelope From (aka Return-path)
+    mail header different than the default, the From address. It reverts the
+    change in #614879; thanks to Kevin Locke for the report and discussion;
+    Closes: #640249
 
- -- Sandro Tosi <morph at debian.org>  Tue, 01 Nov 2011 12:26:01 +0100
+ -- Sandro Tosi <morph at debian.org>  Tue, 01 Nov 2011 13:46:10 +0100
 
 reportbug (6.2.2) unstable; urgency=low
 
diff --git a/man/reportbug.1 b/man/reportbug.1
index 999f190..b30df32 100644
--- a/man/reportbug.1
+++ b/man/reportbug.1
@@ -131,6 +131,12 @@ name or comment part, like \fBfoo at example.com\fP).  This setting will
 override the \fBEMAIL\fP and \fBDEBEMAIL\fP environment variables, but
 not \fBREPORTBUGEMAIL\fP.
 .TP
+.B \-\-envelope\-from
+Specify the Envelope From mail header (also known as Return-path); by default
+it's the From address but it can be selected a different one in case the MTA
+doesn't canonicalize local users to public addresses.
+
+.TP
 .B \-\-mbox\-reader\-cmd=MBOX_READER_CMD
 Specify a command to open the bug reports mbox file. You can use
 \fB%s\fP to substitute the mbox file to be used, and \fB%%\fP to insert
diff --git a/man/reportbug.conf.5 b/man/reportbug.conf.5
index 915793e..8ccbf41 100644
--- a/man/reportbug.conf.5
+++ b/man/reportbug.conf.5
@@ -91,6 +91,12 @@ variables, see \fBreportbug(1)\fP). Example:
 \fBemail\fP \fI"humberto at example.com"\fP
 
 .TP
+.B envelopefrom
+Specify the Envelope From mail header (also known as Return-path); by default
+it's the From address but it can be selected a different one in case the MTA
+doesn't canonicalize local users to public addresses.
+
+.TP
 .B mbox_reader_cmd
 Specify a command to open the bug reports mbox file. You can use
 \fB%s\fP to substitute the mbox file to be used, and \fB%%\fP to insert
diff --git a/reportbug/submit.py b/reportbug/submit.py
index 2f46d18..ca6cd70 100644
--- a/reportbug/submit.py
+++ b/reportbug/submit.py
@@ -221,7 +221,8 @@ def send_report(body, attachments, mua, fromaddr, sendto, ccaddr, bccaddr,
                 rtype='debbugs', exinfo=None, replyto=None, printonly=False,
                 template=False, outfile=None, mta='', kudos=False,
                 smtptls=False, smtphost='localhost',
-                smtpuser=None, smtppasswd=None, paranoid=False, draftpath=None):
+                smtpuser=None, smtppasswd=None, paranoid=False, draftpath=None,
+                envelopefrom=None):
     '''Send a report.'''
 
     failed = using_sendmail = False
@@ -340,8 +341,13 @@ def send_report(body, attachments, mua, fromaddr, sendto, ccaddr, bccaddr,
         jalist = ' '.join(malist)
 
         faddr = rfc822.parseaddr(fromaddr)[1]
+        if envelopefrom:
+            envfrom = rfc822.parseaddr(envelopefrom)[1]
+        else:
+            envfrom = faddr
         ewrite("Sending message via %s...\n", mta)
-        pipe = os.popen('%s -oi -oem %s' % (mta, jalist), 'w')
+        pipe = os.popen('%s -f %s -oi -oem %s' % (
+                mta, commands.mkarg(envfrom), jalist), 'w')
         using_sendmail = True
 
     if smtphost:
diff --git a/reportbug/utils.py b/reportbug/utils.py
index e8c380b..eec026a 100644
--- a/reportbug/utils.py
+++ b/reportbug/utils.py
@@ -998,6 +998,9 @@ def parse_config_files():
                 elif token == 'max_attachment_size':
                     arg = lex.get_token()
                     args['max_attachment_size'] = int(arg)
+                elif token == 'envelopefrom':
+                    token = lex.get_token().lower()
+                    args['envelopefrom'] = token
                 else:
                     sys.stderr.write('Unrecognized token: %s\n' % token)
 
diff --git a/test/data/reportbug.conf b/test/data/reportbug.conf
index 561b3bd..14eaa2c 100644
--- a/test/data/reportbug.conf
+++ b/test/data/reportbug.conf
@@ -36,3 +36,4 @@ mirror this_is_a_bts_mirror
 paranoid
 max_attachment_size 1024000
 reportbug_version 6.2
+envelopefrom "reportbug-maint at lists.alioth.debian.org"
\ No newline at end of file
diff --git a/test/test_utils.py b/test/test_utils.py
index 5719e1a..b027bd3 100644
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -406,6 +406,7 @@ class TestConfig(unittest2.TestCase):
             'dontquery': False,
             'editor': u'emacs -nw',
             'email': u'reportbug-maint at lists.alioth.debian.org',
+            'envelopefrom': u'reportbug-maint at lists.alioth.debian.org',
             'headers': ['X-Reportbug-Testsuite: this is the test suite'],
             'http_proxy': u'http://proxy.example.com:3128/',
             'interface': 'gtk2',

-- 
Reportbug - reports bugs in the Debian distribution



More information about the Reportbug-commits mailing list