News
Sep 17, 2011

Site layout and content has been updated. All sections except the Photogallery now use the new layout


scripts.suramya.com -> Email2IM

Email2IM

Introduction

Email2IM is a Perl Script that allows the user to send a message to a specified Google Talk Account by sending an email to a special account..

I created this script to be used along with the IM2Email Project so that a person without access to IM can still communicate with an IM user. At present it allows a person to talk to a gTalk account but I am planning on adding other protocols to the script so that I can be used on any chat platform.

Download Link

Download Email2IM Ver 1.0 from here

Change Log

Ver 1.0: (29th Mar 2010):

  • Initial release of the Email2IM
  • Changed the Script concept to use gTalk instead of AOL IM network instead
Installation Instructions

Prerequisites:

In order to use this script you need to have the following Perl Modules installed:

o Net::POP3
o Net::XMPP
o XML::Stream

Installing the Prerequisites:

The easiest way to install the modules is to use the CPAN module. Run the following commands as root:

o cpan -i Net::POP3
o cpan -i Net::XMPP
o cpan -i XML::Stream

If you don't have CPAN installed (I highly recommend installing it if you don't) download the modules from the CPAN website and install them manually (Instructions in the INSTALL file included in each module).

Installing Email2IM

  • Download the latest version of Email2IM from the Download link above.
  • Extract CollageGenerator from the Email2IM_vx.y.tar.gz where x.y identifies the version no. The current version is 1.0
    tar -zxvf Email2IM_v1.0.tar.gz
  • Make the script executable using the command:
    chmod a+x Email2IM.pl

Once you finish the steps above you are ready to configure the script for use. See below for Configuration instructions

Configuration Instructions

Open the script in your favorite editor and change the following variables:

$gTalk_UserName

This variable contains is the Google Talk Username that is used to send the message to the recipient. This account needs to already exist.

$gTalk_Password

This is the password for the Google Talk account used to send the message to the recipient.

$ServerName

This variable should contain the name of the POP3 server that hosts the email account you want to monitor.

$UserName

This variable containts the Userame for the email account we want to monitor. Any emails sent to this email account will be sent out as IM's

$Password

Password for the email account we are monitoring

Usage Instructions

This script basically checks the email server every 20 seconds for new emails and process any new mails found. To use it you need to run it in the background. Before running the script, make sure that you have configured the script with the correct authentication information as specified in the previous section.

To start the script issue the following command in the directory where you extracted the script:

./Email2IM.pl

If you want to put the process in the background then issue the following command instead

./Email2IM.pl &

Once the script is running, all you need to do is send an email to the account you configured in the script. The subject of the mail should contain the username to whom the IM will be sent. (For gTalk it will be something like username@gmail.com). The body of the email will be sent in its entirety as an IM

If you want to receive replies to your IM by Email then you should check out the IM2Email script

Credits

I would like to thank the following people without whose help writing IM2Email would have been a lot harder:

  • Marco Fontani: For figuring out why the standard XMPP messages weren't being sent to gTalk and the workaround
  • Creators of the Net::XMPP module for Perl
  • Creators of Perl
  • Vinit and Surabhi for their encouragement and help in testing
Updates and corrections

If you use this program make sure you let me know. It will give me a warm fuzzy feeling when I know that someone is using my programs.

If you think that any of the infomation in this section is incorrect or you would like to suggest some changes/updates please and let me know.

- Suramya
  28th Mar 2010