Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


WHMCS Email Pipe Daemon (tiny MTA as postfix "alternative")
New on LowEndTalk? Please Register and read our Community Rules.

All new Registrations are manually reviewed and approved, so a short delay after registration may occur before your account becomes active.

WHMCS Email Pipe Daemon (tiny MTA as postfix "alternative")

For all you WHMCS users out there, proudly releasing the initial version of "whmcs-inbound-piped". Its free and open-source on GitHub.

So, there are basically two ways of injecting emails into the support-queue:

  1. via cron
  2. via "pipe"

The cron method can be quite tricky at times, especially on large incoming volumes. A disadvantage is also that it will add quite some delay on every received email. However it has a huge advantage of working out-of-the-box with your current external email provider (including Google Work)

The pipe version will act instantly on every received email, however has the huge disadvantage that you need to run your own MTA "locally" on the same server as where you are running WHMCS.
Additionally, since you have to run the MTA locally, this means you either have to use a different subdomain for your support emails, or you have to also process all other company emails as well.

The current pipe implementations are mostly geared towards Postfix and similar. In many cases a bigger setup that needs to be managed and secured. Especially in my case, most packaged versions overwrite /usr/sbin/sendmail, which in my case I am already replacing with nullmailer (has the advantage of being completely async, so sending emails via PHP/WHMCS does not block the http-request).

This is where whmcs-inbound-piped comes into play :D

whmcs-inbound-piped will listen on port 25 but will only process receiving emails - it does not send emails. Any received email will asynchronously get piped into your pipe.php script where WHMCS will process in the background. The sending mail-server will not be blocked by this.

To ensure that you do not need to worry about spam hitting your server-ip directly, you can specify (via environment variable "LISTEN_TO") an email address that the service will listen to. Any email not sent to that specific address (so make sure its random) will be dropped.

Quick instructions

  1. Download a zip depending on your server operating system
  2. Unzip the binary into your /usr/local/bin
  3. Create a /etc/default/whmcs-inbound-piped - you can specify any environment variable in that file as you see here
  4. Add the unit file to your systemd

You can view the logs via:

$ sudo journalctl -fu whmcs-inbound-piped

FAQ

Can this work on multiple servers?

Yes absolutely. You can create something like a "inbound.YOURCOMPANY.com" subdomain with multiple MX records pointing to each server that you want to act as a receiver.

Will this work with Google Mail?

Yes. You can create a group and subscribe your LISTEN_TO to it. Unfortunately any external email will have an ugly footer. At dd.vu I opted out of Google Mail completely in favor of IONOS Mail for this reason.

Questions and Feedback

Please post in this thread if you have any questions or comments :)

Sign In or Register to comment.