0

My redmine works fine. But, the e-mail notification is not working.

Im using:

Environment:
Redmine version 3.0.3.stable
Ruby version 2.2.2-p95 (2015-04-13) [x86_64-linux]
Rails version 4.2.1
Environment production
Database adapter Mysql2
SCM:
Filesystem
Redmine plugins:
no plugin installed

configuration.yml:

default:
# Outgoing emails configuration (see examples above)
email_delivery:
delivery_method: :smtp
smtp_settings:
    address: "smtp.bsservices.com.br"
    port: 587
    domain: "smtp.bsservices.com.br"
    authentication: :login
    user_name: '<user>@bsservices.com.br'
    password: '<password>'
    openssl_verify_mode: 'none'

Error:

(Permission denied - connect(2) for "smtp.bsservices.com.br" port 587)

Error 2:

App 6529 stderr: Saving attachment '/var/www/redmine/files/2016/12/161223114939_app_creator.PNG' (79469 bytes) App 6529 stderr: Completed 500 Internal Server Error in 18ms (ActiveRecord: 2.5ms) App 6529 stderr: App 6529 stderr: Errno::EACCES (Permission denied @ rb_sysopen - /var/www/redmine/files/2016/12/161223114939_app_creator.PNG): App 6529 stderr: app/models/attachment.rb:109:in initialize' App 6529 stderr: app/models/attachment.rb:109:inopen' App 6529 stderr: app/models/attachment.rb:109:in files_to_final_location' App 6529 stderr: app/controllers/attachments_controller.rb:90:inupload'

I already gave all permissions (777) to the folder.

Any help?

  • (1) The YAML syntax you posted is invalid. Please edit your question and ensure correct indentation exactly as you had it in your original file. (2) The hostname configured in your YAML file doesn't match the one in your error message. which one did you actually use? – Holger Just Dec 21 '16 at 14:24
  • Holger... my mistake. I fix the description. – Thiago Oliveira Dec 21 '16 at 15:50

1 Answers1

0

The root cause of the issue is that Redmine can't connect to the mail server to actually send the mails. This can have one of multiple causes:

  • It might be you have SELinux enabled on your OS but have not granted Redmine permission to connect to the smtp server. You could try to disable SELinux to verify this theory.
  • It could be your server is only accessible via IPv6 and thus can't access the smtp server with its IPv4 address.
  • There could be anti-virus or firewalls preventing Redmine to access the smtp server
Holger Just
  • 52,918
  • 14
  • 115
  • 123
  • Holger. First of all thanks for the tips. But, I looked for this situations: I tried disabled the SELinux and the error continue. There is no firewall or antivirus in the machine and the server has an IPV4 address. I'm thinking it might be some ruby permission in SELinux. I had to run the **sudo chcon -R -h -t httpd_sys_content_t / path-to-your-app** even with SELinux disabled so that the process could write to the **/var/www/redmine/**. (Sorry the english) – Thiago Oliveira Dec 21 '16 at 18:04
  • `App 5821 stderr: /bin/bash: /home/www-data/.bash_profile: Permission denied App 5821 stdout: App 5821 stderr: /usr/local/lib/ruby/gems/2.2.0/gems/htmlentities-4.3.1/lib/htmlentities/mappings/expanded.rb:465: warning: duplicated key at line 466 ignored: "inodot" App 5821 stderr: Rails Error: Unable to access log file. Please ensure that /var/www/redmine/log/production.log exists and is writable (ie, make it writable for user and group: chmod 0664 /var/www/redmine/log/production.log). The log level has been raised to WARN and the output directed to STDERR until the problem is fixed. ` – Thiago Oliveira Dec 23 '16 at 13:38