parent
9baf7ff157
commit
0c58d9814b
2 changed files with 30 additions and 15 deletions
|
|
@ -46,6 +46,10 @@ default:
|
||||||
# ActionMailer class.
|
# ActionMailer class.
|
||||||
mailer_on: false
|
mailer_on: false
|
||||||
|
|
||||||
|
# This chooses which mailer should be used. 'smtp' for a smtp
|
||||||
|
# connection or 'sendmail' to use the sendmail binary.
|
||||||
|
mailer_method: 'smtp'
|
||||||
|
|
||||||
# Address/port to smtp server handing outgoing mail.
|
# Address/port to smtp server handing outgoing mail.
|
||||||
smtp_address: 'smtp.example.com'
|
smtp_address: 'smtp.example.com'
|
||||||
smtp_port: '587'
|
smtp_port: '587'
|
||||||
|
|
@ -66,6 +70,9 @@ default:
|
||||||
smtp_username: 'smtp_username'
|
smtp_username: 'smtp_username'
|
||||||
smtp_password: 'secret'
|
smtp_password: 'secret'
|
||||||
|
|
||||||
|
# The path to the sendmail binary.
|
||||||
|
sendmail_location: '/usr/sbin/sendmail'
|
||||||
|
|
||||||
#google analytics key, if false, it won't include the javascript
|
#google analytics key, if false, it won't include the javascript
|
||||||
google_a_site: false
|
google_a_site: false
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,23 +5,31 @@
|
||||||
Diaspora::Application.configure do
|
Diaspora::Application.configure do
|
||||||
config.action_mailer.default_url_options = {:host => AppConfig[:pod_uri].host}
|
config.action_mailer.default_url_options = {:host => AppConfig[:pod_uri].host}
|
||||||
unless Rails.env == 'test' || AppConfig[:mailer_on] != true
|
unless Rails.env == 'test' || AppConfig[:mailer_on] != true
|
||||||
config.action_mailer.delivery_method = :smtp
|
if AppConfig[:mailer_method] == "sendmail"
|
||||||
if AppConfig[:smtp_authentication] == "none"
|
config.action_mailer.delivery_method = :sendmail
|
||||||
config.action_mailer.smtp_settings = {
|
config.action_mailer.sendmail_settings = {
|
||||||
:address => AppConfig[:smtp_address],
|
:location => AppConfig[:sendmail_location]
|
||||||
:port => AppConfig[:smtp_port],
|
|
||||||
:domain => AppConfig[:smtp_domain]
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
config.action_mailer.smtp_settings = {
|
config.action_mailer.delivery_method = :smtp
|
||||||
:address => AppConfig[:smtp_address],
|
if AppConfig[:smtp_authentication] == "none"
|
||||||
:port => AppConfig[:smtp_port],
|
config.action_mailer.smtp_settings = {
|
||||||
:domain => AppConfig[:smtp_domain],
|
:address => AppConfig[:smtp_address],
|
||||||
:authentication => AppConfig[:smtp_authentication],
|
:port => AppConfig[:smtp_port],
|
||||||
:user_name => AppConfig[:smtp_username],
|
:domain => AppConfig[:smtp_domain],
|
||||||
:password => AppConfig[:smtp_password],
|
:enable_starttls_auto => false
|
||||||
:enable_starttls_auto => true
|
}
|
||||||
}
|
else
|
||||||
|
config.action_mailer.smtp_settings = {
|
||||||
|
:address => AppConfig[:smtp_address],
|
||||||
|
:port => AppConfig[:smtp_port],
|
||||||
|
:domain => AppConfig[:smtp_domain],
|
||||||
|
:authentication => AppConfig[:smtp_authentication],
|
||||||
|
:user_name => AppConfig[:smtp_username],
|
||||||
|
:password => AppConfig[:smtp_password],
|
||||||
|
:enable_starttls_auto => true
|
||||||
|
}
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue