Its now possible to use smtp-servers with no authentication

This commit is contained in:
Hexagon 2010-11-26 20:00:22 +01:00
parent bf66be9ea4
commit 36415b0c73
2 changed files with 19 additions and 11 deletions

View file

@ -56,9 +56,9 @@ default:
# Sender address in diaspora's outgoing mail. # Sender address in diaspora's outgoing mail.
smtp_sender_address: 'no-reply@example.com' smtp_sender_address: 'no-reply@example.com'
# Authentication required to send mail. One of "plain", # If authentication is needed, change this to one of "plain",
# "login" or "cram-md5" # "login" or "cram-md5"
smtp_authentication: 'plain' smtp_authentication: 'none'
# Credentails possibly required to log in to SMTP server if # Credentails possibly required to log in to SMTP server if
# smtp_authentication != 'plain' # smtp_authentication != 'plain'

View file

@ -6,6 +6,13 @@ Diaspora::Application.configure do
config.action_mailer.default_url_options = {:host => APP_CONFIG[:terse_pod_url]} config.action_mailer.default_url_options = {:host => APP_CONFIG[:terse_pod_url]}
unless Rails.env == 'test' || APP_CONFIG[:mailer_on] != true unless Rails.env == 'test' || APP_CONFIG[:mailer_on] != true
config.action_mailer.delivery_method = :smtp config.action_mailer.delivery_method = :smtp
if APP_CONFIG[:smtp_authentication] == "none"
config.action_mailer.smtp_settings = {
:address => APP_CONFIG[:smtp_address],
:port => APP_CONFIG[:smtp_port],
:domain => APP_CONFIG[:smtp_domain]
}
else
config.action_mailer.smtp_settings = { config.action_mailer.smtp_settings = {
:address => APP_CONFIG[:smtp_address], :address => APP_CONFIG[:smtp_address],
:port => APP_CONFIG[:smtp_port], :port => APP_CONFIG[:smtp_port],
@ -16,4 +23,5 @@ Diaspora::Application.configure do
:enable_starttls_auto => true :enable_starttls_auto => true
} }
end end
end
end end