Personal tools
You are here: Home Linux Instant Messaging Python MSN Transport

Python MSN Transport

As built/howto for the Python MSN transport. This is installed on the same VM as the ejabberd xmpp server.

Use the RPM's in Michael Flemings repository. The EPEL repository is already installed for ejabberd support. RPMForge is required for modern python-twisted support (EPEL provides python-twisted v2.5 as of April 2009).

# rpm -Uvh
# rpm -Uvh
# rpm -Uhv
# yum --enablerepo=thatfleminggent install pymsn-t python-twisted-web python-twisted-words python-crypto

Add DNS name

Add an IPv4 DNS name for to the DJB DNS configuration.

Add firewall rules

The pymsn-t process needs to be able to connect to both the ejabberd process, and MSN services. The local process connections are via the loopback interface and should be implicitly allowed. Add a rule to allow connections out on TCP port 1863:

# msn
-A tcpOut -p tcp -m tcp --dport 1863 -m state --state NEW -j ACCEPT
# https
-A tcpOut -p tcp -m tcp --dport 443  -m state --state NEW -j ACCEPT

Configure ejabberd

Add a section to /etc/ejabberd/ejabberd.cfg to support listening for the pymsn-t service to connect to the ejabberd server. The service listens on the loopback interface only (

%% pymsn-t
{5347, ejabberd_service, [
          {ip, {127, 0, 0, 1}},
          {host, "", [{password, "ws0GVM96Gu0R7EOi8M9R"}]}

Configure pymsn-t

Copy the sample configuration file (Note: the sample below is reformatted. The default sample is great machine readable XML, but not that great for human consumption)

# cp /usr/share/doc/pymsn-t-0.11.3/config-example.xml /etc/pymsn-t/config.xml 

The following changes are made to the configuration:

  • change the 'jid'
  • change the 'host' and 'secret' (secret is the same fake one in the ejabberd config as above)
  • fill in the website
  • list the lucid solutions admin account as an admin account
  • setup the debug logging, but set the level to zero
<     <jid>msn</jid>
>     <jid></jid>
<     <host></host>
>     <host></host>
<     <secret>secret</secret>
>     <secret>ws0GVM96Gu0R7EOi8M9R</secret>
<     <website></website>
>     <website></website>
<     <!--
<         <jid></jid>
>       <jid></jid>
<     -->
<     <!-- <debugLevel>0</debugLevel> -->
>     <debugLevel>2</debugLevel>
<     <!-- <debugFile>debug.log</debugFile> -->
>     <debugFile>/var/log/pymsn-t/debug.log</debugFile>

Enable the service and start it:

# chkconfig pymsn-t on
# service pymsn-t start
Use your favourite jabber client to configure the MSN transport.


  • Test/implement file transfers. No support for file transfers on TCP 8010 has been enabled through firewalls or NAT



yum install pymsn-t

Dependencies Resolved

 Package                        Arch            Version                     Repository                Size
 pymsn-t                        noarch             thatfleminggent          471 k
 python-twisted-web             x86_64          8.1.0-1.el5.rf              rpmforge                 622 k
 python-twisted-words           x86_64          0.5.0-3.el5                 epel                     553 k
 python-crypto                  x86_64          2.0.1-4.el5.1               epel                   195 k
Installing for dependencies:
 gmp                            x86_64          4.1.4-10.el5                base                   201 k
 PyXML                          x86_64          0.8.4-4                     base                     1.1 M
 python-fpconst                 noarch          0.7.3-3.el5.1               epel                      15 k
 python-soap                    noarch          0.11.6-1.el5.rf             rpmforge                 291 k
 freetype                       x86_64          2.2.1-20.el5_2              base                     311 k
 libjpeg                        x86_64          6b-37                       base                     139 k
 pyOpenSSL                      x86_64          0.6-1.p24.7.2.2             base                     120 k
 python-imaging                 x86_64          1.1.6-2.el5.rf              rpmforge                 778 k
 python-twisted-core            x86_64          8.1.0-1.el5.rf              rpmforge                 2.5 M
 python-zope-interface          x86_64          3.0.1-10.el5                epel                     231 k

Default configuration

        This file contains options to be configured by the server administrator.
        Please read through all the options in this file

        The JabberID of the transport

         The public IP or DNS name of the machine the transport is running on
         This is needed for file transfer!! This is also used as the IP address
         for outgoing connections

         The component JID of the transport. Unless you're doing clustering,
         leave this alone
    <!-- <compjid>msn1</compjid> -->

         The name of the transport in the service discovery list.
    <discoName>MSN Transport</discoName>

        The location of the spool directory.. if relative, relative to the
        PyMSNt dir. Do not include the jid of the transport

        The location of the PID file, relative to the PyMSNt directory

        If set, the transport will background itself when run
    <background />

        The Twisted reactor to choose. Pick poll or epoll on Linux, kqueue on
        BSD. Or leave as default (best found)
    <!-- <reactor>poll</reactor> -->

        The IP address of the main Jabber server to connect to

        The TCP port to connect to the Jabber server on (this is the default
        for Jabberd2)

        The authentication token to use when connecting to the Jabber server 

        Use's XCP component protocol extensions. 
    <!-- <useXCP/> -->

        The default language to use 

        The website of the Jabber service 

         Comment out the following options to disable them, or uncomment them
         to enable them Send email notification messages to users
    <mailNotifications />

        Send greeting on login 
    <!-- <sessionGreeting>You have just started a session with PyMSNt</sessionGreeting> -->
        Send message on successful registration 
    <!-- <registerMessage>You have successfully registered with PyMSNt</registerMessage> -->
        Allow users to register with this transport 
    <allowRegister />

        Get all avatars. If this is set to true then avatars are grabbed for 
        all your contacts immediately. If false then avatars are only grabbed 
        when you're in a chat with a contact 
    <getAllAvatars />
        The amount of time a user has to join a groupchat they are invited to 
        before the transport makes them leave the room. (MSN protocol requires 
        autojoining of groupchats) 
    <!-- <groupchatTimeout>120</groupchatTimeout> -->

    <!-- File transfer settings -->
        The maximum size of a file transfer (in bytes). For unlimited, comment 
        out, or set to 0 
        The maximum rate for file transfer (in bytes). For unlimited, comment 
        out, or set to 0 
    <!-- Please give the port to listen for Jabber socks5 transfers on. -->

        Please give the port to listen for HTTP GETs here (Used in old-style 
        OOB file transfers. Best to leave this disabled unless you know you 
        need it.) 

         Please give the root URL the transport should send to clients. (You 
         can use an Apache reverse proxy to put this on your ordinary website) 
         Eg, the transport will listen on port 8011 for HTTP GETs to 
         /RANDOM_FILE.ext. You can set apache to forward any requests to  to  This saves you from opening 
         extra ports. 

        You can choose which users you wish to have as administrators. These
        users can perform some tasks with Ad-Hoc commands that others cannot

        Log settings.

        The logging level
        0 -> No logging
        1 -> Log tracebacks
        2 -> Log tracebacks, warnings and errors
        3 -> Log all sorts of informational (mostly useless stuff)
        4 -> Log the MSN protocol code sent
    <!-- <debugLevel>0</debugLevel> -->

        The file to log to. Leave this disabled for stdout 
    <!-- <debugFile>debug.log</debugFile> -->


Related content
Document Actions