2011-11-14

Jabber with MSN transport in Ubuntu 11.10

There are several ways to install a messenger service on your own servers to provide communication to your comrades or integrate a messenger service on the Intranet page in your workplace.

Ubuntu has packages to help you out,  I'll show you here how to install the Erlang Jabber/XMPP Daemon and the MSN Transport to help your users to communicate with their contacts on the MSN Messenger network.

I'll be using the Virtual Machine created in my first post, you might want to use your own computer with Ubuntu already installed and the only difference is that you might already have the required packages installed.

Preliminaries:
  • You need a hostname to identify your server, feel free to use the IP Address of your server as it will work. Of course a Dynamic DNS entry, a conventional Domain Name System or a DNS Appliance to get a hostname will be useful if you want to provide worldwide access.
Installation:

I'll be using the IP Address 192.168.1.82 as the hostname but you need to change it to your Internal IP Address, your Public IP Address or your hostname.

  1. You need the Erlang Jabber/XMPP Daemon and the MSN Transport, to install the packages use the following:
    sudo apt-get install ejabberd pymsnt  
    
  2. Your hostname and your administration user are missing in the configuration file, edit the file with the following command:
    sudo vi /etc/ejabberd/ejabberd.cfg  
    
    Add your admin user on line 58 (remember to change the IP Address accordingly, this user does not exists yet), change the line to something like the following:
    {acl, admin, {user, "myuser", "192.168.1.82"}}.  
    
    Add your hostname on line 61 (remember to change the IP Address accordingly), change the line to something like the following:
    {hosts, ["localhost","192.168.1.82"]}.  
    
    Uncomment the lines from 165 to 170 (MSN Transport) and change the hostname, just delete the initial "%%" and change localhost, it must look like the following:
     %% MSN Transport  
     {5557, ejabberd_service, [  
                             {ip, {127, 0, 0, 1}},  
                             {access, all},  
                             {shapper_rule, fast},  
                             {host, "msn.192.168.1.82", [{password, "secret"}]}  
                             ]},
    
  3. Restart the Erlang Jabber/XMPP Daemon with the following command:
    sudo service ejabberd restart  
    
  4. Create your admin user (remember to change the IP Address as well as myuser and mypassword accordingly) with the following command:
    sudo ejabberdctl register myuser 192.168.1.82 mypassword  
    
  5. Allow port 5222/TCP through the firewall with the following command:
    sudo ufw allow 5222/tcp  
    
    Optionally, the administrator interface is available using the address http://192.168.1.82:5280/admin, use the admin user created in step 4 without the hostname, to allow the administration interface through the firewall use the following command:
    sudo ufw allow 5280/tcp  
    
  6. The Erlang Jabber/XMPP Daemon is expecting the MSN Transport to connect using the port number 5557 (as we can see in step 2) but the MSN Transport is using 5347, edit the configuration file with the following command:
    sudo vi /etc/pymsnt.conf.xml  
    
    Change the Jabber Identification on line 6 to match your hostname (remember to change the IP Address accordingly), change the line to something like the following:
    <jid>msn.192.168.1.82</jid>  
    
    Change the port number on line 24, the line should look like following:
    <port>5347</port>  
    
  7. Restart the MSN Transport with the following command:
    sudo service pymsnt restart  
    
At this point you should be able to use a Jabber Client like Psi to get access using your admin user myuser@192.168.1.82 (remember to change the IP Address accordingly), new users can register also and use the MSN Transport to get their MSN Messenger contacts in Jabber.

The secure connection is possible using a self signed certificate you can set on line 229 in the configuration file /etc/ejabberd/ejabberd.cfg, but you might want to install your own certificate if you have the experience. Even with the self signed certificate every connection can be protected using STARTTLS if the Jabber Client support this feature, a good way to keep your conversations private.

I hope this will help someone out there, please feel free to send any comments.

No comments:

Post a Comment