mojombo/god — Issue #85: Documentation wrong for email notifications per smtp
Author: konsti
Created: 2012-01-27 14:50:02+00:00
State: open

Hi,

on your website you have the following in your documentation:

[...]
=== SMTP Options (when delivery_method = :smtp) ===
server_host - The String hostname of the SMTP server (default: localhost).
server_port - The Integer port of the SMTP server (default: 25).
server_auth - The Boolean of whether or not to use authentication
(default: false).

=== SMTP Auth Options (when server_auth = true) ===
[...]

So you define `server_auth` as a boolean.

Looking into your code in this file:
https://github.com/mojombo/god/blob/master/lib/god/contacts/email.rb#L113

you send the `server_auth` argument to the smtp server:

def notify_smtp(mail)
args = [arg(:server_host), arg(:server_port)]
if arg(:server_auth)
args << arg(:server_domain)
args << arg(:server_user)
args << arg(:server_password)
args << arg(:server_auth)
end

Net::SMTP.start(*args) do |smtp|
smtp.send_message(mail, arg(:from_email), arg(:to_email))
end
end

If I set server_auth to `true`, like defined in your documentation I get the error

INFO: failed to send email to me@example.com via smtp: wrong authentication type true

because `true` is not a valid authentication type for smtp.

Correct is for example

d.server_auth = 'plain'