aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--config/environments/development.rb11
-rw-r--r--config/general.yml-example4
-rw-r--r--lib/configuration.rb1
3 files changed, 13 insertions, 3 deletions
diff --git a/config/environments/development.rb b/config/environments/development.rb
index 54ab2977f..a912dd5de 100644
--- a/config/environments/development.rb
+++ b/config/environments/development.rb
@@ -16,9 +16,14 @@ Alaveteli::Application.configure do
# Don't care if the mailer can't send
config.action_mailer.raise_delivery_errors = false
config.action_mailer.perform_deliveries = true
- # Use mailcatcher in development
- config.action_mailer.delivery_method = :smtp # so is queued, rather than giving immediate errors
- config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
+
+ if AlaveteliConfiguration::use_mailcatcher_in_development
+ # Use mailcatcher in development
+ config.action_mailer.delivery_method = :smtp # so is queued, rather than giving immediate errors
+ config.action_mailer.smtp_settings = { :address => "localhost", :port => 1025 }
+ else
+ config.action_mailer.delivery_method = :sendmail
+ end
# Writes useful log files to debug memory leaks, of the sort where have
# unintentionally kept references to objects, especially strings.
diff --git a/config/general.yml-example b/config/general.yml-example
index 8e749d9d6..60eb5ae1c 100644
--- a/config/general.yml-example
+++ b/config/general.yml-example
@@ -205,3 +205,7 @@ MINIMUM_REQUESTS_FOR_STATISTICS: 50
# available locale, you can allow a fallback to the default locale for
# listing of public bodies.
PUBLIC_BODY_LIST_FALLBACK_TO_DEFAULT_LOCALE: false
+
+# If true, while in development mode, try to send mail by SMTP to port
+# 1025 (the port the mailcatcher listens on by default):
+USE_MAILCATCHER_IN_DEVELOPMENT: true
diff --git a/lib/configuration.rb b/lib/configuration.rb
index ab985c8bf..fba70f27c 100644
--- a/lib/configuration.rb
+++ b/lib/configuration.rb
@@ -69,6 +69,7 @@ module AlaveteliConfiguration
:TWITTER_WIDGET_ID => false,
:USE_DEFAULT_BROWSER_LANGUAGE => true,
:USE_GHOSTSCRIPT_COMPRESSION => false,
+ :USE_MAILCATCHER_IN_DEVELOPMENT => true,
:UTILITY_SEARCH_PATH => ["/usr/bin", "/usr/local/bin"],
:VARNISH_HOST => '',
:WORKING_OR_CALENDAR_DAYS => 'working',