MailReader is No Longer Being Supported
It has been a fun ride, and many people are still interested in MailReader, but my own interests have moved elsewhere. I haven’t used MailReader for my own projects for nearly 2 years and there has never been any money in it for me or anything like that.
Feel free to continue using it, but it is getting a little long in the tooth. Some functions it uses generate depreciation warnings on newer versions of PHP.
- You can still download and use MailReader. Its code will live on GitHub for as long as GitHub is around.
- If you have problems, you are encouraged to post them on the MailReader GitHub issue tracker instead of here
- MailReader is OpenSource. You can pay (or not) anyone you want (including yourself!) to work on MailReader, the code is out there.
- I will accept GitHub pull requests that fix bugs or add features.
Thanks and Good Luck!
mailReader.php version 3 is here!
mailReader.php is a PHP script which handles incoming email messages, saving attachments to disk, and logging emails to a database.
Download it from GitHub now: https://github.com/stuporglue/mailreader
E-mail Processing Script Features:
- Saves the e-mail sender, subject and body to a database
- Saves any attachments as files and creates an entry for those files in the database, associated with the e-mail info in #1
- Sends a response back to the sender telling them what files were received and their file sizes
- Checks a list of allowed senders to make sure we only take files from specified addresses.
Improvements in Version 3
mailReader.php is growingup a little bit more. It’s now a class instead of just a script. A new script mailPipe.php uses the mailReader class to achieve the same results the script did previously.
I did some database renaming so that none of the fields are reserved names, and they don’t need to be escaped anymore.
I updated the database connection code from mysql_connect to PDO.
I added support for uuencoded attachments. Uuencoded messages don’t have their mime-type detected, but everything else is the same as mime attachments.
Make sure that your upload directory is out of your webroot. If someone emails you a malicious PHP script (eg. Virus.php) and can access it via the web, they could infect your server or your visitors. Many servers are configured to automatically treat .pl and .cgi as CGI scripts and run them as well. You do not want to create a way for untrusted users to upload files to your webroot!
With the file names in the database you can use Readfile to pass files down to users.
I welcome any contributions which others may benefit from, so if you hack on it, consider submitting a pull request on GitHub.