git-commit-notifier with gmail
First of all you have to know I'm total Ruby noob :)
I installed git-commit-notifier (http://github.com/ilozka/git-commit-notifier) on my system (Ubuntu 10.04) and followed all the installation instructions but every time I push to my git repository I get this error message:
remote: Sending mail...
remote: /usr/lib/ruby/1.8/net/smtp.rb:944:in `check_auth_response': 530 5.7.0 Must issue a STARTTLS command first. n20sm12555550ibe.5 (Net::SMTPAuthenticationError)
remote: from /usr/lib/ruby/1.8/net/smtp.rb:735:in `auth_plain'
remote: from /usr/lib/ruby/1.8/net/smtp.rb:727:in `send'
remote: from /usr/lib/ruby/1.8/net/smtp.rb:727:in `authenticate'
remote: from /usr/lib/ruby/1.8/net/smtp.rb:568:in `do_start'
remote: from /usr/lib/ruby/1.8/net/smtp.rb:527:in `start'
remote: from /usr/lib/ruby/1.8/net/smtp.rb:465:in `start'
remote: from /var/lib/gems/1.8/gems/git-commit-notifier-0.7.2/bin/../lib/emailer.rb:42:in `perform_delivery_smtp'
remote: from /var/lib/gems/1.8/gems/git-commit-notifier-0.7.2/bin/../lib/emailer.rb:96:in `send'
remote: from /var/lib/gems/1.8/gems/git-commit-notifier-0.7.2/bin/../lib/commit_hook.rb:55:in `run'
remote: from /var/lib/gems/1.8/gems/git-commit-notifier-0.7.2/bin/../lib/diff_to_html.rb:285:in `each_with_index'
remote: from /var/lib/gems/1.8/gems/git-commit-notifier-0.7.2/bin/../lib/commit_hook.rb:51:in `each'
remote: from /var/lib/gems/1.8/gems/git-commit-notifier-0.7.2/bin/../lib/commit_hook.rb:51:in `each_with_index'
remote: from /var/lib/gems/1.8/gems/git-commit-notifier-0.7.2/bin/../lib/commit_hook.rb:51:in `run'
remote: from /var/lib/gems/1.8/gems/git-commit-notifier-0.7.2/bin/git-commit-notifier:13
remote: from /var/lib/gems/1.8/bin/git-commit-notifier:19:in `load'
remote: from /var/lib/gems/1.8/bin/git-commit-notifier:19
I tracked the error to emailer.rb script. Specifically line:
Net::SMTP.start(settings['address'], settings['port'], settings['domain'],
settings['user_name'], settings['password'], settings['authentication']) do |smtp|
The parameters seemed to be passed correctly (i have checked that).
My config script looks like this:
# select the delivery method: smtp or sendmail
delivery_method: smtp
# settings for the smtp server
smtp_server:
address: smtp.gmail.com
port: 587
domain: mydomain
user_name: redmine@mydomain.com
password: xxxxxx
authentication: plain
enable_tls: true
Does anyone know how I开发者_如何学运维 can solve this issue? I have Redmine on the same server and it works fine. No problems with email sending.
Thank you
Net::SMTP does not seem to support STARTTLS. This question offers a solution to that problem by monkey-patching Net::SMTP to do just that.
精彩评论