Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Email Event Listener

Status
Not open for further replies.

jrottman

Programmer
Jun 17, 2005
47
I am working on a app that requires an event listener for my email server. I have created teh app in java previously but the app is just to bulky. I was given the idea to re-create it in app in perl to help trim up some of the memory usage. Thus far everything has worked like a dream.

The one issue that I can't seem to figure out is how to create an event listener for a specific protocol. Mainly Pop3. Ideally the listener will connect to the server, and listen for any new email being received on a specific account, if an email comes in it will automatically start next steps in the chain.

Anyone know where I can find an example of a pop3 event listener.
 
Well I am not using java anymore, when I was using java to do this I was using JavaMail. I am trying to find something similar to JavaMail for perl.
 
I'm not totally sure of the full capabilities of using Net::pOP3, but have you had a look at using that module?
 
Well Net::pop3 is just one part of my equation. I need it to collect the mail. However it does not have monitor functionality.
 
Okay, i'm definately not the best person to help unfortunately. However I have one more suggestion, which could be to use automating form submission, which can be used to check when something new appears on a webpage. In a different context for example, it can notify you when a new book with a particular keyword(s) appears. I don't think this is what you want (because I don't think it will automatically let you know) but take a look anyway (either LWP::Simple or LWP::UserAgent).

Sorry I couldn't be of help
 
Why "listen".. why not just connect every minute.. or every 30 seconds.. or whatever? You wouldn't really want a constant connection I wouldn't think. You can easily monitor a mail box with net::pop3 and get it to do things with email in near real time.

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[noevil]
Travis - Those Who Say It Cannot Be Done Are Usually Interrupted by Someone Else Doing It; Give the wrong symptoms, get the wrong solutions;
 
create the net::pop3 object

while(1){
check the account
do some stuff
sleep 120;#sleep two minutes
}

of course that will run forever so you would eventually have to kill it but it shouldn't use much resources, especially if you declare your variables properly.


------------------------------------------
- Kevin, perl coder unexceptional! [wiggle]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top