Redmine and the tls + smtpauth problem
So you have a magic redmine server… so that server is behind a fascist firewall that does not allow external connections in or out… you know.. for security reasons… So you’ve been banging your head against the wall TRYING to get smtpauth + starttls to work with the relay mailserver. Not going well is it? Here are just a few of the errors I’ve been getting:
wrong number of arguments (2 for 3)
wrong number of arguments (6 for 7)
wrong number of arguments (3 for 2)
Must starttls first!
All sorts of things… I’ve followed all sorts of guides…
well here is my environment:
CentOS 5.6
Ruby 1.8.6
Rails 2.3.5
Redmine 1.1.1.stable.4786
So what did I do to fix all this?
I found this version of tls_smtp.rb. I copied that file into: /opt/redmine/lib
I then edited /opt/redmine/config/environment.rb and right after these lines:
# Bootstrap the Rails environment, frameworks, and default configuration
require File.join(File.dirname(__FILE__), ‘boot’)
I added this:
require "smtp_tls"
I also edited my email.yml to have a setup like this:
production:
delivery_method: :smtp
smtp_settings:
tls: true
address: “MY.SMTP.SERVER”
port: ’587′
authentication: :login
domain: “MY.COMPUTER.HOST.NAME”
user_name: “USERNAME”
password: “SECRET”
Then I did the
service thin restart
and
service httpd restart
went to my http://redmine/settings, clicked on the email notifications tab and way near the bottom of that page you will see a “send test email” link. Clicky and voila! happyness!
YAY