How would I go about creating a perl script to act as a mail client? Is there a good module for this?
More specifically, I am trying to create a perl script to monitor the inbox of the email address from a paypal account, and when an e-mail confirming the payment of a user who signed up, activate their account through DBI. I'm pretty sure this is possible, but I am new to perl, and would appreciate all the help I can get.
I would imagine there are 2 schools of thought on this (or more).
1) If you have control of the mail server where the mail will be sent you can usually direct an incoming message into a program ratehr than have it stored to the local filesystem. Then your script would parse the message on <STDIN> and perform whatever actions are required.
2) The other would be to have the message sent to an account and have that account POP/IMAP enabled and pop the messages, then in a similar fashion to the above you would parse the message and perform the required actions.
In both cases absolutely you should use modules to handle the actions of parsing the messages, and in the second case for accessing the account. Some modules I have had good success with include Mail::Box, MIME::Parser, and I have heard of people having success with Mail::POP3Client. Mail::Box probably has the most functionality but may be overkill depending on your application.
In the first case check the documentation for your mail server, but as an example in sendmail it is as easy as setting up an alias to point to a program with a pipe.
http://danconia.org
-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]