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
edit- Alice writes to a dedicated e-mail address, like
bugs@example.com
- A daemon checks the mailbox, acting like any IMAP client
- The daemon discovers the incoming e-mail from Alice, and passes it to Phabricator
- 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
editNote that this requires some packages.
In Debian-based distributions:
apt install php-imap php-mailparse
Configuration
editThe configuration is intended for GNU/Linux and other Unix-like systems. Adapt it for your needs.
Start cloning these small repositories:
git clone https://gitpull.it/source/phabricator-inbound-imap-spooler.git
git clone https://gitpull.it/source/php-imap-spooler.git
Copy the example configuration:
cp phabricator-inbound-imap-spooler/config-example.php phabricator-inbound-imap-spooler/config.php
Then edit it for your needs:
nano phabricator-inbound-imap-spooler/config.php
Notes:
IMAPBOT_PATH_PHAB
must be the root of your Phabricator installation (a filesystem pathname)
Then try to run the bot:
./phabricator-inbound-imap-spooler/bot.php
If it works, you may want to create a Systemd service similar to this one:
# /etc/systemd/system/phabricator-inbound-email.service [Unit] Description=Phabricator E-Mail receiver After=syslog.target network.target mysql.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