Nice idea. Here's two suggestions to reduce the load on your server:
- 1. If someone sends you a couple mails with huge attachments, $mail = <MAIL> might end up reading a few hundred kilobytes of data! Use the -s operator to find out the file size, e.g. if (-s $file > 0) { print "YES"; }.
- 2. Make it a CGI script that returns the data. This way, it will only be executed when your computer is on and checking for e-mail -- rather than all the time.
fixed typo