Commit Graph

9 Commits

Author SHA1 Message Date
Ethan Vizitei 98bfcba24c stop yaml_cache pollution
fixes CNVS-49087
flag = none

implement deep freezing
for the config values to
stop the pollution

dup all the locations
where the config is either
modified or passed off to
some other library where
it's not clear it was loaded
from a frozen config file

TEST PLAN:
 1) load a config file
 2) try to change it's key/vals
 3) you can't because it's frozen

Change-Id: I15faa230e3c99fe4806154493e238cecec526d1a
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/236341
Reviewed-by: James Williams <jamesw@instructure.com>
QA-Review: James Williams <jamesw@instructure.com>
Product-Review: James Williams <jamesw@instructure.com>
Tested-by: Service Cloud Jenkins <svc.cloudjenkins@instructure.com>
2020-05-07 18:55:05 +00:00
Landon Wilkins 15e4932fd7 da licença part 23
add consistent license headers to all source files
(ruby, coffeescript, javascript)

except for vendor files

Change-Id: I3fbe2919d58d827f5ac53577594f719d54f2bd32
Reviewed-on: https://gerrit.instructure.com/110045
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-04-27 21:51:35 +00:00
Cody Cutrer 8178266194 split yaml file loading out of Setting
refs CNVS-13024

Setting wasn't properly being initialized as unsharded because
it was loading before Switchman. The reason we need Setting before
switchman is just for yaml loading, so split that into its own
class.

Change-Id: I5456e103cb216dba2d5af4e9c20a697b468c923b
Reviewed-on: https://gerrit.instructure.com/35043
Reviewed-by: Jacob Fugal <jacob@instructure.com>
Tested-by: Jenkins <jenkins@instructure.com>
Product-Review: Cody Cutrer <cody@instructure.com>
QA-Review: Cody Cutrer <cody@instructure.com>
2014-05-21 18:27:06 +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
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
Jon Willesen d8efd3e805 improve robustness of incoming message processor
replaced the mailman gem with custom code with more error
handling. this will allow the incoming message processor to
continue processing messages after encountering a message with
an encoding or parsing error. the broken messages will be moved
aside to a separate folder for later inspection.

fixes CNVS-4970

test plan:
 - read up on the new incoming_mail.yml configuration settings.
 - configure incoming_mail.yml with the test imap accounts
   using legacy settings and check for regressions.
 - reconfigure incoming_mail.yml to read from a directory.
 - copy some testing email files into the configured directory.
   test files should be a mix of:
   - emails with encoding errors
   - emails with syntax errors
   - normal emails
 - all of the normal emails should be processed normally
 - all of the error emails should be moved into the error
   subdirectory

Change-Id: I0f946a56b41492f007db2775aa6da3cdfa4fdd3f
Reviewed-on: https://gerrit.instructure.com/19729
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
Product-Review: Marc LeGendre <marc@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-04-29 14:47:09 +00:00
Jon Willesen e2cbbbd9a7 Add multiple inbox support to IncomingMessageProcessor
fixes CNVS-3781

test plan:
 - See test email accounts on the IncomingMessageProcessor wiki
   page.
 - Configure config/incoming_mail.yml with multiple test email
   accounts as specified in the incoming_mail.yml.example file
   (the config should be in the development section).
 - Restart rails to pick up the new configuration.
 - Set a student's notifications for discussion topics to ASAP.
 - Create a new discussion topic.
 - Go to /messages for the student and find the notification
   for the new discussion topic.
 - Copy the "+" data from the reply-to field. For example, from
   "notifications+deadbeef-4242@example.com" you would copy
   "+deadbeef-4242"
 - Send a real email to one of the test accounts, adding the
   "+" data to the address. For example "test1@example.com"
   would become "test1+deadbeef-4242@example.com"
 - After 1 minute, the IncomingMessageProcessor should pull the
   message from the test account and post the body of the email
   message to the discussion.
 - Send another email as above but to a different test account
   you've configured. It should also appear in the discussion.
 - Reconfigure incoming_mail.yml with one account as it appears
   in the original production settings. Restart rails and make
   sure this configuration still works.
 - When you're done testing, remove your
   config/incoming_mail.yml file and restart rails.

Change-Id: Ie4a584c32bf0cc7025619341584d454cf15ce07f
Reviewed-on: https://gerrit.instructure.com/17714
Tested-by: Jenkins <jenkins@instructure.com>
Reviewed-by: Zach Pendleton <zachp@instructure.com>
QA-Review: Marc LeGendre <marc@instructure.com>
2013-02-15 14:40:51 -07:00
Brian Palmer c5eafaea56 fix another instance of job log file path changed, and log mailman to rails log
This still logs a bunch of annoying info-level messages once a minute,
but at least they go to the defined logger now instead of stdout

Change-Id: If5dfd32f22497d2e6031005a8467aab51d40859d
Reviewed-on: https://gerrit.instructure.com/3936
Reviewed-by: Zach Wily <zach@instructure.com>
Reviewed-by: Cody Cutrer <cody@instructure.com>
Tested-by: Hudson <hudson@instructure.com>
2011-05-31 12:01:35 -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