14August2007

Using Google Apps Mail With Rails for Great Deliverability

Posted by gbenedict under: development; hosting; ruby on rails.

One of the rails projects I’m working on recently has been having issues sending email from our web servers. Some 80% of mail was getting marked as SPAM, despite having the reverse DNS entries, SPF record and SMTP port open to verify.

The domain we were using is hosted by Google using thier Google Apps for small business service. On a whim, we decided to try sending directly through Google to see what happened.

We used the convenient write up at Ruby Inside for sending via TLS encryption, which is required by Google. It worked like a charm and the deliverability issues went a way.

However, there is one issue with doing so. Regardless of the from address you specify, it always sends as the email address you use to login to the server. Google deliberately modifies the from address. It’s not all bad though. It protects their deliverability rates with other ISPs and keeps spam way down.

The only way around this is to run overrides in each of the notifiers you want to use a different account for auth. Had they allowed it to come from any valid account in the domain that word be much, much easier, but they don’t. Sorry kids.

One more thing I couldn’t find online, but found by trial and error was how to specify the from name when sending using ActionMailer. Most spam filters knock for not having this information. Here’s how to do it:

2 

14August2007

Auto-Generated sitemaps.xml File for Mephisto

Posted by gbenedict under: mephisto.

Mephisto (using 7.3 edge) has some nice built in atom feeds. I could not however figure out how to get a full site feed. Everything was by section. Specifically, I wanted a feed that followed the sitemaps.org specification that Google, MSN and Yahoo use to spider the site.

Kudos to Joseph Moore for doing 90% of the work. His original version used a Google version of the spec (0.84) and put everything to http://mydomain.com/sitemap/ but the spiders look for sitemap.xml unless told otherwise.

Here are the changes I made to /app/views/sitemap/index.rxml

Here are the changes I made to /app/controllers/sitemap_controller.rb to support the section lookup.

I’ve also added an additional route to lib/mephisto/routing.rb to recognize http://mydomain.com/sitemap.xml.

When I get the chance I’ll make this a plugin. Very handy.

Update:

I forgot the instruct line for the charset in the sitemap.rxml file. I’ve added it above.

3 

18July2007

This Site Is iPhone Optimized!

Posted by gbenedict under: iphone; wordpress.

I came across a great little plugin from Content.Robot that will optimize your Wordpress blog for the iPhone when it detects the user agent string.

This site is iPhone optimized!

WARNING: When you activate the plugin it sets your theme to the default Wordpress theme. You’ll simply need to go to Presentation and click to activate the theme you want.

Also, I have not tested this with wp-cache. I have it disabled so I can get cleaner stats (no admins).

0 

17July2007

iPhone Tip - Using Safari Bookmarks

Posted by gbenedict under: iphone.

I picked up my iPhone about 5 days ago and have already been compiling a listing of helpful resources.

For starters, I’ve created an iPhone folder in my Safari bookmarks that I keep iPhone sites in. iSafari always goes back to the last bookmark folder making it easy to find them quickly. Here are some of the links I have.

I also have a bunch of internal resources here so I can quickly hit our monitoring software. They are full blown web apps and not iPhone specific. They were unusable on my T-Mobile MDA (Windows Mobile 5), but work great on the iPhone.

0 

10July2007

It’s Not Just the Software Boys and Girls.

Posted by gbenedict under: apple; iphone.

I spent about 20 minutes earlier today playing with an iPhone and all of the features. Texting, email, video, audio, browsing with Safari. It works just like they show on the website.

The keyboard was very good and I even have big hands. The network was snappy (noticeably better than my EDGE based T-Mobile MDA).

However, the thing that stood out to me the most was the screen. It’s absolutely beautiful. I was watching an episode of lost in widescreen and it put my 30GB iPod to shame.

To bad they were out of stock…

0 

10July2007

Get and Set Methods in Ruby

Posted by gbenedict under: ruby.

I’m currently working on an application to take donations using Mephisto, ActiveMerchant and a custom Mephisto plugin. We’re not storing any of the credit card data in the database so I needed to extend the model to virtually include the credit card number, expiration date and card type.

In C# I would add getter and setter methods as such:

Ruby makes this much easier and really is elegant.

Beautiful isn’t it? When part of an ActiveRecord model you have full validation capabilities as well.

FYI - If you want to write plugins for Mephisto, you’ll need Rails 1.2.x+ and the edge version of Mephisto from the repository. 7.3 doesn’t have plugin capability.

0 

6July2007

Hosting Rails Apps Using Nginx and Mongrel Cluster

Posted by gbenedict under: apache; hosting; linux; mongrel; nginx; ruby on rails.

While I had never been happy with the performance of Apache, Lighttpd and FastCGI for hosting Rails, it was in fact a more pressing need that caused me to find something faster. See, there is this little known fact that FastCGI caches ranges for model validations in Rails.

But caching is good isn’t it?
Well, not in this case.

Read the rest of this entry »

10 

4July2007

It’s Time to Get Down and Get Dirty.

Posted by gbenedict under: apache; development; hosting; mongrel; nginx; ruby on rails.

I’ve decided to change my blog’s focus today. Rather I’m going to have one.

I’ve been abusing myself this week with a jet ski on beautiful Burt Lake in Indian River, MI. Between racing around bouys and reading Seth Godin’s latest book, The Dip, I decided to concentrate on what I do best: Building websites that work. Period.

This includes choosing the proper language for the job, structure, reuse, optimization and scaling when you need it.

Coming soon I’ll document my foray into hosting Ruby on Rails sites using nginx and mongrel cluster compared to Apache 2 and fastcgi. Let’s just say one of them is better than the 2nd. Alot better.

0 

15June2007

The Apple Phone Show

Posted by gbenedict under: apple; iphone.

A few months ago I expanded my podcast listening beyond TWiT and Windows Weekly to include MacBreak Weekly. Out of that show has emerged another solid podcast that should be great once the iPhone launches. The Apple Phone Show is put on by Scott Bourne and features guests like Chris Breen and Andy Ihnatko talking up the iPhone and its possibilities.

I can’t wait to see what they turn up once the iPhone is finally here! Come on 6/30!

0 

14May2007

Get a Free CFL From Yahoo

Posted by gbenedict under: uncategorized.

Yahoo has two websites for promoting green living.

First, you can register to get a free Compact Fluorescent Light bulb. You’ll also pledge to help reduce carbon emissions. It’s quick easy and free. Really, it’s not that hard!

Second, they have a site on living green. The more sites like this I read, the more compelled I feel to change.

0