Commit Graph

21 Commits

Author SHA1 Message Date
Rob Orton 04e7bf8cb8 use inst_statsd
fixes CORE-2538

test plan
 - configure statsd to use data dog
 - it should work

Change-Id: Ie8428e4e99973b35506bd7a8e4d1a18f5a7875a1
Reviewed-on: https://gerrit.instructure.com/182083
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2019-03-25 17:00:49 +00:00
James Williams da38ca1ef0 remove iconv
Change-Id: I4786663805d277f028531d9c4a85a147427e7c66
Reviewed-on: https://gerrit.instructure.com/173987
Tested-by: Jenkins
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
2018-12-06 17:14:18 +00:00
Cody Cutrer 380847acfc restart the IncomingMailProcessor job every 5 minutes
also ensure it doesn't accidentally run forever

Change-Id: If8a48d005b602d35e2af9b1ced36c0dfa4437289
Reviewed-on: https://gerrit.instructure.com/169710
Tested-by: Jenkins
Reviewed-by: Rob Orton <rob@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2018-10-29 19:00:35 +00:00
Simon Williams db262fa81f bump mail gem to 2.7.0
this bump includes a change to show line ending characters are treated
when processing mail. standard email line ending is \r\n and prior to
2.7.0, this was automatically converted back to \n when decoding
a message part. however, in some cases this could corrupt images, and so
that conversion is no longer happening. see:
https://github.com/mikel/mail/pull/1113

this means that message replies that become discussion or conversation
replies will have the \r\n line ending in them.  we could restore the
previous behavior be manually calling `::Mail::Utilities.to_lf` in
incoming mail processor when we pull the decoded message parts, but
everything should work just fine with the different line ending.

closes COMMS-620

test plan:
- regression test incoming mail processing
- smoke test outgoing mail

Change-Id: I349c3e70b08ecb84ef92e597762c48708d52e800
Reviewed-on: https://gerrit.instructure.com/136259
Reviewed-by: Rob Orton <rob@instructure.com>
Tested-by: Jenkins
QA-Review: Aaron Kc Hsu <ahsu@instructure.com>
Product-Review: Simon Williams <simon@instructure.com>
2018-04-17 22:18:46 +00:00
Landon Wilkins c5b5cc786d da licença part 53
add consistent license headers to all source files

Change-Id: I405d2def01ad68c76533b9254983497485cd7073
Reviewed-on: https://gerrit.instructure.com/110160
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
Reviewed-by: Jon Jensen <jon@instructure.com>
Product-Review: Jon Jensen <jon@instructure.com>
QA-Review: Jon Jensen <jon@instructure.com>
2017-05-01 21:06:11 +00:00
Cody Cutrer e4b5bcc2fe fix parsing of SQS incoming mail
it _is_ double-json'd even with aws-sdk v2?

Change-Id: Ice998bdda790673378d1dd2463acb2eba862b5de
Reviewed-on: https://gerrit.instructure.com/100782
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Cody Cutrer <cody@instructure.com>
Reviewed-by: Jacob Fugal <jacob@instructure.com>
2017-01-29 02:08:48 +00:00
Cody Cutrer 331b60a832 convert incoming_message_processor to AWS SDK v2
Change-Id: I0a0630d7dace8ec0cfc21721ccf67c0e7a7fa9b5
Reviewed-on: https://gerrit.instructure.com/92792
Tested-by: Jenkins
QA-Review: Benjamin Christian Nelson <bcnelson@instructure.com>
Reviewed-by: Simon Williams <simon@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
2016-12-28 23:50:35 +00:00
Simon Williams b7fe6659de upgrade incoming_mail_processor to new rspec syntax
refs CNVS-34040

test plan: specs should pass

Change-Id: Ifea91036ccb1f4981c29c3247fe40966b741a4ce
Reviewed-on: https://gerrit.instructure.com/98412
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
Tested-by: Jenkins
2016-12-27 18:37:36 +00:00
Simon Williams 61d8bdd9f7 remove mocha in incoming_mail_processor
refs CNVS-34039
refs CNVS-34040

test plan: specs should pass

Change-Id: Ib630feea70c46d037e0de743ab0bf59b62727367
Reviewed-on: https://gerrit.instructure.com/98411
Tested-by: Jenkins
Reviewed-by: Landon Wilkins <lwilkins@instructure.com>
Product-Review: Landon Wilkins <lwilkins@instructure.com>
QA-Review: Landon Wilkins <lwilkins@instructure.com>
2016-12-27 18:18:43 +00:00
Joel Hough 0d5fd23f4c assume text/plain for incoming mail with unspecified content-type
fixes CNVS-24061

test plan
- reply to a replyable notification from canvas with an email that
 lacks a Content-Type header (you'll have to use an email client
 with pretty low-level email fiddling capabilities, like a rails
 console)
- ensure that canvas accepts the message and posts the reply

Change-Id: Id1b4485c4adf0cb5a6f39b261d7975d1b2ef499f
Reviewed-on: https://gerrit.instructure.com/66426
Tested-by: Jenkins
Reviewed-by: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2015-11-24 22:45:55 +00:00
Joel Hough d2210350a2 sqs incoming mailbox
fixes CNVS-23704

test plan
- regression test incoming sqs (see CNVS-21215)

Change-Id: I71cb0f2f49902c5d7d348da55301a129a74d0b18
Reviewed-on: https://gerrit.instructure.com/64188
Tested-by: Jenkins
Reviewed-by: Steven Burnett <sburnett@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2015-09-30 22:22:05 +00:00
Matthew Wheeler a38ab02ca9 Display throughput by queue on IMP Dashboard
Fixes CNVS-22630

Test Plan:

Smoke test IMP against both types of queues

Change-Id: Icb88864b600ff76b389cd3858b70ee7898ec05f8
Reviewed-on: https://gerrit.instructure.com/61442
Tested-by: Jenkins
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Matthew Wheeler <mwheeler@instructure.com>
2015-08-27 22:16:03 +00:00
Matthew Wheeler a32e10611c More Performance monitoring for IMP
Fixes CNVS-21220

Test Plan:

Test with CNVS-21215 & 21218

Change-Id: I194e66e25cd3e85718381735055aa6bbec9c4936
Reviewed-on: https://gerrit.instructure.com/58636
Reviewed-by: Joel Hough <joel@instructure.com>
Product-Review: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Heath Hales <hhales@instructure.com>
Tested-by: Jenkins
2015-07-21 23:37:02 +00:00
Matthew Wheeler 794a19dfe2 Instrumentation for Incoming Mail Processing
Fixes CNVS-20436

This does two things:
1) Reports to StatsD each time a message
   is processed
2) Every 5 minutes, reports the unprocessed size
   of each incoming mailbox

Test Plan:
Regression test incoming mail processing. Will
want to check the basic cases of incoming messages
still being processed properly.

Smoke test the new Instrumentation delayed job.
1) Setup incoming mail processing by adding a 
   config/incoming_mail.yml with the right content
   - Wheeler can tell you what the file
     should contain. (not shown because passwords)

2) Start canvas jobs 
     `bundle exec script/delayed_job run`

3) Watch /error_reports for any new error reports.
   You should see none. 


Change-Id: Ia737906cedb67e183fec0f41571e002883c058c8
Reviewed-on: https://gerrit.instructure.com/57892
Reviewed-by: Joel Hough <joel@instructure.com>
Tested-by: Jenkins
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Matthew Wheeler <mwheeler@instructure.com>
2015-07-10 11:55:02 +00:00
Alex Boyd ec8b73ccad Add an option to spawn dedicated per-mailbox message processors
Fixes CNVS-20333

Test plan:
 - Test against a Canvas instance with multiple mailboxes set up
   per instructions in config/incoming_mail.yml.example
 - Configure per-mailbox workers by adding
   `dedicated_workers_per_mailbox: true` to config/incoming_mail.yml
 - Regression test incoming message processing with imap, pop, and
   directory mailboxes
 - Ensure that all messages are processed
 - Ensure that separate jobs are queued for each mailbox

Change-Id: Ibeaef528b8deed54396d019cbb172dc0e07150fd
Reviewed-on: https://gerrit.instructure.com/53719
Reviewed-by: Joel Hough <joel@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Alex Boyd <aboyd@instructure.com>
Tested-by: Jenkins
2015-05-27 08:17:38 +00:00
Joel Hough 1c5a640f44 generate missing text parts on incoming messages
fixes CNVS-19005

test plan
- reply to an email from canvas with an email that does not have a
 text part
- ensure that the posted discussion/conversation/whatever does not
 include html tags in the posted text

Change-Id: I3223f10600e84aa0fb44f13435165557aaf59603
Reviewed-on: https://gerrit.instructure.com/53071
Tested-by: Jenkins
Reviewed-by: Andrew Butterfield <abutterfield@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2015-04-29 21:16:24 +00:00
Joel Hough 654fb95119 allow multiple IncomingMessageProcessor workers
fixes CNVS-19171

test plan
- configure multiple IMP workers by adding `workers: 3` to
 incoming_mail.yml
- regression test incoming message processing with imap, pop, and
 directory mailboxes
- ensure that all messages are processed
- ensure that three periodic IMP jobs are queued and run without
 errors

Change-Id: Id7a8d2edae35f4eaafae7c616eaaaace87f67a5d
Reviewed-on: https://gerrit.instructure.com/50270
Tested-by: Jenkins
Reviewed-by: Jonathan Featherstone <jfeatherstone@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2015-03-20 21:30:29 +00:00
Brian Palmer e53dec0894 spec: fix encodings in tests
ruby 2.1 defaults to utf-8 for string literals, where 1.9 defaulted to
binary, so these tests need to explicitly force binary for 2.1
compatibility.

This change should only be necessary in the specs, the encoding of the
body strings coming from real data won't change with 2.1, since they
aren't string literals.

fixes CNVS-16261

Change-Id: Ifd127d077e47ab56b76620ef0974932563826cc2
Reviewed-on: https://gerrit.instructure.com/42734
Reviewed-by: Bryan Madsen <bryan@instructure.com>
Product-Review: Bryan Madsen <bryan@instructure.com>
QA-Review: Bryan Madsen <bryan@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
2014-10-15 15:29:00 +00:00
Joel Hough 1f16889586 handle multipart incoming email with no html part
fixes CNVS-15232

test plan
- reply to a conversation message notification email with a
 multipart message that doesn't have an html part
- ensure that the reply shows up in canvas
- ensure that no error report is generated from the incoming
 message processor

Change-Id: If7b4913fe28815312360e58e50f47bf44ff2ead2
Reviewed-on: https://gerrit.instructure.com/40971
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Mark Severson <markse@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
Product-Review: Joel Hough <joel@instructure.com>
2014-09-11 22:30:45 +00:00
Brad Horrocks ae4806cb6d It is now possible to extract email bodies from nested multipart messages
This fixes an issue where receiving a nested multipart message would
show some of the raw message pieces instead of the actual message. A
new test case has been added.

Fixes CNVS-5873

Test Plan:

- Set Notifications for Conversations so that you will be emailed to an email account you have set up in Outlook.
- As another user, message that student to prompt the notification to be sent
- From Outlook, reply to the Conversation Message notification and include an image somewhere in the body of your reply
- Return to the Conversations Inbox of the user that was being replied to and observe that the message displays in Canvas with all the encoding data.

Change-Id: I497cf421ee231d7e95c0bacd34cb2448fb7220ff
Reviewed-on: https://gerrit.instructure.com/38684
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Joel Hough <joel@instructure.com>
Product-Review: Matthew Wheeler <mwheeler@instructure.com>
QA-Review: Steven Shepherd <sshepherd@instructure.com>
2014-08-25 20:02:10 +00:00
Raphael Weiner 5553f62357 extract incoming mail into gem
fixes CNVS-12182

test plan
- regression test on incoming mail
- use script/process_incoming_emails to manually trigger the processing
  of incoming mail

Change-Id: Iccd74d8fe2b5af3d5eefe25a2736273e3bf559b0
Reviewed-on: https://gerrit.instructure.com/32794
Reviewed-by: Simon Williams <simon@instructure.com>
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:06:02 +00:00