~launchpad-pqm/launchpad/devel

« back to all changes in this revision

Viewing changes to lib/lp/services/mail/sendmail.py

  • Committer: mbp at canonical
  • Date: 2011-09-16 01:12:30 UTC
  • mto: This revision was merged to the branch mainline in revision 13963.
  • Revision ID: mbp@canonical.com-20110916011230-t4sg6e2eztte2ryv
Review tweaks and documentation

Show diffs side-by-side

added added

removed removed

Lines of Context:
356
356
    Uses zope.sendmail.interfaces.IMailer, so you can subscribe to
357
357
    IMailSentEvent or IMailErrorEvent to record status.
358
358
 
 
359
    This function looks at the `config` singleton for configuration as to
 
360
    where to send the mail; in particular for whether this code is running in
 
361
    zopeless mode, and for a `sendmail_to_stdout` attribute for testing.
 
362
 
359
363
    :param bulk: By default, a Precedence: bulk header is added to the
360
364
        message. Pass False to disable this.
361
365
 
428
432
            # when running in the testing environment, store emails
429
433
            TestMailer().send(
430
434
                config.canonical.bounce_address, to_addrs, raw_message)
431
 
        elif getattr(config, 'sendmail_to_stdout', None):
 
435
        elif getattr(config, 'sendmail_to_stdout', False):
432
436
            # For debugging, from process-one-mail, just print it.
433
437
            sys.stdout.write(raw_message)
434
438
        else: