diff -pruN 3.7.4-2/CHANGES.txt 3.7.5-0ubuntu1/CHANGES.txt
--- 3.7.4-2/CHANGES.txt	2010-10-01 02:32:34.000000000 +0000
+++ 3.7.5-0ubuntu1/CHANGES.txt	2012-05-23 13:27:29.000000000 +0000
@@ -2,6 +2,16 @@
 CHANGES
 =======
 
+3.7.5 (2012-05-23)
+------------------
+
+- Ensured that the 'queuedDelivery' directive has the same discriminator
+  as the 'directDelivery' directive (they are mutually incompatible).
+  https://bugs.launchpad.net/zope.sendmail/+bug/191143
+
+- Avoid requeuing messages after an SMTP "recipients refused" error.
+  https://bugs.launchpad.net/zope.sendmail/+bug/1003288
+
 3.7.4 (2010-10-01)
 ------------------
 
diff -pruN 3.7.4-2/debian/changelog 3.7.5-0ubuntu1/debian/changelog
--- 3.7.4-2/debian/changelog	2011-11-08 13:16:37.000000000 +0000
+++ 3.7.5-0ubuntu1/debian/changelog	2012-08-14 18:36:35.000000000 +0000
@@ -1,3 +1,18 @@
+zope.sendmail (3.7.5-0ubuntu1) quantal; urgency=low
+
+  * New upstream release.
+    - Fixes "queuedDelivery should be overridable." (LP: #191143)
+    - Fixes "SMTPRecipientsRefused not handled in zope.sendmail." (LP: #1003288)
+  * Bump Standards-Version to 3.9.3.
+
+ -- Logan Rosen <logatronico@gmail.com>  Sun, 15 Jul 2012 19:07:58 -0400
+
+zope.sendmail (3.7.4-2fakesync1) precise; urgency=low
+
+  * Fake sync due to mismatching orig tarball (LP: #899142).
+
+ -- Andrew Starr-Bochicchio <a.starr.b@gmail.com>  Fri, 02 Dec 2011 15:47:19 -0500
+
 zope.sendmail (3.7.4-2) unstable; urgency=low
 
   * Team upload.
diff -pruN 3.7.4-2/debian/control 3.7.5-0ubuntu1/debian/control
--- 3.7.4-2/debian/control	2011-10-26 01:14:07.000000000 +0000
+++ 3.7.5-0ubuntu1/debian/control	2012-08-14 18:36:35.000000000 +0000
@@ -1,10 +1,11 @@
 Source: zope.sendmail
 Section: zope
 Priority: extra
-Maintainer: Debian/Ubuntu Zope Team <pkg-zope-developers@lists.alioth.debian.org>
+Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>
+XSBC-Original-Maintainer: Debian/Ubuntu Zope Team <pkg-zope-developers@lists.alioth.debian.org>
 Uploaders: Brian Sutherland <brian@vanguardistas.net>
 Build-Depends: debhelper (>= 7), python-all (>= 2.6.6-3~), python-setuptools
-Standards-Version: 3.9.2
+Standards-Version: 3.9.3
 X-Python-Version: >= 2.4
 Vcs-Svn: svn://svn.debian.org/pkg-zope/zope.sendmail/trunk
 Vcs-Browser: http://svn.debian.org/viewsvn/pkg-zope/zope.sendmail/trunk
diff -pruN 3.7.4-2/PKG-INFO 3.7.5-0ubuntu1/PKG-INFO
--- 3.7.4-2/PKG-INFO	2010-10-01 02:33:28.000000000 +0000
+++ 3.7.5-0ubuntu1/PKG-INFO	2012-05-23 13:28:26.000000000 +0000
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: zope.sendmail
-Version: 3.7.4
+Version: 3.7.5
 Summary: Zope sendmail
 Home-page: http://pypi.python.org/pypi/zope.sendmail
 Author: Zope Corporation and Contributors
@@ -58,11 +58,21 @@ Description: =============
         CHANGES
         =======
         
+        3.7.5 (2012-05-23)
+        ------------------
+        
+        - Ensured that the 'queuedDelivery' directive has the same discriminator
+        as the 'directDelivery' directive (they are mutually incompatible).
+        https://bugs.launchpad.net/zope.sendmail/+bug/191143
+        
+        - Avoid requeuing messages after an SMTP "recipients refused" error.
+        https://bugs.launchpad.net/zope.sendmail/+bug/1003288
+        
         3.7.4 (2010-10-01)
         ------------------
         
         - Handle unicode usernames and passwords, encoding them to UTF-8. Fix for
-          https://bugs.launchpad.net/zope.sendmail/+bug/597143
+        https://bugs.launchpad.net/zope.sendmail/+bug/597143
         
         3.7.3 (2010-09-25)
         ------------------
@@ -75,7 +85,7 @@ Description: =============
         - Removed no longer required testing dependency on zope.testing.
         
         - Maildir storage for queue can now handle unicode passed in for message or
-          to/from addresses (change backported from repoze.sendmail).
+        to/from addresses (change backported from repoze.sendmail).
         
         - Tests use stdlib doctest instead of zope.testing.doctest.
         
@@ -83,55 +93,55 @@ Description: =============
         ------------------
         
         - Backward compatibility import of zope.sendmail.queue.QueueProcessorThread in
-          zope.sendmail.delivery.
+        zope.sendmail.delivery.
         
         3.7.0 (2010-01-12)
         ------------------
         
         - Removed dependency on ``zope.security``: the security support is optional,
-          and only available if the ``zope.security`` package is available. This change
-          is similar to the optional security support introduced in ``zope.component``
-          3.8.0, and in fact it uses the same helpers.
+        and only available if the ``zope.security`` package is available. This change
+        is similar to the optional security support introduced in ``zope.component``
+        3.8.0, and in fact it uses the same helpers.
         
         - Sort by modification time the messages in zope.sendmail.maildir so earlier
-          messages are sent before later messages during queue processing.
+        messages are sent before later messages during queue processing.
         
         - Added the new parameter ``processorThread`` to the queuedDelivery ZCML
-          directive: if False, the QueueProcessorThread is not started and thus an
-          independent process must process the queue; it defaults to True for b/c.
+        directive: if False, the QueueProcessorThread is not started and thus an
+        independent process must process the queue; it defaults to True for b/c.
         
         - Provide a console script ``zope-sendmail`` which can be used to process the
-          delivery queue in case processorThread is False. The console script can
-          either process the messages in the queue once, or run in "daemon" mode.
+        delivery queue in case processorThread is False. The console script can
+        either process the messages in the queue once, or run in "daemon" mode.
         
         3.6.1 (2009-11-16)
         ------------------
         
         - Depend on ``zope.component`` >= 3.8.0, which supports the new semantic of
-          zope.component.zcml.proxify needed by zope.sendmail.zcml.
+        zope.component.zcml.proxify needed by zope.sendmail.zcml.
         
         3.6.0 (2009-09-14)
         ------------------
         
         - Use simple vocabulary factory function instead of custom `UtilityTerm`
-          and `UtilityVocabulary` classes, copied from ``zope.app.component`` in
-          the previous release.
+        and `UtilityVocabulary` classes, copied from ``zope.app.component`` in
+        the previous release.
         
         - Depend on the ``transaction`` package instead of ``ZODB3``.
         
         - Remove zcml slugs and zpkg-related files.
         
         - Work around problem when used with Python >=2.5.1.  See
-          https://bugs.edge.launchpad.net/zope.sendmail/+bug/413335 .
+        https://bugs.edge.launchpad.net/zope.sendmail/+bug/413335 .
         
         3.5.1 (2009-01-26)
         ------------------
         
         - Copied over the UtilityTerm and UtilityVocabulary implementation from
-          zope.app.component to avoid a dependency.
+        zope.app.component to avoid a dependency.
         
         - Work around a problem when smtp quit fails, the mail was considered not
-          delivered where just the quit failed.
+        delivered where just the quit failed.
         
         3.5.0 (2008-07-05)
         ------------------
@@ -142,8 +152,8 @@ Description: =============
         --------------------
         
         - If the SMTP server rejects a message (for example, when the sender or
-          recipient address is malformed), that email stays in the queue forever
-          (https://bugs.launchpad.net/zope3/+bug/157104).
+        recipient address is malformed), that email stays in the queue forever
+        (https://bugs.launchpad.net/zope3/+bug/157104).
         
         
         3.5.0b1 (2007-11-08)
@@ -153,36 +163,36 @@ Description: =============
         - Can now talk to servers that don't implement EHLO
         - Fix bug that caused files with very long names to be created
         - Fix for https://bugs.launchpad.net/zope3/+bug/157104: move aside mail that's
-          causing 5xx server responses.
+        causing 5xx server responses.
         
         
         3.5.0a2 (2007-10-23)
         --------------------
         
         - Cleaned up ``does_esmtp`` in faux SMTP connection classes provided by the
-          tests.
+        tests.
         - If the ``QueueProcessorThread`` is asked to stop while sending messages, do
-          so after sending the current message; previously if there were many, many
-          messages to send, the thread could stick around for quite a while.
+        so after sending the current message; previously if there were many, many
+        messages to send, the thread could stick around for quite a while.
         
         
         3.5.0a1 (2007-10-23)
         --------------------
         
         - ``QueueProcessorThread`` now accepts an optional parameter *interval* for
-          defining how often to process the mail queue (default is 3 seconds)
+        defining how often to process the mail queue (default is 3 seconds)
         
         - Several ``QueueProcessorThreads`` (either in the same process, or multiple
-          processes) can now deliver messages from a single maildir without duplicates
-          being sent.
+        processes) can now deliver messages from a single maildir without duplicates
+        being sent.
         
         
         3.4.0 (2007-08-20)
         --------------------
         
         - Bugfix: Don't keep open files around for every email message
-          to be sent on transaction commit.  People who try to send many emails
-          in a single transaction now will not run out of file descriptors.
+        to be sent on transaction commit.  People who try to send many emails
+        in a single transaction now will not run out of file descriptors.
         
         
         3.4.0a1 (2007-04-22)
diff -pruN 3.7.4-2/setup.py 3.7.5-0ubuntu1/setup.py
--- 3.7.4-2/setup.py	2010-10-01 02:33:06.000000000 +0000
+++ 3.7.5-0ubuntu1/setup.py	2012-05-23 13:27:29.000000000 +0000
@@ -28,7 +28,7 @@ tests_require=[
 
 
 setup(name='zope.sendmail',
-      version='3.7.4',
+      version='3.7.5',
       url='http://pypi.python.org/pypi/zope.sendmail',
       license='ZPL 2.1',
       description='Zope sendmail',
diff -pruN 3.7.4-2/src/zope/sendmail/queue.py 3.7.5-0ubuntu1/src/zope/sendmail/queue.py
--- 3.7.4-2/src/zope/sendmail/queue.py	2010-01-07 02:37:46.000000000 +0000
+++ 3.7.5-0ubuntu1/src/zope/sendmail/queue.py	2012-05-23 13:27:29.000000000 +0000
@@ -15,7 +15,7 @@
 
 This module contains the queue processor thread.
 
-$Id: queue.py 107776 2010-01-07 10:37:46Z kobold $
+$Id: queue.py 126451 2012-05-23 12:23:18Z tseaver $
 """
 __docformat__ = 'restructuredtext'
 
@@ -271,6 +271,12 @@ class QueueProcessorThread(threading.Thr
                             else:
                                 # Log an error and retry later
                                 raise
+                        except smtplib.SMTPRecipientsRefused, e:
+                            # All recipients are refused by smtp
+                            # server. Dont try to redeliver the message.
+                            self.log.error("Email recipients refused: %s",
+                                           ', '.join(e.recipients))
+                            _os_link(filename, rejected_filename)
 
                         try:
                             os.unlink(filename)
diff -pruN 3.7.4-2/src/zope/sendmail/tests/test_queue.py 3.7.5-0ubuntu1/src/zope/sendmail/tests/test_queue.py
--- 3.7.4-2/src/zope/sendmail/tests/test_queue.py	2010-01-07 02:37:46.000000000 +0000
+++ 3.7.5-0ubuntu1/src/zope/sendmail/tests/test_queue.py	2012-05-23 13:27:29.000000000 +0000
@@ -15,7 +15,7 @@
 
 Simple implementation of the MailDelivery, Mailers and MailEvents.
 
-$Id: test_queue.py 107776 2010-01-07 10:37:46Z kobold $
+$Id: test_queue.py 126451 2012-05-23 12:23:18Z tseaver $
 """
 
 import os.path
@@ -134,6 +134,27 @@ class TestQueueProcessorThread(TestCase)
                              'bar@example.com, baz@example.com',
                              "(550, 'Serious Error')"), {})])
 
+    def test_smtp_recipients_refused(self):
+        # Test a permanent error
+        self.thread.setMailer(SMTPRecipientsRefusedMailerStub(
+                               ['bar@example.com']))
+        self.filename = os.path.join(self.dir, 'message')
+        temp = open(self.filename, "w+b")
+        temp.write('X-Zope-From: foo@example.com\n'
+                   'X-Zope-To: bar@example.com, baz@example.com\n'
+                   'Header: value\n\nBody\n')
+        temp.close()
+        self.md.files.append(self.filename)
+        self.thread.run(forever=False)
+
+        # File must be moved aside
+        self.failIf(os.path.exists(self.filename))
+        self.failUnless(os.path.exists(os.path.join(self.dir,
+                                                    '.rejected-message')))
+        self.assertEquals(self.thread.log.errors,
+                          [('Email recipients refused: %s',
+                           ('bar@example.com',), {})])
+
 test_ini = """[app:zope-sendmail]
 interval = 33
 hostname = testhost
@@ -253,6 +274,16 @@ class TestConsoleApp(TestCase):
         self.assertFalse(app.no_tls)
 
 
+class SMTPRecipientsRefusedMailerStub(object):
+
+    def __init__(self, recipients):
+        self.recipients = recipients
+
+    def send(self, fromaddr, toaddrs, message):
+        import smtplib
+        raise smtplib.SMTPRecipientsRefused(self.recipients)
+
+
 def test_suite():
     return TestSuite((
         makeSuite(TestQueueProcessorThread),
diff -pruN 3.7.4-2/src/zope/sendmail/zcml.py 3.7.5-0ubuntu1/src/zope/sendmail/zcml.py
--- 3.7.4-2/src/zope/sendmail/zcml.py	2010-01-06 23:11:42.000000000 +0000
+++ 3.7.5-0ubuntu1/src/zope/sendmail/zcml.py	2012-05-23 13:27:29.000000000 +0000
@@ -13,7 +13,7 @@
 ##############################################################################
 """'mail' ZCML Namespaces Schemas
 
-$Id: zcml.py 107770 2010-01-07 07:11:43Z kobold $
+$Id: zcml.py 126456 2012-05-23 13:20:12Z tseaver $
 """
 __docformat__ = 'restructuredtext'
 
@@ -105,7 +105,7 @@ def queuedDelivery(_context, queuePath,
             thread.start()
 
     _context.action(
-            discriminator = ('delivery', name),
+            discriminator = ('utility', IMailDelivery, name),
             callable = createQueuedDelivery,
             args = () )
 
diff -pruN 3.7.4-2/src/zope.sendmail.egg-info/PKG-INFO 3.7.5-0ubuntu1/src/zope.sendmail.egg-info/PKG-INFO
--- 3.7.4-2/src/zope.sendmail.egg-info/PKG-INFO	2010-10-01 02:33:28.000000000 +0000
+++ 3.7.5-0ubuntu1/src/zope.sendmail.egg-info/PKG-INFO	2012-05-23 13:28:26.000000000 +0000
@@ -1,6 +1,6 @@
 Metadata-Version: 1.0
 Name: zope.sendmail
-Version: 3.7.4
+Version: 3.7.5
 Summary: Zope sendmail
 Home-page: http://pypi.python.org/pypi/zope.sendmail
 Author: Zope Corporation and Contributors
@@ -58,11 +58,21 @@ Description: =============
         CHANGES
         =======
         
+        3.7.5 (2012-05-23)
+        ------------------
+        
+        - Ensured that the 'queuedDelivery' directive has the same discriminator
+        as the 'directDelivery' directive (they are mutually incompatible).
+        https://bugs.launchpad.net/zope.sendmail/+bug/191143
+        
+        - Avoid requeuing messages after an SMTP "recipients refused" error.
+        https://bugs.launchpad.net/zope.sendmail/+bug/1003288
+        
         3.7.4 (2010-10-01)
         ------------------
         
         - Handle unicode usernames and passwords, encoding them to UTF-8. Fix for
-          https://bugs.launchpad.net/zope.sendmail/+bug/597143
+        https://bugs.launchpad.net/zope.sendmail/+bug/597143
         
         3.7.3 (2010-09-25)
         ------------------
@@ -75,7 +85,7 @@ Description: =============
         - Removed no longer required testing dependency on zope.testing.
         
         - Maildir storage for queue can now handle unicode passed in for message or
-          to/from addresses (change backported from repoze.sendmail).
+        to/from addresses (change backported from repoze.sendmail).
         
         - Tests use stdlib doctest instead of zope.testing.doctest.
         
@@ -83,55 +93,55 @@ Description: =============
         ------------------
         
         - Backward compatibility import of zope.sendmail.queue.QueueProcessorThread in
-          zope.sendmail.delivery.
+        zope.sendmail.delivery.
         
         3.7.0 (2010-01-12)
         ------------------
         
         - Removed dependency on ``zope.security``: the security support is optional,
-          and only available if the ``zope.security`` package is available. This change
-          is similar to the optional security support introduced in ``zope.component``
-          3.8.0, and in fact it uses the same helpers.
+        and only available if the ``zope.security`` package is available. This change
+        is similar to the optional security support introduced in ``zope.component``
+        3.8.0, and in fact it uses the same helpers.
         
         - Sort by modification time the messages in zope.sendmail.maildir so earlier
-          messages are sent before later messages during queue processing.
+        messages are sent before later messages during queue processing.
         
         - Added the new parameter ``processorThread`` to the queuedDelivery ZCML
-          directive: if False, the QueueProcessorThread is not started and thus an
-          independent process must process the queue; it defaults to True for b/c.
+        directive: if False, the QueueProcessorThread is not started and thus an
+        independent process must process the queue; it defaults to True for b/c.
         
         - Provide a console script ``zope-sendmail`` which can be used to process the
-          delivery queue in case processorThread is False. The console script can
-          either process the messages in the queue once, or run in "daemon" mode.
+        delivery queue in case processorThread is False. The console script can
+        either process the messages in the queue once, or run in "daemon" mode.
         
         3.6.1 (2009-11-16)
         ------------------
         
         - Depend on ``zope.component`` >= 3.8.0, which supports the new semantic of
-          zope.component.zcml.proxify needed by zope.sendmail.zcml.
+        zope.component.zcml.proxify needed by zope.sendmail.zcml.
         
         3.6.0 (2009-09-14)
         ------------------
         
         - Use simple vocabulary factory function instead of custom `UtilityTerm`
-          and `UtilityVocabulary` classes, copied from ``zope.app.component`` in
-          the previous release.
+        and `UtilityVocabulary` classes, copied from ``zope.app.component`` in
+        the previous release.
         
         - Depend on the ``transaction`` package instead of ``ZODB3``.
         
         - Remove zcml slugs and zpkg-related files.
         
         - Work around problem when used with Python >=2.5.1.  See
-          https://bugs.edge.launchpad.net/zope.sendmail/+bug/413335 .
+        https://bugs.edge.launchpad.net/zope.sendmail/+bug/413335 .
         
         3.5.1 (2009-01-26)
         ------------------
         
         - Copied over the UtilityTerm and UtilityVocabulary implementation from
-          zope.app.component to avoid a dependency.
+        zope.app.component to avoid a dependency.
         
         - Work around a problem when smtp quit fails, the mail was considered not
-          delivered where just the quit failed.
+        delivered where just the quit failed.
         
         3.5.0 (2008-07-05)
         ------------------
@@ -142,8 +152,8 @@ Description: =============
         --------------------
         
         - If the SMTP server rejects a message (for example, when the sender or
-          recipient address is malformed), that email stays in the queue forever
-          (https://bugs.launchpad.net/zope3/+bug/157104).
+        recipient address is malformed), that email stays in the queue forever
+        (https://bugs.launchpad.net/zope3/+bug/157104).
         
         
         3.5.0b1 (2007-11-08)
@@ -153,36 +163,36 @@ Description: =============
         - Can now talk to servers that don't implement EHLO
         - Fix bug that caused files with very long names to be created
         - Fix for https://bugs.launchpad.net/zope3/+bug/157104: move aside mail that's
-          causing 5xx server responses.
+        causing 5xx server responses.
         
         
         3.5.0a2 (2007-10-23)
         --------------------
         
         - Cleaned up ``does_esmtp`` in faux SMTP connection classes provided by the
-          tests.
+        tests.
         - If the ``QueueProcessorThread`` is asked to stop while sending messages, do
-          so after sending the current message; previously if there were many, many
-          messages to send, the thread could stick around for quite a while.
+        so after sending the current message; previously if there were many, many
+        messages to send, the thread could stick around for quite a while.
         
         
         3.5.0a1 (2007-10-23)
         --------------------
         
         - ``QueueProcessorThread`` now accepts an optional parameter *interval* for
-          defining how often to process the mail queue (default is 3 seconds)
+        defining how often to process the mail queue (default is 3 seconds)
         
         - Several ``QueueProcessorThreads`` (either in the same process, or multiple
-          processes) can now deliver messages from a single maildir without duplicates
-          being sent.
+        processes) can now deliver messages from a single maildir without duplicates
+        being sent.
         
         
         3.4.0 (2007-08-20)
         --------------------
         
         - Bugfix: Don't keep open files around for every email message
-          to be sent on transaction commit.  People who try to send many emails
-          in a single transaction now will not run out of file descriptors.
+        to be sent on transaction commit.  People who try to send many emails
+        in a single transaction now will not run out of file descriptors.
         
         
         3.4.0a1 (2007-04-22)
