Content
You are here:
Email notification is not working
Added by Karol Skolar over 10 years ago
Hi,
I have problems with email notification.
When I try to test email settings in SETTINGS with “Send a test mail”, then I get this error:
An error occurred while sending mail (getaddrinfo: Name or service not known)
When I try to make any change with notifying user via email (for example:* Assign random password (sent to user via e-mail)*)
then I get Internal error (see attachment).
this is my configuration.yml (i`m still confused when the quotes are needed or prohibited):
production:
# Outgoing emails configuration (see examples above) email_delivery_method: smtp smtp_address: smtp.gmail.com smtp_port: 587 smtp_domain: gmail.com smtp_authentication: plain smtp_enable_starttls_auto: true smtp_user_name: xxx@xxx.xxx smtp_password: xxxxxxxx rails_cache_store: :memcache
Thanks for any help.
Karol
Replies (13)
Hi Karol,
this thread should help
https://www.openproject.org/topics/292?board_id=9
Best
Ratzi
Hi Karol,
please don’t wonder, I just removed the mail address and password from your post as they seemed to be valid. Nevertheless, I recommend you to change the password for you mail account (if indeed those credentials were valid).
Kind regards
Hi All,
We just installed OpenProject 2.4, we managed to get everything to work except the mail.
While creating a new Work Package, after we fill in all data including the assignee etc,
when the “Email Updates” check box is checked the next page blows up. But if I uncheck it the
work package is created (which is the workaround we are using now).
Server: Ubuntu 12.0.4
stmp: using gmail (google apps domain)
**_
From Configuration.yml
default:
# Outgoing emails configuration (see examples above)
email_delivery_method: smtp
smtp_address: smtp.gmail.com
smtp_port: 587
smtp_domain: xxxxx.com
smtp_user_name: “xxxx@xxxx.com”
smtp_password: “xxxx”
smtp_enable_starttls_auto: true
smtp_authentication: plain
smtp_openssl_verify_mode: ‘none’
**
Internal error
An error occurred on the page you were trying to access.
If you continue to experience problems please contact your OpenProject administrator for assistance.
If you are the OpenProject administrator, check your log files for details about the error.
**
The log has the following error:
Rendered user_mailer/_issue_details.html.erb (26.3ms)
Rendered user_mailer/work_package_added.html.erb within layouts/user_mailer (27.4ms)
Rendered user_mailer/_issue_details.text.erb (2.2ms)
Rendered user_mailer/work_package_added.text.erb within layouts/user_mailer (2.5ms)
Sent mail to xyz@xyz.com (1394.6ms)
Completed 500 Internal Server Error in 1541.8ms
Net::SMTPAuthenticationError (530 5.7.0 Must issue a STARTTLS command first. yz5sm63733254pac.9 - gsmtp
):
app/models/work_package_observer.rb:38:in `block in after_create’
app/models/work_package_observer.rb:37:in `each’
app/models/work_package_observer.rb:37:in `after_create’
app/controllers/work_packages_controller.rb:143:in `create’
**-
we believe we have the TLS started, how do we debug or fix this issue.
Appreciate any help.
Hi,
so I have corrected the problem with bad syntax in configuration file :(, and now I`m getting:
An email was sent to …@…
but now email is recieved to this email :(. this happens on 2 servers with openproject.
here is my log from development after sending email:
Please, any suggestions are welcome.
Thank you.
Karol
Christian Ratz wrote:
Hi Karol,
can you plz add your current mail configuration (without credentials), I think there’s still something wrong.
Best
Ratzi
Hi Ratzi,
thanks for quick response. Here is my configuration.yml. I`m using Production environment.
Thanks.
Karol
Hi Karol,
is the indentation in the yml file exactly like this?
Best
Ratzi
PS: You should change your password immediately because all watchers received it via email.
Hi Ratzi,
Is the indent important ?
Quick follow up on my issues listed above,
1. email_delivery_method: :smtp — :smtp is how it should be defined?
2. in my configuration.yml, the smtp setting are defined under default: and not production: is that a problem as well?
Any thoughts on my STARTTLS issue reported in the log?
Thanks
Ravi
Hi Ratzi,
thanks for reminder, already changed :).
No, sorry, the parameters aren`t indented. All of them begins in first column.
Any suggestions?
Karol
Hi again,
default settings are used for all enviroments if they won’t be be overridden in a specific enviroment so its fine to use default.
The indentation is important in yml files see:
So if you specify the smtp attributes with the ‘smtp_’ prefix they should all be indented the same (see default section above).
@Ravi your problem is maybe also related to the wrong indentation!
Thanks Ratzi for clarifications about main and share parameters.
Now emails are working on 1 environment. On the second, there should be problem with firewall, but thats my issue :).
Thanks.
Karol
Hi,
I believe I have a successful openproject running in production mode with apache2. My thanks to those who have posted to various fora.
However I have failed to get email notification working.
Questions:
i. When are changes to configuration.yml applied? i.e. Does issuing “RAILS_ENV=”production" bundle exec rails server" reread and apply the configuration.yml or do I need to repeat any installation commands?
ii. Note reference to “Sent mail to admin@example.net” in fragment from log below.
iii. The config file makes reference to additional config see http://redmineblog.com/articles/setup-redmine-to-send-email-using-gmail/ which states requirement to run
"To install this plugin, use the script/plugin command in your Redmine directory:
ruby script/plugin install git://github.com/collectiveidea/action_mailer_optional_tls.git"
Is this relevant?
iv. Could someone post a complete working gmail capable configuration.yml stripped of username & password?
v. Is there a useful document somewhere that explains the structure if openproject to help understand the components and config of openproject ruby rails Redmine apache2 postgresql.
Error message after issuing send a test email from openproject-> administration module -> settings:
**“An error occurred while sending mail (Connection refused - connect(2) for ”localhost" port 25)_
Fragment from /home/openproject/openproject/log/production.log
__Started GET “/admin/test_email” for 127.0.0.1 at 2014-12-07 11:47:53 +1100
Processing by AdminController#test_email as HTML
Rendered user_mailer/test_mail.html.erb within layouts/user_mailer (0.7ms)
Rendered user_mailer/test_mail.text.erb within layouts/user_mailer (0.5ms)
Sent mail to admin@example.net (19.9ms)
Redirected to http://127.0.1.1/settings/edit?tab=notifications"**
_
System:
Ubuntu 12.04 openproject 3.0 gmail postgresql apache2
Would appreciate your help. I have given this a good shot to solve myself.
Thanks
Chris
The command from the Redmine page didn’t work for me to install the library. I had to modify the install command as I am now on rails v3+
Try this: