Gordon
Gordon

Reputation: 1651

perl, parsing emails immediately

i would like to setup a system where I can start parsing emails using perl (in unix i guess) from some account and a cron job would trigger this. I was wondering if anyone has setup something similar to this.

Upvotes: 2

Views: 1073

Answers (1)

Anirvan
Anirvan

Reputation: 6354

This is a common enough task. If you're checking an account for new messages, and processing them, you may want to split the task up like this:

  1. Use a CPAN module like Net::IMAP::Client to access the inbox, or pipe messages to procmail (or a procmail alternative like Mail::Audit)
  2. Parse the message, either using your folder reading module's default interface, or using a tool like Email::Simple or Email::MIME to read the message.
  3. Don't forget to mark that you've seen that message, e.g. by marking it read, deleting it, or moving it to another folder

Upvotes: 3

Related Questions