iTunes 10, Firefly, forked-daapd

Apple recently introduced the new version of iTunes: iTunes 10. For those, like me, who are using Firefly to broadcast their music on their local network, you may have seen that iTunes 10 does not show the content of your remote playlist anymore :-( . The bad news is that a lot of commercial products are using it (especially NAS devices like Drobo…).

Someone started a thread about that on Apple’s forum: http://discussions.apple.com/thread.jspa?threadID=2564925

One guy says to have a look to forked-daapd which is a full rewriting of Firefly. So I did. On my Debian box, a package is available in “testing”:

$ sudo apt-get install forked-daapd

Change the directory where the music is in /etc/forked-daapd.conf, restart and that’s all. Then go to iTunes, the shared library should be visible and filled with your music!

Since Firefly is a dead project (no activity for a while), everybody using it should migrate to forked-daapd.

Note: this is my 100th post on this blog!

Mail Story 2: RoundCube

In the previous “Mail Story” post, I explained how to quickly install a mail server on Debian.

Sometimes I want to check my emails but I don’t have my own computer with me, only an access to an other computer connected to the internet. So I need a webmail. For that purpose I use RoundCube, it’s an AJAX webmail written in PHP, using IMAP to retrieve emails and SMTP to send them.

Installation

In Debian, RoundCube seems not to be a very popular package, or maybe Debian people thinks the project is still too young. In fact, there is no RoundCube package for the current stable release of Debian. In “testing” there is RoundCube 0.1.1, and 0.2~stable in “unstable”. Current official release is 0.2.1.

So lets install the “unstable” package (which is quite stable as far as I know ;-) ).

First you need to add unstable repositories to APT if it’s not done already. Edit /etc/apt/sources.list and add the following lines (replace ftp.fr.debian.org with your closest mirror):

deb http://ftp.fr.debian.org/debian/ unstable main contrib non-free
deb-src http://ftp.fr.debian.org/debian/ unstable main contrib non-free

Then tell APT to keep using stable packages by default (currently the stable release is called lenny, so set the value accordingly with your system), edit /etc/apt/apt.conf.d/70debconf and add:

(…)
APT::Default-Release "lenny";

It’s time to retrieve the list of unstable packages:

$ sudo apt-get update

Install RoundCube (RoundCube needs a database, it works with MySQL, PostgreSQL and SQLite, select the one you prefer, here I’m going to use SQLite):

$ sudo apt-get install roundcube
-> Configure database for roundcube with dbconfig-common? Yes
-> Database type to be used by roundcube: sqlite
Configuration

RoundCube should be accessible at http://mailserver.example.com/roundcube/. If it’s not the case, you may need to uncomment the two Alias directives at the beginning of /etc/roundcube/apache.conf (don’t forget to reload apache configuration before checking if it works).

Now edit /etc/roundcube/main.inc.php. Each parameter has a quite explicit comment, read them. Things you may want to change:

()
$rcmail_config['enable_caching'] = FALSE;
$rcmail_config['default_host'] = 'ssl://localhost:993';
$rcmail_config['default_port'] = 993;
$rcmail_config['smtp_server'] = 'localhost';
$rcmail_config['smtp_port'] = 587;
$rcmail_config['smtp_user'] = '%u';
$rcmail_config['smtp_pass'] = '%p';
$rcmail_config['create_default_folders'] = TRUE;
()

You should now be able to login, read and send emails.

Misc

In the parameters I changed, there is create_default_folder set to TRUE. This in order to have the default IMAP folders always here (INBOX, Drafts, Sent, Junk and Trash). By default they are all protected, so they can’t be removed.

But there is no real convention on those folder names. For instance, by default Apple Mail use some different directory names. But you can tell Apple Mail to use the ones you want. First you need to select the directory ({Mailbox} in Apple Mail):

And then associate it with the right meaning:

For other IMAP clients, see the respective documentation. For instance, here is how to change the trash folder on Thunderbird.

If you have an iPhone, you only need to synchronize it again, the iPhone uses Mail.app configuration (don’t forget to check Mail Accounts in Info/Advanced/Replace information on this iPhone: in iTunes before synchronizing).

Note: since I wrote this post, Debian’s RoundCube unstable package has been updated to version 0.2.1 but testing package is still version 0.1.1.

Mail Stories posts

Using a Linux server for your Mac

Time Machine Server

One great feature introduced in Mac OS X 10.5 (Leopard) is Time Machine.

Time Machine is a backup/restore system. As a lot of backup systems it creates an incremental backup. You can create your backup to an attached hard drive, a Time Capsule or an Xserve.

If, like me, you would like to backup your Mac on a Linux server, there is a solution. It’s not perfect yet, but so far (I’m using it for a week now) it’s working quite well.

I followed the instruction written on how to create a Time Machine Server on Debian (it’s in french), which is mostly a translation of this article on how to create a Time Machine Server on Ubuntu (in english).

It’s quite easy, you just have to follow instructions. Some tips:

  • On my Debian installation there’s a problem with cracklib2-dev package, I just had to install libcrack2-dev instead.
  • Don’t copy/paste the XML file from the tutorial’s french version (the blog’s style sheet messed up the quotes).
  • If you have to manually create a sparse bundle disk image, it seems that the size is the size of your “virtual” backup drive. For instance, I have 300 GB available on my server, I selected 200 GB as image size, so Time Machine should not use all the space available on my server but restrict itself to 200 GB (I hope so, it’s not clear as Time Machine is still telling me that my hard drive is about 1.3 TB with 300 GB available, but the sparse bundle disk image is telling me that there is 200 GB with 100 GB available (I already have 100 GB of backup)).
  • On Debian, doing an update will erase your home made netatalk package. In order to prevent that you can use the following command (see Preventing Debian package upgrades):
# echo "netatalk hold" | dpkg --set-selections

I said it was not perfect because from time to time Time Machine failed while backuping, so I have to launch a new backup (ok, it’s just 2 clicks). The other problem is that my home folder is encrypted with FileVault. In that case Time Machine does not backup my home folder when I’m connected. When I logoff, FileVault do some stuff then my home folder is backuped. But now with a remote backup, the backup part is not done anymore. I have to connect with an other account and launch a backup.

iTunes Server

Like a lot of Mac users, I’m using iTunes to listen to my music. The overall software is quite good but there are several things that are just wrong. By default iTunes is only able to read mp3 and Apple‘s own audio codecs. I convert all my CDs to FLAC because it’s a lossless and open source codec.

The other problem I have is that my MacBook has a small hard drive so I can’t keep all my music on it (especially if encoded in FLAC).

The solution is to use Firefly and have it sharing my music on my local network. The music is decoded by Firefly then sent over the network, so iTunes doesn’t have to know how to decode the original file.

Installing Firefly on Debian is quite easy:

$ sudo apt-get install mt-daapd

Then edit /etc/mt-daapd.conf in order to configure it a bit. There is also a web interface to configure Firefly, connect on your server on port 3689 with your web browser (the main thing you have to set is the directory where your music is).

Now open iTunes, you should see a Firefly share in the left panel:

Some drawbacks with this method. On iTunes you only see remote playlists, so some functionalities are not working anymore (changing songs metadata, genius, sound check, creating your own local playlist from the remote one, copying a song to your iPod/iPhone (retrieving a song in local)).