Skip navigation.
Home

Full Stack: MSN, AIM/ICQ, and Yahoo! in iChat via Jabber server on Debian

I wanted to use iChat as my universal chat client on my mac. iChat has native connectivity available for Bonjour, AIM and Jabber but not MSN, Yahoo! or ICQ. How could I use it then to communicate with those services? Easy.. hook up to a jabber server that has the appropriate legacy gateways enabled.. yeah real easy..Eye-wink

The gameplan

  1. Learn a little bit about jabber. I don't really know anything about it, except that google uses it for talk.
  2. Register with a server that can act as a gateway to MSN, ICQ, and Yahoo! messaging.
  3. Deal with unanticipated iChat related problems.

Now I have been around the block (so to speak) enough to know that integration of systems and software is hardly ever pain free. The pain usually comes in the form of having to learn a fair amount (admin level knowledge) about every single piece of the puzzle. This effort was no exception.

Jabber

I started to research jabber and how it works and found that it seems to operate in a way similar to email. It is decentralized, with each server controlling messages sent to the subscribers/users who have registered with a server. Each server has as set of advertised services/transports that registered users can sign up for (e.g. MSN, AIM). Most of the jabber servers out there (like google talk) only let you use the jabber transport. I know that is over-simplified, but it was enough information for me to make my next decision.

Something else I learned was that iChat was not a full-featured jabber client. In order to really setup jabber on the client side I needed to get a real client. Psi seemed to be mentioned the most in the articles that I was reading, so I downloaded it. After getting Psi, I was able to register with a few jabber servers out there and check to see if they offered the legacy gateway services. None of the big servers out there seemed to support them.. but I didn't look super hard. During that search something hit me.. why involve a third party at all? I mean there is a fair bit of trust involved in that.. the gateway server would know my password for each service and I would be dependent upon it for uptime. I decided to change course and install my own jabber server at home.

New gameplan

  1. Install Psi on my mac.
  2. Install jabber server on my microclient server currently running Tor server.
  3. Install ICQ, MSN and Yahoo! transports.
  4. Point Psi at the new server and see what happens.
  5. Get iChat to work.

The implementation

Psi

Installing Psi was a piece of cake (on OSX) and isn't even worth mentioning. Step #1 complete.

Jabber server

The server I am installed psi on is a Debian Sarge box. These instructions are specific to that OS.

Download and install the packages.

lowpower:~# apt-get install jabber jabber-jit jabber-msn jabber-yahoo
Configure the server.

lowpower:/etc/jabber# vi jabber.cfg

JABBER_HOSTNAME=yourservername.dyndns.org

lowpower:/etc/jabber# vi jabber.xml

Follow these instructions using the hostname you just specified in previous step
    <!--
    Replace all occurrences of "localhost" in this file by
    the hostname of your Jabber server. Be aware changing
    the server's name is all but impossible once users start
    to use the server. So choose a name that is permanent
    (especially no Intranet hostnames or IP addresses).
    -->

Configure dynamic dns

Since I am doing this from my home pc and I do not have a static ip address it is difficult to have a dns name. Thankfully there are a few solutions out there to address this problem. I use Dynamic DNS for this purpose. It is free and my router (Linksys WRT54GX) already supports doing automatic updates to the service when my IP address changes. Just make certain if you use this service you have checked Enable Wildcard. Essentially this box will send any request addressed *.yourservername.dyndns.org to the configured ip address. If you use something other than dyndns.com make sure it has this capability.

Configure your firewall

In order for jabber to work fully out of the box, I opened inbound ports 5222-5223 (for client connections) and 5269 (for server connections).

Start jabber


lowpower:/etc/jabber# /etc/init.d/jabber start

Starting jabberd: jabberd.

lowpower:/etc/jabber# tail -f /var/log/jabber/error.log
20060827T04:01:12: [notice] (-internal): initializing server
20060827T04:01:12: [alert] (-internal): Jabberd started.

If you see some errors and the jabber server doesn't start, you messed up the config file your server isn't reachable at the hostname that you have specified.

Connect to jabber server

Point psi at your server and see if you can register. Here's a good resource that has screenshot detail about how to do that. Here's the basics though:

  1. Menu bar -->General --> Account setup.
  2. Click Add button.
  3. Give it a friendly name (doesn't really matter).
  4. Check Register.
  5. Click Add button.
  6. Give yourself an id whateveryouwant@yourservername.dyndns.org.
  7. Click Register.
  8. After you do this you should see the friendly name in step #3 in the Psi window.
  9. Menu bar --> Status --> Online.

This should log you in and the little start by the friendly name should go to yellow (or green.. I can't tell color blind) instead of dark grey.

Configure legacy transports

I used an existing guide to help me configure the legacy transports. The nice thing about the Debian package based install is that all of the xml files are already on the box in the correct locations (no need to make them from scratch). All you need to do is uncomment some xml and restart the server. The biggest pain was actually figuring out what the hell was going on in jabber in general.. I found myself wondering how do all of these xml files relate to each other?


lowpower:/etc/jabber# ls *.xml
jabber-jit.xml  jabber-msn.xml  jabber.xml  jabber-yahoo.xml

Here's what I figured out.. The main full jabber server (previously configured) uses jabber.xml. The trick is that each transport runs its own mini jabber server with its own config file (e.g. Yahoo! uses jabber-yahoo.xml). So each transport has its own process. The catch is that certain things in the mini server config files must exactly match the full server config file. This decoupling of the gateway mini server configs from the full server undoubtedly exists because the gateways might not even be running on the same server as the full server... decentralized network indeed.

First things first configure the full server to enable the discovery of these other transports/services.


lowpower:/etc/jabber# vi jabber.xml

Uncomment the settings.. and add whatever is missing..

  <!--
  The following services are examples only, you will need to
  create/modify them to get them working on your Jabber
  server. See the README files for each service and/or the
  server howto for further information/instructions.
  -->

  <service type="aim" jid="aim.yourservername.dyndns.org" name="AIM Transport">
    <ns>jabber:iq:gateway</ns>
    <ns>jabber:iq:register</ns>
  </service>

  <service type="yahoo" jid="yahoo.yourservername.dyndns.org" name="Yahoo! Transport">
    <ns>jabber:iq:gateway</ns>
    <ns>jabber:iq:register</ns>
  </service>

  <service type="icq" jid="icq.yourservername.dyndns.org" name="ICQ Transport">
    <ns>jabber:iq:gateway</ns>
    <ns>jabber:iq:register</ns>
    <ns>jabber:iq:search</ns>
  </service>

  <service type="msn" jid="msn.yourservername.dyndns.org" name="MSN Transport">
    <ns>jabber:iq:gateway</ns>
    <ns>jabber:iq:register</ns>
  </service>

Down toward the bottom of the file.. same deal uncomment and modify

<!--
  If you identified additional agents in the main <service/>
  section (see examples above), you'll need to define each
  of them here using a separate <service/> section for each
  <agent/> you identified. Note that the <agent/> sections
  determine what gets shown to clients that connect to your
  server, whereas the following <service/> sections define
  these services within the server itself. The following are
  examples only, you will need to create/modify them to get
  them working on your Jabber server. See the README files
  for each agent and/or the server howto for further
  information/instructions.
  -->

  <service id="aim.yourservername.dyndns.org">
    <accept>
      <ip>127.0.0.1</ip>
      <port>7009</port>
      <secret>remember-whatever-you-put-here</secret>
    </accept>
  </service>

  <service id="yahoo.yourservername.dyndns.org">
    <accept>
      <ip>127.0.0.1</ip>
      <port>9001</port>
      <secret>remember-whatever-you-put-here</secret>
    </accept>
  </service>

  <service id="msn.yourservername.dyndns.org">
    <accept>
      <ip>127.0.0.1</ip>
      <port>5557</port>
      <secret>remember-whatever-you-put-here</secret>
      <timeout>30</timeout>
    </accept>
  </service>

  <service id="icq.yourservername.dyndns.org">
    <accept>
      <ip>127.0.0.1</ip>
      <port>5555</port>
      <secret>remember-whatever-you-put-here</secret>
      <timeout>30</timeout>
    </accept>
  </service>

Now for the tricky part (at least it was for me)..


lowpower:/etc/jabber# vi jabber-yahoo.xml

Modify this line.. make sure same id as in <service/> in jabber.xml!

   <service id="yahoo.yourservername.dyndns.org">

Make sure that the <connect/> section below EXACTLY matches the 
<accept/> section in jabber.xml!!!

   <service id="yahoolinker">
      <uplink/>
      <connect>
         <ip>127.0.0.1</ip>
         <port>9001</port>
         <secret>remember-whatever-you-put-here</secret>
      </connect>
   </service>

Repeat for jabber-msn.xml and jabber-jit.xml files.

Restart jabber


lowpower:/etc/jabber# /etc/init.d/jabber restart

Stopping jabberd: jabberd.
Starting jabberd: jabberd.
Starting jabber-jit: jabber-jit.
Starting jabber-msn: jabber-msn.
Starting jabber-yahoo: jabber-yahoo.

Register for new services

  1. Open Psi again and set yourself Online for your jabber server.
  2. Menu Bar --> General Service Discovery --> Friendly name
  3. You should see all of the transports that you enabled.
  4. Register for each of them.

If you can't register, the config files don't match.. check the and in the jabber-transport_that_isnt_working.xml file and make sure they match the jabber.xml config file.

Configure iChat

Once you register for each of the services in Psi, you should be presented with all kinds of authentication messages about who can view whose status, etc. I accepted them all.

Then I opened iChat and created a new Jabber account (iChat --> Preferences) using the server id I had registered with in Psi previously. All of my contacts magically popped up using this kind of format.. matthew.fleming%gmail.com@msn.yourservername.dyndns.org (an MSN contact). Since iChat is integrated with the address book.. you can highlight one of those nasty names and go to Menu Bar --> Buddies --> Get Info. From here you can use an existing entry in the address book (and it will update it) or create a new entry in the book with a more friendly name.

parser probs

I have done like u sayed. But i cant register. The is right. but when i start jabber it doesnt work. i tryed "jabberd -c /etc/jabber/jabber-jit.xml", because of the parser. And he says "not well-formed (invalid token) at line 45 and column 4". whre is the problem? can someone help me pls? tks