Sunday, January 13, 2013

Dreamhost Server Blocking Emails From Getting Sent

For anyone who has a rails project hosted on Dreamhost that sends emails this might affect you. Some time recently Dreamhost updated their security setting for sending mail through their SMTP servers and now require plain authentication to send mail through your localhost.

If your error log looks like this, you definitely need to make sure you are getting authenticated to send email.

Dec 28 17:51:16 servernuts postfix/smtpd[57430]: NOQUEUE: reject: RCPT from localhost[127.0.0.1]: 554 5.7.1 : Recipient address rejected: Access denied;
In your rails app environment files you can enable authentication:
config.action_mailer.delivery_method = :smtp
config.action_mailer.smtp_settings = {
:address => "localhost",
:port => 587,
:domain => 'foobar.com',
:user_name => '',
:password => '',
:authentication => 'plain',
:enable_starttls_auto => true }

I am not a fan of this update since one would have to put their shell account credentials in a codebase. This is a good reason to check out something like postmarkapp or sendgrid.

No comments:

Post a Comment