This is a very generic question, much more detail would be needed
to give a specific answer.
Certainly you can have a Perl program examine your email. But
it depends on many things, like:
- Where and how is your email stored? In a local mail spool?
On a remote POP or IMAP server?
- When and how you want the Perl program to execute. When
each individual message arives? Periodically, processing all
the pending messages in batch?
- What is it that you want to do with each message. Rewrite
it in some form? Write results to other files? Execute commands?
As you can see, there are many unknowns in your question.
Almost everything is possible with Perl, but you will have to
be more specific if you want more detailed help.
--ZZamboni
| [reply] |
You may be pleased to know that perl.com has an article detailing this very subject. Enjoy! | [reply] |
You probably want something like Net::POP3 or Net::SMTP (depending on if your server is a POP3 server or an SMTP server). Use it to retreive your message headers and do whatever it is you want to do with your email.
Hope that helps,
Shendal
Update: As pointed out by le in reply below, SMTP is send only, of course. I wanted to say Net::IMAP -- sorry for the confusion. | [reply] |
You can't use Net::SMTP to get mail. SMTP is used for sending mail. Retrieving is done via either POP or IMAP.
| [reply] |
As others have pointed out, this is a very generic
question and
therefore difficult to answer accurately.
One idea might be to take a look at David Wood's book
Programming Internet Email (O'Reilly). It gives a
good overview of the various techniques for handling email
and (unsuprisingly) most of the code examples are in
Perl.
--
<http://www.dave.org.uk>
European Perl Conference - Sept 22/24 2000, ICA, London
<http://www.yapc.org/Europe/>
| [reply] |