diff options
| author | Barry Warsaw | 2009-10-31 14:12:19 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2009-10-31 14:12:19 -0400 |
| commit | cac646019303ffe85cfac4c00eca7d44f634a03d (patch) | |
| tree | 7e8f85891e81e6f30f905aba2a85640756868c9a /src/mailman/mta/docs | |
| parent | 19e6548e3df4719455ab1ed2a242acbc3e38d9e9 (diff) | |
| download | mailman-cac646019303ffe85cfac4c00eca7d44f634a03d.tar.gz mailman-cac646019303ffe85cfac4c00eca7d44f634a03d.tar.zst mailman-cac646019303ffe85cfac4c00eca7d44f634a03d.zip | |
IMailTransportAgentDelivery.deliver() returns a dictionary just like
SMTP.sendmail().
Handle SMTPRecipientsRefused just like smtp_direct.py.
Hack the test mail server to be able to generate failures. SMTP responses
must be bytes (don't forget we're using unicode literals).
Diffstat (limited to 'src/mailman/mta/docs')
| -rw-r--r-- | src/mailman/mta/docs/bulk.txt | 65 |
1 files changed, 61 insertions, 4 deletions
diff --git a/src/mailman/mta/docs/bulk.txt b/src/mailman/mta/docs/bulk.txt index a612e8ac9..fabc265b6 100644 --- a/src/mailman/mta/docs/bulk.txt +++ b/src/mailman/mta/docs/bulk.txt @@ -165,6 +165,8 @@ message sent, with all the recipients packed into the envelope recipients >>> recipients = set('person_{0:02d}'.format(i) for i in range(100)) >>> msgdata = dict(recipients=recipients) >>> bulk.deliver(mlist, msg, msgdata) + {} + >>> messages = list(smtpd.messages) >>> len(messages) 1 @@ -190,6 +192,8 @@ each with 20 addresses in the RCPT TO header. >>> bulk = BulkDelivery(20) >>> bulk.deliver(mlist, msg, msgdata) + {} + >>> messages = list(smtpd.messages) >>> len(messages) 5 @@ -231,6 +235,8 @@ message metadata... >>> msgdata = dict(recipients=recipients, ... sender='asender@example.org') >>> bulk.deliver(mlist, msg, msgdata) + {} + >>> message = list(smtpd.messages)[0] >>> print message.as_string() From: aperson@example.org @@ -240,7 +246,7 @@ message metadata... Sender: asender@example.org Errors-To: asender@example.org X-Peer: ... - X-MailFrom: foo@example.com + X-MailFrom: asender@example.org X-RcptTo: aperson@example.com <BLANKLINE> This is a test. @@ -249,6 +255,8 @@ message metadata... >>> del msgdata['sender'] >>> bulk.deliver(mlist, msg, msgdata) + {} + >>> message = list(smtpd.messages)[0] >>> print message.as_string() From: aperson@example.org @@ -258,7 +266,7 @@ message metadata... Sender: test-bounces@example.com Errors-To: test-bounces@example.com X-Peer: ... - X-MailFrom: foo@example.com + X-MailFrom: test-bounces@example.com X-RcptTo: aperson@example.com <BLANKLINE> This is a test. @@ -272,6 +280,8 @@ message. ... """) >>> bulk.deliver(None, msg, msgdata) + {} + >>> message = list(smtpd.messages)[0] >>> print message.as_string() From: aperson@example.org @@ -281,7 +291,7 @@ message. Sender: site-owner@example.com Errors-To: site-owner@example.com X-Peer: ... - X-MailFrom: foo@example.com + X-MailFrom: site-owner@example.com X-RcptTo: aperson@example.com <BLANKLINE> This is a test. @@ -301,6 +311,8 @@ deleted first. ... """) >>> bulk.deliver(mlist, msg, msgdata) + {} + >>> message = list(smtpd.messages)[0] >>> print message.as_string() From: bperson@example.org @@ -310,9 +322,54 @@ deleted first. Sender: test-bounces@example.com Errors-To: test-bounces@example.com X-Peer: ... - X-MailFrom: foo@example.com + X-MailFrom: test-bounces@example.com X-RcptTo: aperson@example.com <BLANKLINE> This is a test. >>> config.pop('site-owner') + + +Delivery failures +================= + +Mailman does not do final delivery. Instead, it sends mail through a site +local mail server which manages queuing and final delivery. However, even +this local mail server can produce delivery failures visible to Mailman in +certain situations. + +For example, something could be seriously wrong with the mail server and it +could refuse delivery to all recipients. + + # Tell the mail server to fail on the next 3 RCPT TO commands, one for + # each recipient in the following message. + >>> smtpd.err_queue.put('rcpt') + >>> smtpd.err_queue.put('rcpt') + >>> smtpd.err_queue.put('rcpt') + + >>> recipients = set([ + ... 'aperson@example.org', + ... 'bperson@example.org', + ... 'cperson@example.org', + ... ]) + >>> msgdata = dict(recipients=recipients) + + >>> msg = message_from_string("""\ + ... From: aperson@example.org + ... To: test@example.com + ... Subject: test three + ... Message-ID: <camel> + ... + ... This is a test. + ... """) + + >>> failures = bulk.deliver(mlist, msg, msgdata) + >>> for address in sorted(failures): + ... print address, failures[address][0], failures[address][1] + aperson@example.org 500 Error: SMTPRecipientsRefused + bperson@example.org 500 Error: SMTPRecipientsRefused + cperson@example.org 500 Error: SMTPRecipientsRefused + + >>> messages = list(smtpd.messages) + >>> len(messages) + 0 |
