PDA

View Full Version : Rails' ActionMailer and OCS hosted domain


iansmith
December 31st, 2005, 11:03 PM
I'm running a rails program on my home linux box and trying to use an OCS-managed domain to send email. Does anyone have a working ActionMailer configuration that works for this case (SMTP to OCS) for sending? I get no errors and my rails application puts the content sent into its log file as it was sucessful. I suspect that OCS thinks that my program is a spammer (and I'm not complaining about this). Here's the configuration I was trying to use:

ActionMailer::Base.server_settings = {
:address => "mail.mydomain.net",
:port => 25,
:domain => "mydomain.net",
:authentication => :plain, #tried login as well
:user_name => "iansmith",
:password => "itsasecret"
}

According the display given by cpanel (configuring a mail client) it looks to me that this should work...

Thanks.
ian smith

rob
January 1st, 2006, 03:40 PM
Just take out or comment this entire section. We recommend (and its been tested to work and used in production all the time) to just use the sendmail method by default.

Taking this out or commenting it out will fix your problem.

iansmith
January 2nd, 2006, 01:31 AM
Thanks for your reply Rob.

I did eventually discover that you *can* use the SMTP method of delivery with OCS (although Rob discourages it) if you make sure that you are sending the mail from an account that actually has a mailbox your domain. The SMTP server on the OCS side is smart enough to check this and it was what was breaking my code. This can be useful if you have a home machine that use for development but you plan to use OCS for deployment.

rob
January 2nd, 2006, 04:50 PM
Tis true, I guess the secret is out ;)

Actually, the reason I recommend not using SMTP is just for simplicity sake. However, using the SMTP method above does work OK too.