Phabricator Administrator's Handbook/Configure inbound e-mail/Using an existing mailbox

You can configure inbound e-mail in a Phabricator also using an existing mailbox.

This aspect is not covered in the official documentation because it's somehow alpha.

How it works

 * 1) Alice writes to a dedicated e-mail address, like
 * 2) A daemon checks the mailbox, acting like any IMAP client
 * 3) The daemon discovers the incoming e-mail from Alice, and passes it to Phabricator
 * 4) Phabricator processes the e-mail and creates a Task etc.

The advantage of this solution is that it's simple to be deployed, because the mailbox can be any normal mailbox.

This solution may not involve any external service: the mailbox may be in your mailserver as well.

The daemon is Free software under the Apache 2.0 license.

Requirements
Note that this requires some packages.

In Debian-based distributions:

apt install php-imap php-mailparse

Configuration
The configuration is intended for GNU/Linux and other Unix-like systems. Adapt it for your needs.

Start cloning these small repositories:

Copy the example configuration:

Then edit it for your needs:

Notes:


 * must be the root of your Phabricator installation (a filesystem pathname)

Then try to run the bot:

If it works, you may want to create a Systemd service similar to this one:

[Unit] Description=Phabricator E-Mail receiver After=syslog.target network.target mysql.service
 * 1) /etc/systemd/system/phabricator-inbound-email.service

[Service] Type=simple User=phabricator Group=phabricator ExecStart=/path/to/your/phabricator-inbound-imap-spooler/bot.php

[Install] WantedBy=multi-user.target

Then enable and start the service:

systemctl daemon-reload systemctl enable phabricator-inbound-email systemctl start phabricator-inbound-email