Corion is right. Your question is very unclear. I guess asking for a perl module/script to do mail forwarding is the equivalent of asking for a perl module to change a lightbulb. It could be done, but there exist easier ways. In most mail servers that run in a UNIX environment, simply having a file named ".forward" in your home directory would forward any mail to the contents of the file if they were an email address, or to a shell process that you could specify via |. I doubt there's something similar to this in the Win32 environment, but setting up mail forwarding on an Outlook server seems like it should be very trivial. So writing a script seems to be kind of pointless (in my opinion).
But, assuming you really want to forward mail, you'd need to do the following:
- Check to see if your account has gotten mail. You can telnet to the imap/pop port if you don't have the correct perl modules installed to talk.
- Download any mail that you have recieved.
- Scan the mail to make sure it's for you (and to block out anything you might not want forwarded).
- Open up SMTP connection to some server, using the previously fetched email as the body of the message
- Done. Now loop again. Endlessly.
So as you can see, this is alot more work than it's worth. I agree that there's always more than one way to do things, but just because there's a harder way doesn't mean you have to take it.
BlueLines
Disclaimer:
This post may contain inaccurate information, be habit forming, cause atomic warfare between peaceful countries, speed up male pattern baldness, interfere with your cable reception, exile you from certain third world countries, ruin your marriage, and generally spoil your day. No batteries included, no strings attached, your mileage may vary.