Newtonian Particle Motion
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »


    XMPP SMTP Gateway

    build status

    A xmpp gateway to send emails from your xmpp messenger.


    I needed a simple and lightweight xmpp -> smtp gateway, but could not find a good one. This module enables me to send simple emails right from my chat messenger.


    Run it

    # install it as a global component
    npm install -g xmpp-smtp-gw
    xmpp-smtp-gw configfile
    # start it from the installation directory
    node bin/xmpp-smtp-gw config/component.json
    # start with debugging
    DEBUG=* node bin/xmpp-smtp-gw config/component.json
    # This project also ships with a `Procfile` and plays well 
    # with foreman 
    foreman start 

    foreman enables you to generate upstart scripts for your node project. Further information is available at UPSTART-EXPORT


    This module delivers as a XMPP component () or XMPP s2s component. Both components behave similar.


    Be aware that it this module does not generate different content types for images. Either use inline images via data urls or use external hosted images.



    The gateway comes with jshint and mocha test. Just run

    grunt test


    The integration with prosody is tested with vagrant and Ubuntu 12.04.

    vagrant up

    This will:

    • Boot up Ubuntu 12.04
    • Install Prosody
    • Prepares Prosody to accept a component (Prosody config) or talk with an domain (bind dns config) via a server-2-server connection.

    Afterwards you need to add the following entry to your hosts file in /etc/hosts:

    Once you got this try to ping and you should see a connection to As a next step you need to configure the SMTP server in config/component.json and config/s2s.json. Just add the server and the mailbox credentials in mailer.config

    Now we are ready to prepare the XMPP messages. Configure test/client/component/message.xml and test/client/s2s/message.xml with a proper target. e.g. change romeo\ to The local part of the jid needs to be escaped according to XEP-0106: JID Escaping.

    Test the XMPP Component

    vagrant ssh
    cd /vagrant
    foreman start
    # open a new terminal and start
    node test/client/component/send.js

    Test the XMPP Server-2-Server

    # on your machine 
    DEBUG=* node bin/xmpp-smtp-gw config/s2s.json
    # open a new terminal and start
    node test/client/s2s/send.js

    Send messages from XMPP messenger

    If you would like to send emails directy from your xmpp client, configure the user with the password me in your favorite XMPP messenger and send a message to user\ (component) or user\ depending on the setup you use.

    Future features

    • Thread support


    • Christoph Hartmann
    • Sessionbird GmbH






    npm i xmpp-smtp-gw

    Downloadslast 7 days







    last publish


    • avatar