Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation wrong for email notifications per smtp #85

Open
konsti opened this issue Jan 27, 2012 · 0 comments
Open

Documentation wrong for email notifications per smtp #85

konsti opened this issue Jan 27, 2012 · 0 comments

Comments

@konsti
Copy link

konsti commented Jan 27, 2012

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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant