From 6f9dc135bada244187f584c418d471cd3c0276e6 Mon Sep 17 00:00:00 2001 From: Sam Date: Fri, 31 Jul 2015 15:10:18 +1000 Subject: [PATCH] FEATURE: allow logging of raw body of all unprocessable email set log_mail_processing_failures to true to enable --- app/jobs/scheduled/poll_mailbox.rb | 3 +++ config/locales/server.en.yml | 1 + config/site_settings.yml | 1 + 3 files changed, 5 insertions(+) diff --git a/app/jobs/scheduled/poll_mailbox.rb b/app/jobs/scheduled/poll_mailbox.rb index 608559dff6e..68a1f986322 100644 --- a/app/jobs/scheduled/poll_mailbox.rb +++ b/app/jobs/scheduled/poll_mailbox.rb @@ -31,6 +31,9 @@ module Jobs end def handle_failure(mail_string, e) + + Rails.logger.warn("Email can not be processed: #{e}\n\n#{mail_string}") if SiteSetting.log_mail_processing_failures + template_args = {} case e when Email::Receiver::UserNotSufficientTrustLevelError diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 9a76fd0bb96..57c817df292 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1093,6 +1093,7 @@ en: pop3_polling_host: "The host to poll for email via POP3." pop3_polling_username: "The username for the POP3 account to poll for email." pop3_polling_password: "The password for the POP3 account to poll for email." + log_mail_processing_failures: "Log all email processing failures to http://yoursitename.com/logs" email_in: "Allow users to post new topics via email (requires pop3 polling). Configure the addresses in the \"Settings\" tab of each category." email_in_min_trust: "The minimum trust level a user needs to have to be allowed to post new topics via email." email_prefix: "The [label] used in the subject of emails. It will default to 'title' if not set." diff --git a/config/site_settings.yml b/config/site_settings.yml index 0329f89bd13..204b00bddca 100644 --- a/config/site_settings.yml +++ b/config/site_settings.yml @@ -491,6 +491,7 @@ email: pop3_polling_port: 995 pop3_polling_username: '' pop3_polling_password: '' + log_mail_processing_failures: false email_in: default: false client: true