Erreur lors de l'envoi de l'email (SMTP-AUTH requested but missing secret phrase) - email

I'm using Redmine 2.6.4.stable, with Ruby version 1.9.3-p194 (2012-04-20) [x86_64-linux], and Rails version 3.2.21.
I can't activate the sending by email.
I catch that error : "Erreur lors de l'envoi de l'email (SMTP-AUTH requested but missing secret phrase)".
I check my config in the config/configuration.yml every thing look ok :
production:
email_delivery:
delivery_method: :smtp
smtp_settings:
address: smtp.google.com
port: 25
domain: mydomain.com
user_name: redmine#mydomain.com
Every one migth have meet that kind of problem ? Thanks to please tell me how I could solve it.
Best regards,
Djass

First: Are your credentials really right?
If yes have a look at Open Project Configuration of E-Mail-Notification - Error (SMTP-AUTH requested but missing secret phrase)
There the opener could resolve his issue doing (of course you have to set your credentials / server infos):
email_delivery_method: :confounded:mtp #main level, will not work
default: #main level
email_delivery_method: :confounded:mtp #setting for default
smtp_address: smtp.server.com #setting for default
smtp_port: 587
smtp_domain: my-domain.com
smtp_user_name: username
smtp_password: pass
smtp_enable_starttls_auto: true
smtp_authentication: plain
and then had to restart is apache server
and than i have to restart the apache-server. I do not know for now if the passenger-modul or ruby re-read the yml-files after changeing them or the fcgi-modul. Nevertheless it works.
edit: This is my email configuration working smoothly
email_delivery:
delivery_method: :smtp
smtp_settings:
enable_starttls_auto: false
address: "host_in_double_question"
port: 587
domain: 'domain_of_mailserver_in_single_quotes'
authentication: :login
user_name: "username_in_double_questions"
password: "password_in_double_quotes"
openssl_verify_mode: 'none'

Related

Gitlab not sending email

I've installed gitlab ce on docker with the documentation, everything is ok but mails doesn't works in gitlab (ask for new password for example).
When I test my conf in the rail-console I get the mail, when gitlab is supposed to send email, it doesn't works.
For mail I use OVH SMTP conf, my smtp_settings.yml is ok
see by yourself :
# This file is managed by gitlab-ctl. Manual changes will be
# erased! To change the contents below, edit /etc/gitlab/gitlab.rb
# and run `sudo gitlab-ctl reconfigure`.
if Rails.env.production?
Gitlab::Application.config.action_mailer.delivery_method = :smtp
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
authentication: :login,
address: "ssl0.ovh.net",
port: 465,
user_name: "myemail#domain.dn",
password: "mypassword",
domain: "ssl0.ovh.net",
enable_starttls_auto: true,
tls: true,
openssl_verify_mode: "peer",
ca_file: "/opt/gitlab/embedded/ssl/certs/cacert.pem",
}
end
I already tried openssl_verify_mode: "peer" and "none"
Any idea ? I'm on it from about a month.

Gitlab setup not sending email

I am trying to setup GitLab in windows azure. I followed this blog Setup GitLab in azure and it is working as charm. But I could not configure smtp mail sending through GitLab.
I have followed this settings SMTP Setup. Tried both Gmail and Zoho, with both ports 465 and 587
I am getting the following error
2016-09-21_09:44:28.55626 2016-09-21T09:44:28.556Z 13562 TID-vskyw WARN: {"class":"ActiveJob::QueueAdapters::SidekiqAdapter::JobWrapper","wrapped":"ActionMailer::DeliveryJob","queue":"mailers","args":[{"job_class":"ActionMailer::DeliveryJob","job_id":"6a954ac7-19d6-4b27-b28c-c511f25e6896","queue_name":"mailers","arguments":["DeviseMailer","confirmation_instructions","deliver_now",{"_aj_globalid":"gid://gitlab/User/1"},"tgShkQTx5e1sALoxkkGi",{"to":"<my email here>","_aj_symbol_keys":["to"]}],"locale":"en"}],"retry":true,"jid":"cbd7dc87ce4202265d1a6be7","created_at":1474450319.7324607,"enqueued_at":1474451065.2083879,"error_message":"end of file reached","error_class":"EOFError","failed_at":1474450320.9358478,"retry_count":5,"retried_at":1474451068.5555682}
2016-09-21_09:44:28.55639 2016-09-21T09:44:28.556Z 13562 TID-vskyw WARN: EOFError: end of file reached
I tried various combinations for SSL and TLS, but no luck yet!
I am using GitLab 8.11.7
Any help would be appreciated.
UPDATE:
I tried with GMail smtp and it works fine after allowing access to apps using this URL. This issue might be due to some Zoho's smtp policy
You should use the new smtp configurations
If you're installing from source and use SMTP to deliver mail, you will need to add the following line to config/initializers/smtp_settings.rb:
ActionMailer::Base.delivery_method = :smtp
As seen in https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/update/8.10-to-8.11.md#smtp-configuration
A configuration exemple for smtp_settings.rb is:
if Rails.env.production?
Rails.application.config.action_mailer.delivery_method = :smtp
ActionMailer::Base.delivery_method = :smtp
ActionMailer::Base.smtp_settings = {
address: "email.server.com",
port: 465,
user_name: "smtp",
password: "123456",
domain: "gitlab.company.com",
authentication: :login,
enable_starttls_auto: true,
openssl_verify_mode: 'peer' # See ActionMailer documentation for other possible options
}
end
You can see the sample file doc for configuring SMTP at https://gitlab.com/gitlab-org/gitlab-ce/blob/8-12-stable/config/initializers/smtp_settings.rb.sample#L13?
You can see more configuration options here http://api.rubyonrails.org/classes/ActionMailer/Base.html#class-ActionMailer::Base-label-Configuration+options

Grails mail plugin issues with Gmail SMTP

I'm using the grails mail plugin (2.0.0.RC2) with Grails 3.0.7. This is my config:
mail:
host: smtp.gmail.com
port: 465
username: myuser#gmail.com
password: myPassword
props:
- mail.debug: true
- mail.smtp.auth: true
- mail.smtp.socketFactory.port: 465
- mail.smtp.socketFactory.class: javax.net.ssl.SSLSocketFactory
- mail.smtp.socketFactory.fallback: false
When I try to send a test mail, I get the following error:
Caused by: org.springframework.mail.MailSendException: Mail server connection failed; nested exception is javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1. Failed messages: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1
at grails.plugins.mail.MailMessageBuilder.sendMessage(MailMessageBuilder.groovy:131) ~[mail-2.0.0.RC2.jar:na]
at grails.plugins.mail.MailService.sendMail(MailService.groovy:55) ~[mail-2.0.0.RC2.jar:na]
at grails.plugins.mail.MailService.sendMail(MailService.groovy:59) ~[mail-2.0.0.RC2.jar:na]
at com.eduspace.ClassroomController.$tt__index(ClassroomController.groovy:13) ~[main/:na]
at grails.transaction.GrailsTransactionTemplate$2.doInTransaction(GrailsTransactionTemplate.groovy:93) ~[grails-core-3.0.7.jar:3.0.7]
at grails.transaction.GrailsTransactionTemplate.execute(GrailsTransactionTemplate.groovy:90) ~[grails-core-3.0.7.jar:3.0.7]
... 9 common frames omitted
Caused by: javax.mail.MessagingException: Could not connect to SMTP host: smtp.gmail.com, port: 465, response: -1
at com.sun.mail.smtp.SMTPTransport.openServer(SMTPTransport.java:1972) ~[javax.mail-1.5.1.jar:1.5.1]
at com.sun.mail.smtp.SMTPTransport.protocolConnect(SMTPTransport.java:656) ~[javax.mail-1.5.1.jar:1.5.1]
at javax.mail.Service.connect(Service.java:345) ~[javax.mail-api-1.5.1.jar:1.5.1]
... 15 common frames omitted
I see no other debug information in the logs. I have the root logger set to INFO, so everything should be getting outputted. I've verified that I can telnet to smtp.gmail.com port 465, so that's not the issue. I've read that others have had issues with SSL, but then there's usually some debug information indicating an SSL issue and I don't get anything like that.
I am using a slightly different config that works fine:
grails:
mail:
host: "smtp.gmail.com"
port: 465
username: "<username>#gmail.com"
password: "<password>"
props:
mail.smtp.auth: "true"
mail.smtp.socketFactory.port: "465"
mail.smtp.socketFactory.class: "javax.net.ssl.SSLSocketFactory"
mail.smtp.socketFactory.fallback: "false"
The mail config is inside in the grails placeholder and i am not using the dashes as in your example. Maybe this could be of help to you.
This could ofcourse be wrong due to config error but one of the reason for this exact error message is gmail configuration. To avoid spam messages, gmail has started blocking access from apps that do not conform to latest security guidelines.
One easy way to avoid this error is to go to your gmail account and allow less secure apps.- https://www.google.com/settings/security/lesssecureapps
Your configuration looks good.
Here is the mine working fine:
grails {
mail {
host = "smtp.gmail.com"
'default' {
from = "<username>#gmail.com"
}
port = 465
username = "<username>#gmail.com"
password = "<password>"
props = ["mail.smtp.auth":"true",
"mail.smtp.socketFactory.port":"465",
"mail.smtp.socketFactory.class":"javax.net.ssl.SSLSocketFactory",
"mail.smtp.socketFactory.fallback":"false"]
}
}

GitLab 7.8 Email Notifications not working

I just installed GitLab 7.8 CE and all email notifications are not working. (Register/ForgotPassword/ResendConfirmation/ChangeEmail and many more)
After ~6 hours i'm just clueless how to solve this problem. Pls help!
It has something todo with "sendmail". But i have no clue how to switch it to "postfix" for example. The Server is CentOS7. I also searched all different kind of logs, but there is not a single response in any file. So no debugging either ;(
/gitlab/config/gitlab.yml
email_enabled: true
email_from: user#provider.com
/gitlab/config/environments/production.yml
config.action_mailer.delivery_method = :stmp
config.action_mailer.perform_deliveries = true
config.action_mailer.sendmail_settings = {
location: '/usr/sbin/sendmail',
arguments: '-i'
}
config.action_mailer.smtp_settings = {
address: 'provider.com',
port: 587,
domain: 'my-domain.com',
user_name: 'user#provider.com',
password: 'password',
authentication: 'plain',
enable_starttls_auto: true
}
delivery_method can either be :smtp or :sendmail (also, :test and :file, which are likely irrelevant for you). If you're using :smtp, then you don't need the sendmail_settings section, but you do need to properly configure the smtp_settings section.
In 7.8, I think smtp settings should go in config/initializers/smtp_settings.rb (see example file here).
See this link for all of the ActionMailer configuration options:
http://api.rubyonrails.org/classes/ActionMailer/Base.html

devise forgot password email not sending

Im trying to send a forgot password email. However the following error occurs -
Net::SMTPAuthenticationError in Devise::PasswordsController#create
535-5.7.8 Username and Password not accepted. Learn more at
I manage to see the sent email within the logs file but not within my actual inbox. Any ideas on how to fix this error?
Heres my development.rb code -
config.action_mailer.raise_delivery_errors = true
config.action_mailer.default_url_options = { :host => 'localhost:3000' }
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
address: "smtp.gmail.com",
port: 587,
domain: "gmail.com",
authentication: "plain",
enable_starttls_auto: true,
user_name: "myemail#gmail.com",
password: "mypassword"
}
Using: rails 4 and devise 3.2.3
Thanks
This error usually occurs when the associated email address is setup for 2-factor authentication. If you want to test with the same gmail account then generate an Application specific password. See details here.
If you have a another gmail account which does not require 2-factor authentication then try that one instead in your code.