Mail server solution, to create a custom ticketing system

I need an incoming and outgoing mail solution that is stable and reliable and doesn’t take too much resources.

For the outgoing mail, I want to be able to send from multiple domains (through php cron) with DKIM signature and all other email standards to make sure my recipients will receive the messages and my domain will stay off the black lists.

While for the incoming messages, I would like to have a lot of aliases. And if possible tinker with the code. Ideally id like to be able to check new messages with cron and add them to a DB. What I’d also like is to be able to send canned replied upon receiving a message. So something like a ticketing system.

I’ve seen a bunch of different tutorials on here for Ubuntu 14.04, but I am not sure which mail server will allow me to do this.

Can i get any recommendations that will enable me to do at least some of the things I mentioned above?


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.


Having worked with Linux for over 10 years, I’ll be the first to tell you that setting up, running and maintaining a working mail server can be a royal pain! There’s a lot to keep up with (standards, protocols, ports, spam etc) and backing up your configuration is an absolute must; no exceptions!

I say this not to deter you, though unless you’ve got plenty of free time, using a service, such as the one mentioned (MailGun) or a similar alternative, such as Mandrill, SendGrid etc, is a much better and far more reliable solution. This is even more so true if you’re looking for a lightweight solution.

While using such services will require that you’re able to code, all three that I mentioned have SDK’s for PHP, Python and various other programming languages, so the initial bar to entry is lowered.

That being said, many of the SDK’s rely on third-party libraries (specifically the PHP SDK’s), so if you’re the type who craves complete control over your code (like me!), the best solution is to create your own SDK and wrap it around the API.

In the case of MailGun, which I happen to be working with right now, mail is sent and received through their service and you would setup your MX records to point to theirs. You would then create aliases on their servers through their control panel and define the route that the service pushes your e-mail to.

For example, if you setup user@yourdomain.ext, you can choose to store the incoming messages for up to two days (free accounts, I believe paid accounts allow for longer storage periods). During this time, you’d simply call the API to fetch the e-mail and in turn, parse the JSON and store it to your DB (or do whatever you’d like with it). You can also have the service “POST” the request to a URI, thus you could setup automatic parsing for each request as it is received, thus negating the need for a CRON Job.

You’d simply enter in the URI and when a request is received, MailGun will make a POST request and from there, your script will handle the request.

Mail, of course, can be sent from your script through MailGun as well.

If you asked this one-two months ago, I’ll recommended you to set up old-fashion Postfix or one of its alternative or in case of lazy mood you always can use Google/Yandex-based mail-hosting.

But I found the great solution: Mailgun software-as-a-service. I sure, there is a lots alternatives (or clones), but I didnt tried to search them just because of Mailgun fits all requirements of my dreams.

First of all - Mailgun have full-featured RESTful (JSON) API with useful things like webhooks, in & out rules, filters, automatic DKIM handling, routes for mail and lots lots more (see docs). No more hours of tuning some modules, proxies, “why its not work?!” and other that I had everytime trying to get postfix work proper. I am not network administrator and its possible reason of all my fails with private SMTP/IMAP-server setup. No matter.

Next. I still feel that its my email, not their. I have domain owned by me, everything in admin-panel is freely importable\exportable

I really like it. I cant find positive answer to question: do I really need huge mail-server software to deliver notifications from my projects?

About aliases. I am may be wrong but this looks like classic “username@domain + aliases” identity set is a thing not about Mailgun. They have really flexible, powerful and easy to understand builtin rules/routes/forwardings/parsers etc etc etc. You can setup simple alias implementation there

Only one bad thing I found is 10 000 emails can be sent for free monthly. For me its enough for lifetime. Thats only one limitation.

P.S.: read my post and want to ask myself “how much you got for this low-quality ad?” But really, its real feedback, I was shocked of this product.