in reply to Reading email on Exchange
You can indeed use the Net::POP3 module to take care of reading email on exchange.
One thing to keep in mind while reading the email is that the retrieve command (RETR MSG_NUM, $pop->get(MSG_NUM) in perl) will remove the message from the server. In order to get the full text of the message from exchange without removing the message from the server, you will want to send a TOP command with the NUMLINES parameter set to 0.
Example:
use Net::POP3; my $pop = Net::POP3->new( "mail.mydomain.com", Timeout => 60 ); $pop->user( "me" ); $pop->pass( "mypass" ); ### or you can use ### $pop->login( "me", "mypass" ); ### or if your server supports it: ### $pop->apop( "me, "mypass" ); $pop->popstat(); # returns number of messages # and total size in bytes $pop->list(); # returns number of messages, # total size in bytes, # and byte size for each message $pop->top( 1, 0 ); # shows the contents # of the first message # in the mailbox ### you might want to run NOOP every once in a while ### if you want to keep the connection alive ### refer to: http://www.faqs.org/rfcs/rfc1939.html ### for a more detailed explanation if needed.
Hope that helps.
If you make something idiot-proof, eventually someone will make a better idiot.
I am that better idiot.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Reading email on Exchange
by qadwjoh (Scribe) on Jul 24, 2003 at 19:02 UTC | |
by dtr (Scribe) on Jul 24, 2003 at 20:43 UTC |