First start at publishing my simple Jabber to SMTP back to Jabber bridge

All files are here or you can just get the tarball of the 2 programs and one config file here

I would like to have people / programs communicate to me via Jabber and not require them to understand Jabber. Since everything can send email I thought I would write a bridge.

How it works:
There are two processes here for the two way commmunication.
1) SMTP -> Jabber is accomplished by running a program on your mail server / client that can talk to the Jabber server. It just pipes along the mail body as the body of the Jabber message and sets the "From" to a Jabber address that's really an alias for some later SMTP commands.
2) Jabber -> SMTP is accomplished by sending a jabber message to '' ... a service on the Jabber server (ie like Jud / Users) is keyed off by the 'jsmtp' part and sends it off to another service which processes the message and then sends it off to an SMTP server to the address ''
Pretty easy, huh? There isn't much too it. I tried to use the other jsmtp package out there but it tried to include a mail server, and I didn't need that. Let the mail server do its job and let the jabber server do its. Just make some glue.

The two programs:
The first program is the SMTP -> Jabber bridge. Its not the best from a security standpoint as you have to have it know the "smtp" username and password in order to send off email. Since anyone could find that out by looking at the code that could be considered a risk. See below for more comments.
That program is available here. You run it and pass along as STDIN your entire email message. In qmail that's done like this, if you want email sent to "" to go to your jabber account:

cat .qmail-j
| /usr/local/bin/
That's it. It looks to a .jsmtp file to see who to then send it off to, matching on the 'to' address. The file looks like this:
        <match email="username-j">
        <match email="username-dummy">

Jabber -> SMTP
A little more difficult, you have to include a "service" in your jabber.xml file that looks like this:

         <service type="jsmtp" jid="" name="JSMTP - Jabber SMTP mail services">

   <service id="jsmtp">

This tells Jabber to send any messages to to the listener on The person listening on that port has to know the secret word. I've found that it has to stay continuously connected to that port in order for it to work.
You then call this program and pass it along --config configfile.xml here to tell it how to process an email, where the mail server is, etc.

That's it! I'll update these docs frequently. Send me email at cwilkes-jabber for questions.