Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have redmine 1.4.1 installed on my debian server. configuration.yaml contains the following

production:
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      tls: true
      enable_starttls_auto: true
      address: "smtp.yandex.ru"
      port: 465
      domain: "my.domain.com" 
      authentication: :plain
      user_name: "Username"
      password: "Password"

When redmine tries to send an email I can see this in nginx logs

[info] 23788#0: *1 client prematurely closed connection, so upstream connection is closed too while sending request to upstream, client: 37.57.17.197, server: redmine.my.domain.com, request: "GET /admin/test_email HTTP/1.1", upstream: "passenger:unix:/passenger_helper_server:", host: "redmine.my.domain.com", referrer: "http://redmine.my.domain.com/settings"

I have tried different smtp servers but the results were the same.

I applied these rules to iptables but that helped neither.

 iptables -A INPUT -p tcp --dport 465 -m state --state NEW,ESTABLISHED -j ACCEPT
 iptables -A OUTPUT -p tcp --sport 465 -m state --state ESTABLISHED -j ACCEPT
share|improve this question

First check if the port is open by (assuming that smtp.yandex.ru is your SMTP server):

telnet smtp.yandex.ru 465

Then I'd suggest you to check the problem using tcpdump:

First phase, check the communication between the servers (use -i eth0 if necessary):

sudo tcpdump -nl host smtp.yandex.ru and port 465

Then if remote host responding and there is TCP/IP communication, check the actual data received from the server (if you find any error).

sudo tcpdump -nl -s1500 -w- src host smtp.yandex.ru | strings

If this doesn't help, please update your question with more details using above methods.

share|improve this answer

For me, changing tls : true to ssl: true and plain to login fix the problem :

production:
  email_delivery:
  delivery_method: :smtp
  smtp_settings:
    ssl: true
    enable_starttls_auto: true
    address: "smtp.yandex.ru"
    port: 465
    domain: "my.domain.com" 
    authentication: :login
    user_name: "Username"
    password: "Password"
share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .