Commit Graph

11 Commits

Author SHA1 Message Date
Ethan Vizitei 39a35ab09e Use source user as "FROM" for emails
This gives certain user-triggered events
a "look" as though they came directly from
that user (the FROM and REPLY-TO headers
have the name of the source user).

This also introduces "letter_opener" into the
dev environment.  If you use "letter_opener"
as your send method for dev emails, it will
open all emails in a browser tab. Very useful.

closes: CNVS-11837

TEST PLAN:

Validate each of the following notifications
looks like it's "from" the source user:

- Submitting an assignment
- Resubmitting an assignment
- Posting to a discussion
- sending a conversation message
- posting a comment on a submission

Change-Id: I0e04aa9aa5bf31a590e69507e04b86b637247acf
Conflicts:
	app/models/message.rb
Reviewed-on: https://gerrit.instructure.com/35362
Reviewed-by: Drew Bowman <dbowman@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Drew Bowman <dbowman@instructure.com>
2014-05-31 01:02:14 +00:00
Joseph Rodriguez 8554d5c894 moving mail processor to module
fixes CNVS-12174

Test Plan:
Regression test on incoming mail.

Change-Id: I3f5d131ce4a1f4408bf95a5455ffc4baa6bdc85c
Reviewed-on: https://gerrit.instructure.com/32716
Reviewed-by: Braden Anderson <banderson@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Trevor deHaan <tdehaan@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-04-25 23:05:39 +00:00
Cody Cutrer e87f947d21 rename Mailer#message
in Rails 3, there's another method with the same name

also fix some specs that check the underlying delivery method

Change-Id: I1e318a280420ea5872b7e4dca097a2b68a0a69e7
Reviewed-on: https://gerrit.instructure.com/28742
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: James Williams  <jamesw@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-01-21 20:15:28 +00:00
Jacob Fugal b0e3177647 better handle varying number of parts for mailer
in the rails2 shim. refs CNVS-9184

test-plan:
 - configure canvas to send outgoing email
 - configure a user with a real eamil address and set notifications for
   this user to asap
 - have a different user initiate a conversation with the first user
 - check for a notification email from the conversation
   - entire email should have content-type multipart/alternative with
     both text and html parts
   - text part should have content-type text/plain
   - html part should have content-type text/html
   - both parts should have charset=utf-8 in their content-type
   - html format should still be displayed by default

Change-Id: I0dd1cf7aad6d51e808438946bce172d256ffceb7
Reviewed-on: https://gerrit.instructure.com/26295
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Jon Willesen <jonw@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-11-14 03:27:57 +00:00
Jon Willesen 0a8389e86d fix order of parts in outgoing multi-part emails
the order of the parts in a multi-part email matters. The last
displayable format is the format email clients will display by
default.

fixes CNVS-9184

test plan:
 - configure canvas to actually send outgoing email.
 - configure a user with a real email address that you can
   access. set notifications for this user to asap.
 - have a different user initiate a conversation with the user
   that has the real email address.
 - check for the notification email from the conversation and
   make sure html format is displayed by default.

Change-Id: I4263bb914ad25d305a0578dc7401d795b2664f80
Reviewed-on: https://gerrit.instructure.com/26215
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
2013-11-13 17:35:46 +00:00
Jacob Fugal 2bcb852a18 convert app/models/mailer.rb for rails3
fixes CNVS-8732

makes Mailer#message act in the rails3 style, but then provides
scaffolding so that it produces the necessary rails2 behavior when
running under rails2

test-plan:
 * email delivery needs to be configured
 * set up an email communication channel for a student
 * configure to receive conversation alerts at that channel
 * have a teacher send a conversation message to that student
 * confirm receipt of the email at the student's address

Change-Id: I7f027a0a9a9dfd0231847017c888f1003b38d948
Reviewed-on: https://gerrit.instructure.com/25035
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Jeremy Putnam <jeremyp@instructure.com>
Product-Review: Jacob Fugal <jacob@instructure.com>
2013-10-15 21:17:42 +00:00
Jon Willesen 136649ce17 add Auto-Submitted header to outgoing mail
this is a standard header that indicates to other programs that
notifications and bounce messages are computer generated and
should not be responded to. This could prevent potential
message loops.

fixes CNVS-8718

test plan:
 - configure canvas to send outgoing mail.
 - generate a notification that doesn't accept replies (such as
   a new assignment) and recieve the notification email.
 - examine the headers (in gmail: "show original") and see
   "Auto-Submitted: auto-generated".
 - reply to the notification, which should bounce.
 - examine the bounce email headers and see
   "Auto-Submitted: auto-replied".

Change-Id: I2dee55628fd43b7aa61cd3167a71ed536562328d
Reviewed-on: https://gerrit.instructure.com/25132
Tested-by: Jenkins <jenkins@instructure.com>
QA-Review: Amber Taniuchi <amber@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
Product-Review: Jon Willesen <jonw@instructure.com>
2013-10-11 19:37:21 +00:00
Zach Pendleton 55f1fa66ea add multiple reply-to support to outgoing mail.
fixes CNVS-2514

allow multiple reply-to addresses that will be rotated
across when sending mail. this commit, in conjunction with
CNVS-3781, allows canvas to receive mail from multiple
inboxes and distribute its incoming mail across them.

test plan:
  * configure config/outgoing_mail.yml with multiple
    reply_to_addresses as explained in
    config/outgoing_mail.yml.example;
  * trigger at least n notifications for a user in canvas,
    where n is the number of reply_to_addresses configured;
  * visit /user/:id/messages and verify that each message
    is sent from a different reply_to address.

Change-Id: I53c01c7c355dcbf7c16595070f41eee721814849
Reviewed-on: https://gerrit.instructure.com/17870
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Zach Pendleton <zachp@instructure.com>
2013-02-22 14:02:27 -07:00
Zach Pendleton dbb259e62d support html emails.
fixes CNVS-65, CNVS-3921

test plan:
  * copy app/messages/new_discussion_entry.email.erb to
    /app/messages/new_discussion_entry.email.html.erb;
  * create a new discussion in a class with at least two
    users (who have their discussion entry notifications
    set to "immediately");
  * as user 1, post a reply to the discussion;
  * verify that user 2 receives a multipart email with
    an html part and a plaintext part.

Change-Id: I30e3e15fa53817767c770491ab8c19286281e0aa
Reviewed-on: https://gerrit.instructure.com/17964
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Jon Willesen <jonw@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-02-22 12:37:36 -07:00
JT Olds d5c8be2ca0 allow for configuration of outgoing email name
Change-Id: I87587c291801f39697e8dd691d6be9b3b396b86b
Reviewed-on: https://gerrit.instructure.com/4746
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
2011-07-21 13:33:16 -06:00
Cody Cutrer 63bad32df0 Handle incoming mails. Closes #4016.
* Uses Mailman gem
 * Can be configured for POP3, Maildir, or stdin (push from mailserver)
 * Maildir can be chained with fetchmail or similar to support IMAP
 * Can be run as part of the job server, or as a separate process

Change-Id: I000000000000000000000000000001
Reviewed-on: https://gerrit.instructure.com/2971
Tested-by: Hudson <hudson@instructure.com>
Reviewed-by: Brian Whitmer <brian@instructure.com>
2011-04-07 10:46:11 -06:00