Top Menu

Jump to content
Home
    Modules
      • Projects
      • Activity
      • Work packages
      • Gantt charts
      • Calendars
      • Team planners
      • Boards
      • News
    • Getting started
    • Introduction video
      Welcome to OpenProject Community
      Get a quick overview of project management and team collaboration with OpenProject. You can restart this video from the help menu.

    • Help and support
    • Upgrade to Enterprise edition
    • User guides
    • Videos
    • Shortcuts
    • Community forum
    • Enterprise support

    • Additional resources
    • Data privacy and security policy
    • Digital accessibility (DE)
    • OpenProject website
    • Security alerts / Newsletter
    • OpenProject blog
    • Release notes
    • Report a bug
    • Development roadmap
    • Add and edit translations
    • API documentation
  • Sign in
      Forgot your password?

      or sign in with your existing account

      Google

Side Menu

  • Overview
  • Activity
    Activity
  • Roadmap
  • Work packages
    Work packages
  • Gantt charts
    Gantt charts
  • Calendars
    Calendars
  • Team planners
    Team planners
  • Boards
    Boards
  • News
  • Forums

Content

Support Installation & Updates
  1. OpenProject
  2. Forums
  3. Support Installation & Updates
  4. Email notification is not working

Email notification is not working

Added by Karol Skolar over 11 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)

RE: Email notification is not working - Added by Christian Ratz over 11 years ago

Hi Karol,

this thread should help

https://www.openproject.org/topics/292?board_id=9

Best
Ratzi

RE: Email notification is not working - Added by Hagen Schink over 11 years ago

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

RE: Email notification is not working - Added by Ravi J about 11 years ago

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.

RE: Email notification is not working - Added by Karol Skolar about 11 years ago

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:

Sent mail to karol.skolar@alcasys.sk (102.2ms)
Redirected to https://project.alcasys.sk/settings/edit?tab=notifications
Completed 302 Found in 166.6ms (ActiveRecord: 2.6ms)
Started GET "/settings/edit?tab=notifications" for 192.168.130.42 at 2014-02-17 12:53:29 +0100
Processing by SettingsController#edit as HTML
  Parameters: {"tab"=>"notifications"}
  Rendered settings/_general.html.erb (10.8ms)
  Rendered settings/_display.html.erb (8.5ms)
  Rendered settings/_authentication.html.erb (8.1ms)
  Rendered settings/_users.html.erb (1.5ms)
  Rendered settings/_projects.html.erb (6.1ms)
  Rendered settings/_work_packages.html.erb (24.6ms)
  Rendered settings/_notifications.html.erb (93.4ms)
  Rendered settings/_mail_handler.html.erb (2.5ms)
  Rendered settings/_repositories.html.erb (11.1ms)
  Rendered common/_tabs.html.erb (176.3ms)
  Rendered settings/edit.html.erb within layouts/admin (176.9ms)
  Rendered admin/_menu.html.erb (6.2ms)
  Rendered search/_mini_form.html.erb (0.8ms)
  Rendered layouts/_action_menu.html.erb (0.1ms)
  Rendered layouts/base.html.erb (14.9ms)
Completed 200 OK in 215.7ms (Views: 196.9ms | ActiveRecord: 6.0ms)

Please, any suggestions are welcome.
Thank you.
Karol

Christian Ratz wrote:

Hi Karol,

this thread should help

https://www.openproject.org/topics/292?board_id=9

Best
Ratzi

RE: Email notification is not working - Added by Christian Ratz about 11 years ago

Hi Karol,

can you plz add your current mail configuration (without credentials), I think there’s still something wrong.

Best
Ratzi

RE: Email notification is not working - Added by Karol Skolar about 11 years ago

Hi Ratzi,
thanks for quick response. Here is my configuration.yml. I`m using Production environment.

production:
email_delivery_method: :smtp
smtp_address: smtp.gmail.com
smtp_port: 587
smtp_domain: smtp.gmail.com
smtp_user_name: ***@gmail.com
smtp_password: ****
smtp_enable_starttls_auto: true
smtp_authentication: plain

rails_cache_store: :memcache

Thanks.
Karol

RE: Email notification is not working - Added by Christian Ratz about 11 years ago

Hi Karol,

is the indentation in the yml file exactly like this?

production:
  email_delivery_method: :smtp
  smtp_address: smtp.gmail.com
  smtp_port: 587
  smtp_domain: smtp.gmail.com
  smtp_user_name: ***@gmail.com
  smtp_password: ****
  smtp_enable_starttls_auto: true
  smtp_authentication: plain

Best
Ratzi

PS: You should change your password immediately because all watchers received it via email.

RE: Email notification is not working - Added by Ravi J about 11 years ago

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

RE: Email notification is not working - Added by Karol Skolar about 11 years ago

Hi Ratzi,
thanks for reminder, already changed :).
No, sorry, the parameters aren`t indented. All of them begins in first column.
Any suggestions?
Karol

RE: Email notification is not working - Added by Christian Ratz about 11 years ago

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:

development:                         #main level
email_delivery_method: :smtp         #main level, will not work

default:                             #main level
  email_delivery_method: :smtp       #setting for default
  smtp_address: smtp.gmail.com       #setting for default
  smtp_port: 587
  smtp_domain: smtp.gmail.com
  smtp_user_name: ***@gmail.com
  smtp_password: ****
  smtp_enable_starttls_auto: true
  smtp_authentication: plain

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!

RE: Email notification is not working - Added by Karol Skolar about 11 years ago

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

RE: Email notification is not working - Added by Chris McCowage over 10 years ago

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

RE: Email notification is not working - Added by Joel Small over 10 years ago

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:

 rails plugin install git://github.com/collectiveidea/action_mailer_optional_tls.git
  • (1 - 13/13)
Loading...