ruby-on-railsemaildebianrefinerycmsexim

refinerycms inquiries cannot send email


I'm setting up a Ruby on Rails (RefineryCMS) project on a Debian 8 64bit machine. I'm using the ActionMailer in ruby to send emails. When I try to send an email using the contact us form (part of the refinerycms-inquiries plugin) I get the following error;

exim: bad -f address ""test - Company Name" \<no-reply@\>": missing or malformed local part (expected word or "<")

I have sendmail installed in the default location /usr/sbin/sendmail and I can send email on the command line like so;

echo "Test" | mail -s Testmail myemail@example.com.au

In my rails program I have set the following in my production.rb file

  # Configure the mail.
  #
  config.action_mailer.delivery_method = :sendmail
  # Defaults to:
  # config.action_mailer.sendmail_settings = {
  #   location: '/usr/sbin/sendmail',
  #   arguments: '-i -t'
  # }

  config.action_mailer.perform_deliveries = true
  config.action_mailer.raise_delivery_errors = true
  config.action_mailer.default_options = {from: 'no-reply@example.com.au'}

Update

Build a new rails project using the same version of Rails as my refinerycms app (4.2) and setup Mailer and it worked fine.

This is starting to look like an issue with the configuration within RefineryCMS Inquiries plugin itself.

Update

After linking the website to the proper domain and removing those lines above from my production.rb restoring it back to default it works.

NOTE: As I'm in Australia and have a .com.au I had to add the following to my application.rb file:

config.action_dispatch.tld_length = 2

Solution

  • It looks like you don't have a domain in your from_mail : no-reply@

    See : refinerycms-inquiries/app/mailers/refinery/inquiries/inquiry_mailer.rb