Email Notification error involving SSL
Added by Brennan Johnson over 15 years ago
So our mailserver is a zimbra box and users authenticate via ldap over SSL.
No authentication errors for redmine users but I cannot send notification emails to users because of the following error.
Here's the result of sending a test email from within Administration -> Settings -> Email Notifications:
An error occurred while sending mail (538 5.7.0 Encryption required for requested authentication mechanism )
- Outgoing email settings
production:
delivery_method: :smtp
smtp_settings:
address: xyz
port: 25
domain: xyz
authentication: :login
user_name: xyz
password: xyz
Does the authentication type need to be changed? I receive the same error when no authentication is specified.
My setup:
- Ruby implementation and version: 1.8.5
- Rails version: 2.2.2
- Operating system: Debian 2.6.18-6-k7 (i686)
- Database used, and its version: Postgresql 8.1.15
- Ruby-aware server used: Webrick
Side question (bonus points): Can webrick support SSL? If so, how?
(but I'd rather fix the email notification error)
Cheers,
Brennan
Replies (16)
RE: Email Notification error involving SSL - Added by David Shi over 15 years ago
SSL? Is redmine email suport SSL? How to?
RE: Email Notification error involving SSL - Added by Brennan Johnson over 15 years ago
That's what I'm wondering.
Is there a more active Redmine community somewhere else?
RE: Email Notification error involving SSL - Added by Brennan Johnson over 15 years ago
So I followed up with this:
http://douglasfshearer.com/blog/gmail-smtp-with-ruby-on-rails-and-actionmailer
Installed the plugin via:
./script/plugin install http://svn.douglasfshearer.com/rails/plugins/action_mailer_optional_tls
Plopped the following into environment.rb (after the Rails::Initializer.run do |config| block):
ActionMailer::Base.smtp_settings = {
:tls => true,
:address => "mailserver_address",
:port => "25",
:domain => "YOURDOMAIN",
:authentication => :plain,
:user_name => "username",
:password => "password"
}
Didn't work.
Error:
$ ruby script/server webrick -e production
=> Booting WEBrick...
/opt/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:279:in `load_missing_constant': uninitialized constant ActionMailer (NameError)
from /opt/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:468:in `const_missing'
from /opt/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:480:in `const_missing'
from /opt/redmine/config/environment.rb:24
from /opt/redmine/vendor/rails/railties/lib/initializer.rb:95:in `run'
from /opt/redmine/config/environment.rb:21
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /opt/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:510:in `require'
from /opt/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:355:in `new_constants_in'
from /opt/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:510:in `require'
from /opt/redmine/vendor/rails/railties/lib/commands/servers/webrick.rb:59
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /opt/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:510:in `require'
from /opt/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:355:in `new_constants_in'
from /opt/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:510:in `require'
from /opt/redmine/vendor/rails/railties/lib/commands/server.rb:39
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
Followed a different suggestion by editing environment.rb with this:
config.action_mailer.smtp_settings = {
(instead of ActionMailer::Base.smtp_settings = {)
No go.
Error:
$ ruby script/server webrick -e production
=> Booting WEBrick...
/opt/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:279:in `load_missing_constant': uninitialized constant ActionMailer (NameError)
from /opt/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:468:in `const_missing'
from /opt/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:480:in `const_missing'
from /opt/redmine/config/environment.rb:24
from /opt/redmine/vendor/rails/railties/lib/initializer.rb:95:in `run'
from /opt/redmine/config/environment.rb:21
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /opt/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:510:in `require'
from /opt/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:355:in `new_constants_in'
from /opt/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:510:in `require'
from /opt/redmine/vendor/rails/railties/lib/commands/servers/webrick.rb:59
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
from /opt/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:510:in `require'
from /opt/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:355:in `new_constants_in'
from /opt/redmine/vendor/rails/activesupport/lib/active_support/dependencies.rb:510:in `require'
from /opt/redmine/vendor/rails/railties/lib/commands/server.rb:39
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `gem_original_require'
from /usr/lib/ruby/1.8/rubygems/custom_require.rb:27:in `require'
from script/server:3
$ gem list
- LOCAL GEMS ***
actionmailer (2.2.2)
actionpack (2.2.2)
activerecord (2.2.2)
activeresource (2.2.2)
activesupport (2.2.2)
fastthread (1.0.6)
passenger (2.1.2)
postgres-pr (0.6.1)
rails (2.2.2)
rake (0.8.4)
My setup:
- Ruby implementation and version: 1.8.7 (2008-08-11 patchlevel 72) [x86_64-linux]
- Rails version: 2.2.2
- Operating system: Ubuntu 8.10 2.6.27-7-server
- Database used, and its version: Postgresql 8.3
- Ruby-aware server used: Webrick (for tests, will be deployed under Apache using Passenger - mod_rails).
Any help would be appreciated. I've followed several forums online top no avail, their solutions have not worked for me. If you need more info regarding my env let me know. I believe I'm on the right track, just need some guidance from a redmine master ;)
Cheers,
Brennan
RE: Email Notification error involving SSL - Added by Brennan Johnson over 15 years ago
So I've negated the errors, redmine's running again but whenever I try and send a test email (administration - settings - email notifications - test email) I receive the following error:
An error occurred while sending mail (wrong number of arguments (7 for 6))
Any ideas?
- Brennan
RE: Email Notification error involving SSL - Added by Brennan Johnson over 15 years ago
Found the solution:
Error:
wrong number of arguments (7 for 6)
Solution:
As I found out, both the ar_mailer and action_mailer_optional_tls have smtp_tls.rb and they are different. So ar_mailer includes it’s own tls file which doesn’t work. Solution was to copy vendor/plugins/action_mailer_optional_tls/lib/smtp_tls.rb over to gems/ar_mailer-1.3.1/lib/smtp_tls.rb. Might have to "read between the lines" and if you don't have "ar_mailer" run updatedb and see where else smtp_tls.rb could be.
So simply:
sudo cp /redmine_path/vendor/plugins/action_mailer_optional_tls/lib/smtp_tls.rb /redmine_path/lib/smtp_tls.rb
Error:
wrong number of arguments (3 for 2)
Solution:
Edit:
/opt/redmine/lib/smtp_tls.rb
/opt/redmine/vendor/plugins/action_mailer_optional_tls/lib/smtp_tls.rb
Change line 33 from:
check_auth_args user, secret, authtype if user or secret
To:
check_auth_args user, secret if user or secret
And add this afterwards (next line) for safe measure:
check_auth_method authtype
I hope this helps anyone else encountering this issue.
Cheers,
Brennan
RE: Email Notification error involving SSL - Added by narriral lemons over 15 years ago
Hi Brennan,
Thanks a lot, your post was really helpful.
I had this issue since last week and only now it could be solved.
Thanks again,
nah
RE: Email Notification error involving SSL - Added by Nikki Erwin Ramirez over 15 years ago
I agree with the previous reply, I had this issue since yesterday and Brennan's post gave me a solution that worked. =)
Thanks, Brennan!
RE: Email Notification error involving SSL - Added by ya. d. about 15 years ago
Hello,
I'm in trouble,
I have followed your post but still cannot manage to reach my goal (just one thing: i don't find this path "gems/ar_mailer-1.3.1/lib/" in my redmine app).
I try to use the Hotmail SMTP with this config :
in environment.rb :
... Rails::Initializer.run do |config| config.action_mailer.smtp_settings = { :tls => true, :address => "smtp.live.com", :port => "587", :domain => "mail.live.com", :authentication => :plain, :user_name => "MY_EMAIL", :password => "MY_PASSWORD" } config.action_mailer.perform_deliveries = true config.action_mailer.delivery_method = :smtp ...
I don't know where to read an error log but in the browser it's says :
An error occurred while sending mail (Une tentative de connexion a échoué car le parti connecté n'a pas répondu convenablement au-delà d'une certaine durée ou une connexion établie a échoué car l'hôte de connexion n'a pas répondu. - connect(2))
It seems that i can't call this smtp (connection timeout)
I need your help...
Regards.
RE: Email Notification error involving SSL - Added by narriral lemons about 15 years ago
Hi,
I hope I can help you a little.
In your Redmine directory you can locate your logs, usually, you can read all them in production.log.
For instance, my log is located at:
/var/redmine/log
Also, when I configured my Redmine I haven't looked for the path "gems/ar_mailer-1.3.1/lib/". The only thing I've done was:
- download smtp_tls.rb (from some site someone had put in this page, look above)
- send smtp_tls.rb to lib/ (lib/ directory is located at you /redmine/ directory)
- edit it with Brennan's solution:
Change line 33 from: check_auth_args user, secret, authtype if user or secret To: check_auth_args user, secret if user or secret And add this afterwards (next line) for safe measure: check_auth_method authtype
RE: Email Notification error involving SSL - Added by ya. d. about 15 years ago
Thanks i'll try to reinstall everything and just adding the file (not using the ruby install plugin) cause my server is completely down and i cannot go back.
So we have to :
1- install bitnami redmine for windows configuring our smtp mail server 2- just add the file smtp_tls.rb in the directory : apps/redmine/lib/. (DO NOT FOLLOW THE EXPLANATION WE FOUND THERE http://douglasfshearer.com/blog/gmail-smtp-with-ruby-on-rails-and-actionmailer CAUSE IT BREAKS THE SERVER) then Go to line 33 of lib/smtp_tls.rb and change "check_auth_args user, secret, authtype if user or secret" to "check_auth_args user, secret if user or secret" 3- change the file apps/redmine/config/environment.rb adding these lines at the end : config.action_mailer.smtp_settings = { :tls => true, :address => "smtp.gmail.com", :port => "587", :domain => "YOURDOMAIN", :authentication => :plain, :user_name => "GOOGLEUSERNAME", :password => "GOOGLEPASSWORD" }
Finally it's not so easy to send emails using hotmail or gmail smtp server... i hope this solution will work. it's gonna be 3 days i fail.
RE: Email Notification error involving SSL - Added by narriral lemons about 15 years ago
Ah, by the way, there is a file called email.yml it is located at /redmine/config/. As far as I know, it is the file which you should configure your email server, not in environment.rb - but I really don't know how it works with Windows, I'm in linux.
I'm using Gmail to send emails too, it works pretty well!
Look my config:
# File: config/email.yml production: delivery_method: :smtp smtp_settings: tls: true address: "smtp.gmail.com" port: 587 domain: "DOMAIN" authentication: :plain user_name: "USER@DOMAIN" password: "PASSWD" development: delivery_method: :smtp smtp_settings: tls: true address: "smtp.gmail.com" port: '587' domain: "DOMAIN" authentication: :plain user_name: "USER@DOMAIN" password: "PASSWD"
RE: Email Notification error involving SSL - Added by zeerd emneg about 14 years ago
My smtp is using the SSL.And push something by my step ( and it's working well _)
1. Install the Plugin : action_mailer_optional_tls.
2. Copy the smtp_tls.rb to redmine/lib path.
3. Change the line below "def do_ssl_start" of smtp_tls.rb:
change :
check_auth_args user, secret, authtype if user or secret
to:
check_auth_args user, secret if user or secret
4. Modify the email.yml
production:
delivery_method: :smtp
smtp_settings:
tls: false
ssl: true
address: "smtp.xxx.com"
port: 465
domain: "xxx.com"
authentication: :login
user_name: "username"
password: "password"
NOTE:
1. The version of action_mailer_optional_tls : no mind what it is , but download at 2010-09-07
2. Windows XP / Ruby 1.8.7 / Redmine 1.0.1
RE: Email Notification error involving SSL - Added by Raghuram Duvvuri over 13 years ago
Thank you so much for the timely help. Using this we solved the errors of email notifications in Redmine
RE: Email Notification error involving SSL - Added by Usman Ajmal almost 13 years ago
Brennan Johnson wrote:
Found the solution:
Error:
wrong number of arguments (7 for 6)Solution:
As I found out, both the ar_mailer and action_mailer_optional_tls have smtp_tls.rb and they are different. So ar_mailer includes it’s own tls file which doesn’t work. Solution was to copy vendor/plugins/action_mailer_optional_tls/lib/smtp_tls.rb over to gems/ar_mailer-1.3.1/lib/smtp_tls.rb. Might have to "read between the lines" and if you don't have "ar_mailer" run updatedb and see where else smtp_tls.rb could be.So simply:
sudo cp /redmine_path/vendor/plugins/action_mailer_optional_tls/lib/smtp_tls.rb /redmine_path/lib/smtp_tls.rbError:
wrong number of arguments (3 for 2)Solution:
Edit:
/opt/redmine/lib/smtp_tls.rb
/opt/redmine/vendor/plugins/action_mailer_optional_tls/lib/smtp_tls.rb
Change line 33 from:
check_auth_args user, secret, authtype if user or secret
To:
check_auth_args user, secret if user or secret
And add this afterwards (next line) for safe measure:
check_auth_method authtypeI hope this helps anyone else encountering this issue.
Cheers,
Brennan
I tried replacing
check_auth_args user, secret, authtype if user or secret
with:
check_auth_args user, secret if user or secret
check_auth_method authtype
and then tried the "Send a test email" link from the redmine->settings->notification but got following error:
An error occurred while sending mail (wrong number of arguments (8 for 6))
I then removed:
check_auth_method authtype
and tried again and found that the mail was sent successfully. ;) Thanks Brennan.
RE: Email Notification error involving SSL - Added by Anonymous almost 12 years ago
I tried everything above and mentioned here: http://www.redmine.org/issues/1598
But it's still not working. Error: (535 5.7.8 Error: authentication failed: authentication failure ) while the credentials are correct 100% sure!