Commit graph

117 commits

Author SHA1 Message Date
Henrik Levkowetz 5351319a9d Change the signatures of ietf.utils.mail functions using toUser to reflect that it's used as a boolean, not something else.
- Legacy-Id: 3522
2011-10-26 13:30:20 +00:00
Henrik Levkowetz e904041ea9 Don't try to do string join on None, in case any address in an address list given to the mail sending routines is missing and represented by None.
- Legacy-Id: 3111
2011-05-10 12:13:40 +00:00
Henrik Levkowetz 7e6134496b Remove the To/From/Subject headers from extra headers to prevent duplicate headers.
- Legacy-Id: 2812
2011-02-04 12:13:46 +00:00
Henrik Levkowetz ef26a18076 Don't try to send out mail which has no recipients.
- Legacy-Id: 2779
2011-02-01 10:24:54 +00:00
Henrik Levkowetz 9720c03038 Propagate all extra fields on to the final email sending function, not only the Cc and Bcc fields.
- Legacy-Id: 2765
2011-01-27 15:06:53 +00:00
Henrik Levkowetz e8de267a1d Merged [2644] from fenner@fenron.net:
Fill in the X-IETF-IDTracker header with the
I-D Tracker version number.  This fixes #513
 - Legacy-Id: 2647
Note: SVN reference [2644] has been migrated to Git commit 77a401f7eb3f06427d3cfae81ec71e4277d828cc
2010-11-08 09:11:37 +00:00
Henrik Levkowetz 5833428881 Merged [2639] from fenner@fenron.net:
Add regression tests (and accompanying test mode) for utils.mail.
Fixes #538
 - Legacy-Id: 2645
Note: SVN reference [2639] has been migrated to Git commit 14de6870df426f18afaf90af2c74a5009cca3c1f
2010-11-08 08:47:36 +00:00
Henrik Levkowetz 6d6d3aac51 Merged [2604] from rjsparks@nostrum.com: Added filename to the subject of Protocol Action and Document Action email messages.
Fixed a bug that was preventing CC/BCC from being honored. Fixes issue #528.
 - Legacy-Id: 2623
Note: SVN reference [2604] has been migrated to Git commit 4d27ae4d7a535fb7c9cb44dd0d486a0f5850b1b1
2010-11-06 08:44:42 +00:00
Henrik Levkowetz eafcdccd3d Merged from log:branch/iesg-tracker@2571: IOLA's port of cron-scripts.
- Legacy-Id: 2578
2010-10-26 14:49:12 +00:00
Henrik Levkowetz 266b7820d0 Merged from log:branch/2.00@2363: Current release branch head to trunk.
- Legacy-Id: 2365
2010-07-21 12:48:05 +00:00
Henrik Levkowetz cd030d3b43 Adding copyright notices to all python files
- Legacy-Id: 716
2007-06-27 21:16:34 +00:00
Henrik Levkowetz 03c18bd33d Fixing a bunch of nits pyflakes were complaining about, in order to get a clean run. There are still at least 2 cases of using undefined values which needs scrutiny.
- Legacy-Id: 235
2007-06-05 16:58:58 +00:00
Bill Fenner cae902a373 Add two middleware classes:
- SQLLogMiddleware.  This logs any INSERT or UPDATE performed by
a request.

- SMTPExceptionMiddleware.  This renders a "please try again"
(template email_failed.html) message when an attempt to send
email failed.  This uses a bit of a hack, in that the middleware
looks explicitly for smtplib.SMTPException, and smtplib can
raise other exceptions (particularly socket errors).  utils/mail/send_smtp
catches all exceptions and reraises non-smtplib exceptions as
fake smtplib exceptions, and the middleware undoes the wrapping.
 - Legacy-Id: 224
2007-06-04 13:52:34 +00:00
Bill Fenner 8628844700 Remove CRs from subject that comes from a template.
- Legacy-Id: 211
2007-06-01 20:40:02 +00:00
Bill Fenner 6072945ba4 Handle, log, and reraise an smtplib exception.
- Legacy-Id: 201
2007-06-01 02:10:26 +00:00
Bill Fenner edd08f3d10 Log sent mail.
Use the right template for the subject.
 - Legacy-Id: 164
2007-05-24 20:38:27 +00:00
Bill Fenner 19d77b754a Add mail-sending module. It uses the django settings file for several
bits of configuration (e.g., mail server, any authentication required,
etc.)  It has different behavior based on the setting of the
SERVER_MODE setting:

 - 'development' or 'test': the message will be sent as an attachment
   to ietf.tracker.archive+SERVER_MODE@gmail.com; the actual destination
   supplied won't be used.

 - 'production': the message will be sent to the addressees and a
   copy sent to ietf.tracker.archive+production@gmail.com .

There are several functions to call, depending on what you want
to pass:

 - send_mail_text() takes a request, "To:" list, From header (or None
   to default), Subject text, Body text, an optional Cc: list, and
   an optional dict with extra headers.

 - send_mail() takes a template and a context instead of the body text,
   and renders the template with the given context.

 - send_mail_subj() takes a template for the subject as well as for the
   body.  It uses the same context to render both templates.
 - Legacy-Id: 159
2007-05-24 17:17:47 +00:00