Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I have a rails app that is supposed to send out emails. It works on my other ubuntu server, but not on this one. Here's my mail.log in /var/log:

    Sep  4 15:48:56 web2 postfix/qmgr[27071]: 18B6F8A8FB: from=<orders@mysite-lehmann.com>, size=4447, nrcpt=2 (queue active)
    Sep  4 15:48:56 web2 postfix/qmgr[27071]: B84A78A8CF: from=<>, size=2844, nrcpt=1 (queue active)
    Sep  4 15:48:56 web2 postfix/qmgr[27071]: B1FA98A8E4: from=<mysite.notifier@mysite-lehmann.com>, size=14467, nrcpt=1 (queue active)
    Sep  4 15:48:56 web2 postfix/smtp[12151]: warning: per-session SASL client initialization: generic failure
    Sep  4 15:48:56 web2 postfix/smtp[12151]: fatal: SASL per-connection initialization failed
    Sep  4 15:48:56 web2 postfix/smtp[12153]: warning: per-session SASL client initialization: generic failure
    Sep  4 15:48:56 web2 postfix/smtp[12153]: fatal: SASL per-connection initialization failed
    Sep  4 15:48:56 web2 postfix/smtp[12152]: warning: per-session SASL client initialization: generic failure
    Sep  4 15:48:56 web2 postfix/smtp[12152]: fatal: SASL per-connection initialization failed
    Sep  4 15:48:57 web2 postfix/qmgr[27071]: warning: private/smtp socket: malformed response
    Sep  4 15:48:57 web2 postfix/qmgr[27071]: warning: transport smtp failure -- see a previous warning/fatal/panic logfile record for the problem description
    Sep  4 15:48:57 web2 postfix/master[1000]: warning: process /usr/lib/postfix/smtp pid 12151 exit status 1
    Sep  4 15:48:57 web2 postfix/master[1000]: warning: /usr/lib/postfix/smtp: bad command startup -- throttling
    Sep  4 15:48:57 web2 postfix/error[12113]: 18B6F8A8FB: to=<lkies@mysite.com>, relay=none, delay=84547, delays=84546/1.1/0/0, dsn=4.3.0, status=deferred (unknown mail transport error)
    Sep  4 15:48:57 web2 postfix/error[12113]: 18B6F8A8FB: to=<wilson@mysite.com>, relay=none, delay=84547, delays=84546/1.1/0/0, dsn=4.3.0, status=deferred (unknown mail transport error)
    Sep  4 15:48:57 web2 postfix/qmgr[27071]: warning: private/smtp socket: malformed response
    Sep  4 15:48:57 web2 postfix/qmgr[27071]: warning: transport smtp failure -- see a previous warning/fatal/panic logfile record for the problem description
    Sep  4 15:48:57 web2 postfix/master[1000]: warning: process /usr/lib/postfix/smtp pid 12153 exit status 1
    Sep  4 15:48:57 web2 postfix/error[12113]: B1FA98A8E4: to=<engineering@mysite.com>, relay=none, delay=256639, delays=256637/1.2/0/0, dsn=4.3.0, status=deferred (unknown mail transport error)
    Sep  4 15:48:57 web2 postfix/qmgr[27071]: warning: private/smtp socket: malformed response
    Sep  4 15:48:57 web2 postfix/qmgr[27071]: warning: transport smtp failure -- see a previous warning/fatal/panic logfile record for the problem description
    Sep  4 15:48:57 web2 postfix/master[1000]: warning: process /usr/lib/postfix/smtp pid 12152 exit status 1
    Sep  4 15:48:57 web2 postfix/error[12113]: B84A78A8CF: to=<inquiries@mysite-lehmann.com>, relay=none, delay=99654, delays=99652/1.2/0/0, dsn=4.3.0, status=deferred (unknown mail transport error)

I'm really not familiar with postfix and how to configure it. I can telnet localhost 25 with no problem. Can someone help me debug this?

Let me know if you need more info.

share|improve this question

1 Answer 1

I think I have seen the same kind of message ("SASL client initialization: generic failure") before and here's the configuration that is working for me. The options that made the difference are enable_starttls_auto and openssl_verify_mode.

This is the config/configuration.yml file of a Redmine installation. I am no Rails expert and am not sure whether the configuration is the same for other Rails applications - probably only for those using ActionMailer to send mails.

You can find additional information in the Rails docs: http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration

However I just found out that the openssl_verify_mode option is undocumented and some information can be found here: https://rails.lighthouseapp.com/projects/8994/tickets/6508-undocumented-actionmailer-openssl_verify_mode-option

# default configuration options for all environments
default:
  # Outgoing emails configuration (see examples above)
  email_delivery:
    delivery_method: :smtp
    smtp_settings:
      enable_starttls_auto: false
      openssl_verify_mode: 'none'
      address: your.mailserver.com
      port: 587
      domain: yoursenderdomain.com
      authentication: :login
      user_name: "username"
      password: "password"
share|improve this answer
2  
Thanks. so where exactly do I paste this configuration? In my rails app? in which file? –  Edmund Sep 4 '13 at 22:00
    
I just updated the answer –  mattanja Sep 5 '13 at 7:15
    
Thanks. Do you know what the exact path is to edit that configuration file? I couldn't find the /config directory –  Edmund Sep 5 '13 at 21:59
    
The config folder is in the redmine app root. What rails app are you using? redmine.org/projects/redmine/repository/entry/trunk/config/… –  mattanja Sep 6 '13 at 10:33

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.