Re: Gitlab SMTP shows "Net::SMTPAuthenticationError: 503 5.5.1 Error: authentication not enabled"

2017-04-24 Thread Aleksey Tsalolikhin
What does the mail server log say?

On Apr 24, 2017 8:03 AM, "Marslo Jiao"  wrote:

> After the gitlab_rails['smtp_tls'] = false set to gitlab_rails['smtp_tls']
> = true
>
> The error shows to OPENSSL error, but still haven't any clue about it.
>
> *irb(main):001:0> Notify.test_email('marslo.j...@mycompany.com
> ', 'test subject', 'test body').deliver_now*
>
> *Notify#test_email: processed outbound mail in 408.9ms*
>
> *Sent mail to marslo.j...@mycompany.com 
> (545.2ms)*
> *Date: Mon, 24 Apr 2017 19:08:18 +0800*
> *From: GitLab >*
> *Reply-To: GitLab >*
> *To: marslo.j...@mycompany.com *
> *Message-ID: <58fddca2a24f6_3f0c3fd89a4db11c64...@gitlab.mail>*
> *Subject: test subject*
> *Mime-Version: 1.0*
> *Content-Type: text/html;*
> * charset=UTF-8*
> *Content-Transfer-Encoding: 7bit*
> *Auto-Submitted: auto-generated*
> *X-Auto-Response-Suppress: All*
>
> * "http://www.w3.org/TR/REC-html40/loose.dtd
> ">*
> *test body*
>
> *OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv2/v3
> read server hello A: unknown protocol*
> *from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:587:in
> `connect'*
> *from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:587:in
> `tlsconnect'*
> *from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:555:in
> `do_start'*
> *from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:521:in
> `start'*
> *from
> /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/network/delivery_methods/smtp.rb:113:in
> `deliver!'*
> *from
> /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/message.rb:2149:in
> `do_delivery'*
> *from
> /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/message.rb:237:in
> `block in deliver'*
> *from
> /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionmailer-4.2.8/lib/action_mailer/base.rb:543:in
> `block in deliver_mail'*
> *from
> /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in
> `block in instrument'*
> *from
> /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:20:in
> `instrument'*
> *from
> /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in
> `instrument'*
> *from
> /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionmailer-4.2.8/lib/action_mailer/base.rb:541:in
> `deliver_mail'*
> *from
> /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/message.rb:237:in
> `deliver'*
> *from
> /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionmailer-4.2.8/lib/action_mailer/message_delivery.rb:85:in
> `deliver_now'*
> *from (irb):1*
> *from
> /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/console.rb:110:in
> `start'*
> *from
> /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/console.rb:9:in
> `start'*
> *from
> /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:68:in
> `console'*
> *from
> /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:39:in
> `run_command!'*
> *from
> /opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands.rb:17:in
> `'*
> *from bin/rails:9:in `require'*
> *from bin/rails:9:in `'*
>
> Postfix Configuration:
>
> *# postconf -n*
> *alias_database = hash:/etc/aliases*
> *alias_maps = hash:/etc/aliases*
> *append_dot_mydomain = no*
> *biff = no*
> *broken_sasl_auth_clients = yes*
> *inet_interfaces = all*
> *inet_protocols = all*
> *mailbox_size_limit = 0*
> *mydestination = $myhostname, Gitlab, www.gitlab.mycompany.com
>  CNHSZHDCS1VU107, localhost.localdomain,
> localhost*
> *myhostname = www.gitlab.mycompany.com *
> *mynetworks = 127.0.0.0/8  [:::127.0.0.0]/104
> [::1]/128*
> *readme_directory = no*
> *recipient_delimiter = +*
> *relayhost =*
> *smtp_sasl_auth_enable = yes*
> *smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache*
> *smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)*
> *smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated
> defer_unauth_destination*
> *smtpd_sasl_auth_enable = yes*
> *smtpd_sasl_security_options = noplaintext*
> *smtpd_tls_auth_only = yes*
> *smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem*
> *smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key*
> *smtpd_tls_security_level = may*
> *smtpd_tls_session_cache_database = 

Re: Gitlab SMTP shows "Net::SMTPAuthenticationError: 503 5.5.1 Error: authentication not enabled"

2017-04-24 Thread Marslo Jiao
After the gitlab_rails['smtp_tls'] = false set to gitlab_rails['smtp_tls'] 
= true

The error shows to OPENSSL error, but still haven't any clue about it.

*irb(main):001:0> Notify.test_email('marslo.j...@mycompany.com', 'test 
subject', 'test body').deliver_now*

*Notify#test_email: processed outbound mail in 408.9ms*

*Sent mail to marslo.j...@mycompany.com (545.2ms)*
*Date: Mon, 24 Apr 2017 19:08:18 +0800*
*From: GitLab *
*Reply-To: GitLab *
*To: marslo.j...@mycompany.com*
*Message-ID: <58fddca2a24f6_3f0c3fd89a4db11c64...@gitlab.mail>*
*Subject: test subject*
*Mime-Version: 1.0*
*Content-Type: text/html;*
* charset=UTF-8*
*Content-Transfer-Encoding: 7bit*
*Auto-Submitted: auto-generated*
*X-Auto-Response-Suppress: All*

*http://www.w3.org/TR/REC-html40/loose.dtd;>*
*test body*

*OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv2/v3 read 
server hello A: unknown protocol*
*from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:587:in 
`connect'*
*from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:587:in 
`tlsconnect'*
*from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:555:in 
`do_start'*
*from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:521:in 
`start'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/network/delivery_methods/smtp.rb:113:in
 
`deliver!'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/message.rb:2149:in
 
`do_delivery'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/message.rb:237:in
 
`block in deliver'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionmailer-4.2.8/lib/action_mailer/base.rb:543:in
 
`block in deliver_mail'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in
 
`block in instrument'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:20:in
 
`instrument'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in
 
`instrument'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionmailer-4.2.8/lib/action_mailer/base.rb:541:in
 
`deliver_mail'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/message.rb:237:in
 
`deliver'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionmailer-4.2.8/lib/action_mailer/message_delivery.rb:85:in
 
`deliver_now'*
*from (irb):1*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/console.rb:110:in
 
`start'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/console.rb:9:in
 
`start'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:68:in
 
`console'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:39:in
 
`run_command!'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands.rb:17:in
 
`'*
*from bin/rails:9:in `require'*
*from bin/rails:9:in `'*

Postfix Configuration:

*# postconf -n*
*alias_database = hash:/etc/aliases*
*alias_maps = hash:/etc/aliases*
*append_dot_mydomain = no*
*biff = no*
*broken_sasl_auth_clients = yes*
*inet_interfaces = all*
*inet_protocols = all*
*mailbox_size_limit = 0*
*mydestination = $myhostname, Gitlab, www.gitlab.mycompany.com 
CNHSZHDCS1VU107, localhost.localdomain, localhost*
*myhostname = www.gitlab.mycompany.com*
*mynetworks = 127.0.0.0/8 [:::127.0.0.0]/104 [::1]/128*
*readme_directory = no*
*recipient_delimiter = +*
*relayhost =*
*smtp_sasl_auth_enable = yes*
*smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache*
*smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)*
*smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated 
defer_unauth_destination*
*smtpd_sasl_auth_enable = yes*
*smtpd_sasl_security_options = noplaintext*
*smtpd_tls_auth_only = yes*
*smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem*
*smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key*
*smtpd_tls_security_level = may*
*smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache*
*smtpd_use_tls = yes*


*# postconf -M*
*smtp   inet  n   -   y   -   -   smtpd*
*pickup unix  n   -   y   60  1   pickup*
*cleanupunix  n   -   y   -   0   cleanup*
*qmgr   unix  n   -   n   300 1   qmgr*
*tlsmgr unix  -   -   y   1000?   1   tlsmgr*
*rewriteunix  -   -   y   -   -   trivial-rewrite*
*bounce unix  -   -   y   -   0   bounce*
*defer  unix  -   -  

Re: Gitlab SMTP shows "Net::SMTPAuthenticationError: 503 5.5.1 Error: authentication not enabled"

2017-04-24 Thread Marslo Jiao
After the *gitlab_rails['smtp_tls'] = false *set to *gitlab_rails['smtp_tls'] 
= true*

The error shows to OPENSSL error:
*irb(main):001:0> Notify.test_email('marslo.j...@mycompany.com', 'test 
subject', 'test body').deliver_now*

*Notify#test_email: processed outbound mail in 408.9ms*

*Sent mail to marslo.j...@mycompany.com (545.2ms)*
*Date: Mon, 24 Apr 2017 19:08:18 +0800*
*From: GitLab *
*Reply-To: GitLab *
*To: marslo.j...@mycompany.com*
*Message-ID: <58fddca2a24f6_3f0c3fd89a4db11c64...@gitlab.mail>*
*Subject: test subject*
*Mime-Version: 1.0*
*Content-Type: text/html;*
* charset=UTF-8*
*Content-Transfer-Encoding: 7bit*
*Auto-Submitted: auto-generated*
*X-Auto-Response-Suppress: All*

*http://www.w3.org/TR/REC-html40/loose.dtd;>*
*test body*

*OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=SSLv2/v3 read 
server hello A: unknown protocol*
*from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:587:in 
`connect'*
*from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:587:in 
`tlsconnect'*
*from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:555:in 
`do_start'*
*from /opt/gitlab/embedded/lib/ruby/2.3.0/net/smtp.rb:521:in 
`start'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/network/delivery_methods/smtp.rb:113:in
 
`deliver!'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/message.rb:2149:in
 
`do_delivery'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/message.rb:237:in
 
`block in deliver'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionmailer-4.2.8/lib/action_mailer/base.rb:543:in
 
`block in deliver_mail'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in
 
`block in instrument'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications/instrumenter.rb:20:in
 
`instrument'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/activesupport-4.2.8/lib/active_support/notifications.rb:164:in
 
`instrument'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionmailer-4.2.8/lib/action_mailer/base.rb:541:in
 
`deliver_mail'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/mail-2.6.4/lib/mail/message.rb:237:in
 
`deliver'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/actionmailer-4.2.8/lib/action_mailer/message_delivery.rb:85:in
 
`deliver_now'*
*from (irb):1*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/console.rb:110:in
 
`start'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/console.rb:9:in
 
`start'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:68:in
 
`console'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands/commands_tasks.rb:39:in
 
`run_command!'*
*from 
/opt/gitlab/embedded/lib/ruby/gems/2.3.0/gems/railties-4.2.8/lib/rails/commands.rb:17:in
 
`'*
*from bin/rails:9:in `require'*
*from bin/rails:9:in `'*

Postfix Configuration:


*# postconf -n*
*alias_database = hash:/etc/aliases*
*alias_maps = hash:/etc/aliases*
*append_dot_mydomain = no*
*biff = no*
*broken_sasl_auth_clients = yes*
*inet_interfaces = all*
*inet_protocols = all*
*mailbox_size_limit = 0*
*mydestination = $myhostname, Gitlab, www.gitlab.mycompany.com 
CNHSZHDCS1VU107, localhost.localdomain, localhost*
*myhostname = www.gitlab.mycompany.com*
*mynetworks = 127.0.0.0/8 [:::127.0.0.0]/104 [::1]/128*
*readme_directory = no*
*recipient_delimiter = +*
*relayhost =*
*smtp_sasl_auth_enable = yes*
*smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache*
*smtpd_banner = $myhostname ESMTP $mail_name (Ubuntu)*
*smtpd_relay_restrictions = permit_mynetworks permit_sasl_authenticated 
defer_unauth_destination*
*smtpd_sasl_auth_enable = yes*
*smtpd_sasl_security_options = noplaintext*
*smtpd_tls_auth_only = yes*
*smtpd_tls_cert_file = /etc/ssl/certs/ssl-cert-snakeoil.pem*
*smtpd_tls_key_file = /etc/ssl/private/ssl-cert-snakeoil.key*
*smtpd_tls_security_level = may*
*smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache*
*smtpd_use_tls = yes*


*# postconf -M*
*smtp   inet  n   -   y   -   -   smtpd*
*pickup unix  n   -   y   60  1   pickup*
*cleanupunix  n   -   y   -   0   cleanup*
*qmgr   unix  n   -   n   300 1   qmgr*
*tlsmgr unix  -   -   y   1000?   1   tlsmgr*
*rewriteunix  -   -   y   -   -   trivial-rewrite*
*bounce unix  -   -   y   -   0   bounce*
*defer  unix  -   -   y   -   0