Mail Manager

One of the first projects I completed in my new job is called Mail Manager, which is used by university students as part of their coursework. The main issue was that we wanted students to be able to send emails in PHP, but we needed to ensure that coding mistakes (e.g. an infinite loop) would not result in thousands of emails being sent out.

Core requirements included:

  • Rate limiting to prevent students sending more than X emails per hour.
  • Recipient domain restrictions to prevent students sending email to external addresses.
  • Audit log of all messages sent, including who sent them.
  • Automatic setting of relevant headers (e.g. From).

The code consists of a PHP class for students to include in their projects, and a web service which processes all requests and performs rate limiting, logging etc. There is no support for HTML email or attachments – this is intentional as it would substantially increase the complexity of the code, as well as introducing issues such as scanning all outgoing attachments for viruses and other inappropriate content.

Although the project is intended for a specific organisation, most parameters are configurable and it is available on GitHub under the LGPL.

Source code

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.