The most common reason for someone to build an extension is to solve an issue oneself has. Flarum has been considering many options to get our email structured. Because we are a non-profit with the Flarum Foundation, our sponsored options should have been many. It's not the case. Our (or possibly just my) preferred solution would have been some kind of ticketing system so that we can receive emails personally but can hand it over to others in case of absence or for transparency. After having seen our private discussion about this go nowhere I decided to consider a "let's do something different and dogfeed" at the same time.
Let's say you can configure a tag with IMAP (and SMTP) settings, making that tag connected to an actual mailbox. Once you've set up that for a tag that tag will be synced continuously;
- Email that comes in become discussions within the tag, auto generating a user with a unique ID (people can still password forget and request a username change).
- Replies by Flarum users are sent through SMTP to the OP.
- Replies by anyone on the email are added as replies on the discussion.
- Emails are connected using the References header.
I already set up a extremely basic (but working) version over the weekend at https://github.com/FriendsOfFlarum/mailbox
In order to make it work (advanced users only):
- Install (using repository url or path) and enable
- Edit a tag, enable to mark it for IMAP, configure all settings, including SMTP port.
- Run
php flarum mailbox:work
regularly (eg with the linux command watch
) or as a cronb.
- Now, send yourself an email from another mail address to the configured mailbox.
- A discussion should pop up in the configured tag.
- Reply as a user on your forum discussion.
- See an email pop up in your "other email address" mailbox.
- Reply from that other mail address inbox again, see the reply in the discussion.
- Etc.
What I'd love to hear:
- Overall what do you think?
- What mail drivers would you need?
- What scenario would you use this for?
- Any feature requests?
My plan for this extension is to slowly finish this over the course of the coming months. Pitch it to the team to measure interest and then start using it for the Flarum team. The extension is open source and will remain so in the future.