I’ve got restful_authentication installed from technoweenie with the activation feature enabled. The plugin generated a UserMailer class that extends ActionMailer::Base, but I’m struggling to configure it properly with Gmail’s SMTP service.
The documentation doesn’t clearly explain how to handle Gmail’s TLS requirements. I think the SMTP configuration should go in my environments/development.rb file, but I’m not completely sure about the correct settings for Google’s mail servers.
Has anyone successfully configured email activation with restful_authentication using Gmail SMTP? Here’s what I’ve tried adding to my environment file:
Had the same SSL headaches with Gmail SMTP. You’re missing proper TLS handling. Drop :enable_starttls_auto => true and use :tls => true with :enable_starttls_auto => false instead. Gmail’s SMTP gets weird with starttls negotiation on older Rails versions. Double-check you’re using a Gmail account with SMTP access enabled - corporate accounts often block this. Try port 465 with SSL instead of 587 with TLS. Works better on some hosting setups. The restful_authentication plugin doesn’t care about transport anyway, so get ActionMailer talking to Gmail first.
Your config looks mostly right, but there’s a Gmail auth gotcha that cost me hours on a similar setup. Gmail blocks regular password auth by default now. You need an app-specific password from your Google account settings instead of your regular Gmail password. Go to Google account security, enable 2FA if you haven’t, then create an app password for your Rails app. Swap your regular password for this generated one in smtp_settings. Also check that your :domain matches your actual domain, not the placeholder. Had this exact issue with restful_authentication last year and this fixed it instantly.
check your firewall settings - some ISPs block outbound SMTP traffic on port 587. this bit me once with a restful_auth setup. test with telnet first: telnet smtp.gmail.com 587 to see if the connection works. if that fails, it’s not your rails config that’s broken.