git-commit-notifier 与 gmail

发布于 2024-09-10 03:20:57 字数 2753 浏览 8 评论 0原文

首先你必须知道我是个 Ruby 菜鸟 :)

我安装了 git-commit-notifier (http://github.com/ilozka/git-commit-notifier)在我的系统(Ubuntu 10.04)上并遵循所有安装说明,但每次我推送到我的 git 存储库时,我都会收到此错误消息

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

:跟踪 emailer.rb 脚本的错误。具体行:

Net::SMTP.start(settings['address'], settings['port'], settings['domain'],                                                                                                                             
                settings['user_name'], settings['password'], settings['authentication']) do |smtp|

参数似乎已正确传递(我已检查过)。

我的配置脚本如下所示:

# 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: [email protected]
    password: xxxxxx
    authentication: plain
    enable_tls: true

有谁知道我如何解决这个问题?我在同一台服务器上安装了Redmine,并且运行良好。电子邮件发送没有问题。

谢谢

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: [email protected]
    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

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

寄居人 2024-09-17 03:20:57

Net::SMTP 似乎不支持 STARTTLS。 这个问题通过猴子修补 Net::SMTP 提供了该问题的解决方案就是这样做。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文