eddorre

Webmail for Linux

September 02, 2007 — 0 Comments

Ever since I got rid of Exchange Server as my email server I’ve been sans webmail client.

For a time, this didn’t bother me. I’ve been able to read my email remotely using IMAP (although that’s not really secure) but sending email remotely was an issue. To overcome this, I setup OpenVPN to securely connect to my network (and therefore my email server) at home.

Eventually, I set up the same OpenVPN connection for Dear GF on her work computer so that she could read email and send it as well.

While this worked, it was clunky. To complicate matters, Dear GF got another job at another company where installing the OpenVPN client is out of the question.

So it was time that I started looking at webmail clients for Linux. I had two in mind. Squirrelmail and Roundcube.

I loaded up Debian on a virtual machine on my Mac (using Parallels) and gave Squirrelmail a shot. The install is easy. Install a web server (I used Apache2), PHP, and then run the command “aptitude install squirrelmail” and it’s installed (well you do have to configure Apache2 to point to squirrelmail, but I digress).

The beauty of this is that it’s a Debian Stable supported package and that means that any security vulnerabilites that are found in the future are automatically back-ported to the stable package. In short, you don’t have to worry about security as long as you are installing the updates from Debian.

The client is also very stable and works like a charm but it’s very, very mid-1990s web application. This was before people started caring about <abbr title=User Interface">UI, design, and before AJAX was even invented. I could use it, but I wouldn’t like it. With that, Squirrelmail was out.

So I took a look at RoundCube. At first, I was a little hesitant about it because it requires more than just a web server and the software itself. It requires a database server (either MySQL, Postgres, or SQLite) and in addition to that, it’s not a Debian Stable supported package. You can’t just install it using aptitude and you have to pay attention to security updates and apply them separately. I was having my doubts about it.

Eventually, I decided to test it out and install it into another virtual machine. The install is definitely more complicated that Squirrelmail, but if you’ve installed software on Linux before (without automated tools) then it’s really not that difficult.

Here are the steps that I followed (from a clean Debian install):

Installing Necessary Software to Support Roundcube

Note: I’ll assume that your IMAP server and MTA are on another machine or they have been already installed properly.

  • Remove Apache 1.2 if installed
    • aptitude purge apache
  • Install Apache 2
    • aptitude install apache2
  • Install MySQL Server (5)
    • aptitude install mysql-server-5.0
  • Install PHP5
    • aptitude install php5
  • Install php5-mysql
    • aptitude install php5-mysql (this isn’t in the docs, but without this, I could never connect to the database)

Installing Roundcube

  • Create a “roundcube” directory at /var/www/
  • Download roundcube stable from their website. I downloaded the tar file
  • Unpack the contents of the folder to /var/www/roundcube
  • Remove the .dist extensions from the files in /var/www/roundcube
  • Create a database called roundcube in MySQL
    • CREATE DATABASE roundcubemail DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
    • GRANT ALL PRIVILEGES ON roundcubemail.* to roundcube@localhost INDENTIFIED BY ‘[password]’; (obviously you’ll want to supply a good, secure password to that user)
  • Import SQL script to create database tables
    • mysql roundcubemail < /var/www/roundcube/SQL/mysql5.initial.sql

Setting up Apache

Since this will be accessed over the Internet, I want to use SSL instead of plain old HTTP.

  • Create an self-signed SSL certificate
    • openssl req $@ – new -x509 [number of days] -nodes -out [path to file ] -keyout [path to file] (note: This requires OpenSSL to be installed (aptitude install openssl))
  • Have Apache listen on port 443 instead of port 80
    • Edit /etc/apache2/ports.conf and replace “Listen 80” with “Listen 443”
  • Enable SSL Support in Apache
    • a2enmod ssl
    • /etc/init.d/apache2 force-reload
    • /etc/init.d/apache2 restart

Configuring Apache website for SSL support

In your Apache web site config, you’ll want to have these values listed (in addition to the rest of your config):

  • SSLEngine on
  • SSLCertificateFile [path to file] (use the same [path to file] as when you used to generate the SSL certificate

Configuring Roundcube

  • Point Roundcube to the database
    • In the file /var/www/roundcube/config/db.inc.php change the database connection value:
      • Example: $rcmail_config[‘db_dsnw’] = ‘mysql://roundcube:[password]@localhost/roundcubemail’;

You’ll also want to setup your mail server options in the main config file (/var/www/roundcube/main.inc.php), but these are self explanatory, so I won’t detail them.

With that, you should have a valid working RoundCube install that’s available over HTTPS.

RoundCube isn’t perfect, but it’s still being actively developed and it addresses my needs. It’s gonna work for me (and Dear GF).

Linux to Xbox 360 Audio and Video Streaming

September 04, 2007 — 0 Comments

I’ve been wanting to build a file server that would centralize all of my media files so that I could play them from anywhere on my home network. In the old days, I would have picked a version of Windows Server as the Operating System for the PC, but I’ve been steadily moving forward with plans to go Windows free and that wouldn’t have fit in the plans.

Since I’ve standardized all of my other servers on Debian Linux, I decided that I would do the same for the new file server as well. During the time that I was buying components for the new PC, I bought an Xbox 360 Elite to go with our new HDTV (Sharp Aquos 46").

Shortly after, I found out that you could stream audio and video to the Xbox using XP or Vista. “Well, damn”, I thought to myself. “I might have to go with Windows after all.” However, one look at the price of Windows Vista or Windows Server changed my mind. I started researching alternatives that would work on Linux.

It turns out that all you need is software that provides UPnP media devices (which the Xbox is) with information on available multimedia files and there are plenty to choose from.

Xboxmediacenter.com has a list of both commercial and free offerings on their site under the entry of UPnP Sharing.

After a bit of research and some trial time, I decided on TwonkyVision’s TwonkyMedia software. While the software is not free, at 29.95 € (euros) it’s something that is palatable to my financial tastes.

The DLNA certified software runs on Mac, Windows, Linux. It also supports a large number of media formats and it’s easy to install on Linux. In addition to that, it comes with a web-based administration console making a snap to add your media.

There are some issues that I’ve experienced. First, it doesn’t seem to work in a routed environment. I think that this might be more of an issue with the UPnP protocol than the software itself though.

I have also encountered some buggyness streaming music to the Xbox. Songs appear to keep playing but no sound comes out and eventually (if left to its own devices) the Xbox will start periodically making a horrible buzzing sound. With that being said, I haven’t ascertained if that’s related to the Xbox itself, my wireless network dropping the stream or the actual TwonkyMedia software.

I did make one modification that seems to have alleviated the issue. In the web-based console, I changed the buffer size from 16384 (the default value) to 96000.

Overall, I’m pretty pleased with the software and I’d recommend it to anyone that is looking for a low-cost, Linux based UPnP server.

Gone in a Flash

September 10, 2007 — 2 Comments

Summer time is almost coming to an end. I’m not sure if I can remember when it started and now it’s already ending. You could say that it’s gone in a flash.

Speaking of flash, Sci-Fi channel’s new remake, Flash Gordon, is rumored to have gotten the axe. It’s not surprising considering that the show has been universally panned by fans and critics alike.

I was originally going to write a review on how horrible this show is, but when I read DBCooper’s review, I knew that I had nothing else to add.

Price Hiding

September 10, 2007 — 0 Comments

Content is king; especially on the web. Without meaningful content your site fails at its primary objective; to give your users information. With this in mind, I’m still shocked to see some companies that break this cardinal rule by “price hiding.”

The art of price hiding usually consists of replacing the actual price of an item with something that reads “Call for Price” or a web form that contacts their sales department. I’ve seen this pervasively on software companies’ websites and I’ve even seen this at a local gym.

I’m not sure how these shenanigans are justified when putting together a web presence. Look, if you’re too embarassed to put your pricing up on your website and you’re relying on the jockeying of your sales department to get your product sold, then something is terribly wrong.

Anyone that is serious, really serious about your product or service can easily handle the price. Those that aren’t will run for the hills screaming and that’s fine because they weren’t going to buy or use your service anyway.

I’ve demoed more software than I care to admit to. I’ve had significant input (if not the sole input) to buying decisions that cost thousands, tens of thousands and even hundreds of thousands of dollars. If your website hides the price, I’ll assume that your company is hiding something and I’ll immediately move on.

The solution is simple, be open and honest with your potential customers. Give them as much information as possible on your website to empower them to make informed buying decisions.

Good Ol’ Cheney

September 11, 2007 — 0 Comments

Cheney/Satan '08

I was sitting in traffic on my way home and I noticed the bumper sticker. I’m don’t usually get a chuckle out of bumper stickers but I thought that this was pretty clever (and probably not that far off from the truth).

You can get that sticker and more by visiting this site.

The iPhone Ringtone Debacle

September 13, 2007 — 3 Comments

I’ve always been confused by the whole ringtone business. The notion of paying $2.50 or more for a 15-30 snippet of song, which you may already own, is absurd.

Last week, Apple threw their hat into the ringtones extortion racket with the release of iTunes 7.4.

In order to get ringtones onto your iPhone (from iTunes) you have to first buy the original song and then on top of that you have to pay for the ringtone for an additional 99 cents. In addition to these restrictions, not all the songs from iTunes are available for ringtone download and probably worst of all, if you want to create a second ringtone using a different part of the same song for which you’ve already paid for you have to pay again.

Rather than regurgitate what’s already been written on the Internet regarding this subject, I’ll point you to John Gruber’s complete treatise on the this subject in his article The Ringtones Racket_racket.

The entire article is brilliant but one of the best parts is:

The distinction between ringtones and songs is an artificial marketing construct. It is a misconception, albeit a widely held one, that there is any foundation in copyright law for this, i.e. that an honest consumer is obligated to pay for ringtones separately from “regular” songs for some legal reason. Not so. Copyright attorney Nilay Patel dispelled this notion last week in a piece at Engadget. Patel points out that, oddly enough, even the RIAA agrees:

Well, the RIAA wanted to be able to distribute ringtones of its artists without having to pay them big money to do so (surprised?), and it won a decision last year before the Copyright Office saying that ringtones weren’t “derivative works”, meaning they didn’t infringe on the copyright of the songwriter.

So if you have the right to play a song, you have the right to use it as a ringtone on your phone. There’s no reason to feel one iota of guilt about using tools like MakeiPhoneRingtone or iToner.

Digital Music Archive

September 15, 2007 — 2 Comments

Now that I have a Linux file server with Samba up and running, I’ve decided to tackle the next project; ripping my 500+ CDs and putting them in a digital archive. I honestly don’t know how many I actually have, but I think it’s somewhere to close to 500.

I had two goals when I started the project. First and foremost, I was tired of not have all my music at the tips of my fingers when I was either at my computer or downstairs. Second, was to liberate my office from the space that two huge CD racks were taking up.

I’m not going to sell them like some people do when they digitize their music, but I fully intend on boxing them all up (maybe with the exception of a few display CDs) and putting them in storage.

It’s certainly a time consuming task and not something that you can do in a weekend but I know the end goal will be worth it. I can now finally see the end of the tunnel. I’ve just completed CD number 376. Only 130 or so to go…

Digital Music Archive Completed

September 23, 2007 — 0 Comments

I’ve finally finished ripping my CDs to my file server. I finished yesterday afternoon which makes my estimation of twelve days spot on. The final count: 537 CDs ripped and approximately 56 GB of music, but that’s not all of my CDs. So what gives?

Well, there are three CDs that are missing, meaning that I have the cases but I can’t find the CDs. I’m sure that they are around here somewhere because I recall seeing them recently. So I’m sure that they will turn up. Then there are 17 that were damaged or destroyed during The Dark Times. Unfortunately, I’ll have to replace these. So I’m done for now.

Now that I have everything ripped to my file server, I did the prudent thing and copied all of the music to my external backup drive just in case the main drive of the file server fails.

Removing Old Rails Session Files

September 23, 2007 — 0 Comments

I’m sure that this is elementary for all of the *nix experts out there but I recently discovered this and thought that I would share. Ruby on Rails, by default, holds session information on disk in [application root]/tmp/sessions/ and unfortunately they aren’t purged automatically. Even for small sites, the number if session files can quickly grow out of control. For large sites, it can bring an application server to its knees by filling up the disk.

The “best practice” for Rails sites is to use the database to keep track of sessions using following commands:

  • ruby script/generate session_migration
  • rake db:migrate

Then uncomment the line in the environment.rb file that reads: config.action_controller.session_store = :active_record_store

If you’ve completed the above steps, then your sessions should now be stored in the database but that doesn’t remove the session files from disk. If you’ve been running with sessions on disk for a while, the command, rm /[application root/tmp/sessions/ruby_sess.* will fail with the error “Argument list too long”. If this happens, you can delete the files by running the following command:

find /[application root]/tmp/sessions/ -name ‘ruby_sess.*’ | xargs rm

I found this little gem of information at ducea.com. The comments have other commands that you can run to delete mass files if necessary.

Wowie Zowie, Amazon!

September 25, 2007 — 2 Comments
  • Tagged with:

The ever adept Mac and technology blogger, John Gruber, has published an article titled The Amazon MP3 Store and Amazon MP3 Downloader. In the article, he gives the store and the software a complete, thorough review but the short and sweet of it is that Amazon has just unveiled their new Amazon MP3 store.

The store (url: www.amazonmp3.com/), has over 2 million songs in its library and has a selection of 180,000 artists and over 20,000 labels. Most individual songs are priced between 89 and 99 cents. Entire albums are marked between $5.99 and $9.99.

None of this is really noteworthy. Apple’s iTunes has more artists, labels, and songs and is priced similarly. The standout feature of Amazon’s store is the fact that ALL of their songs are completely DRM free without an additional cost. That’s right, no DRM whatsoever. Use it on any device you want, anytime.

This could be the first real contender that iTunes has ever seen.