#164 - E-mail to Composr bridging system

Identifier #164
Issue type Feature request or suggestion
Title E-mail to Composr bridging system
Status Completed
Tags

ocProducts client-work (likely) (custom)

Handling member Chris Graham
Addon core
Description This is a new system in Composr, facilitating these key features:
- mail <> support ticket bridging
- mail <> PT bridging (kind of making Composr like gmail)
- mailing list / forum equivalence

The system works by simple creating one mail account (either IMAP or POP3) and tying it to Composr. The server should then be set up to deliver all mail on the mail domain that does not correspond to an existing account to that account. Composr has to be configured with the account details:
- type (IMAP or POP3)
- username
- password

Composr gets a new cron hook that regularly checks that account for new messages. New messages and handled, and then deleted.
The cron hook ties into email system hooks that are able to claim either ownership of the message (typically, by looking at it's e-mail address) with a priority number. If no ownership is claimed, the message is dumped, or if the 'undeliverable_mail' option is set, forwarded to the address specified in that.

Before a message is passed to the hooks, it is preprocessed. Preprocessing converts messy HTML, RichText, or even messy plain-text into clean plain-text mail format. Comcode is extended a bit to support " > " style quoting, such that it's an alternative to the 'quote' tag.

There are three hooks...

[title="2"]cns_mail_list[/title]

[title="3"]Receiving[/title]

Conversr has the ability to run the forum also as a mailing list. Every forum has a text field that specifies an e-mail username (e.g. 'general_chat') that applies to it. The mail hook will look for any forums that have e-mail usernames and claim any mails sent to them with 'level 1' priority.

Once claimed the mail hook will make posts on the forum according to the mail. It tries to detect a real member by looking at the 'from address' as well as the 'from name'. If it gets a match, but finds it matches a member with 'dangerous_comcode' permission, then it is degraded to a named guest post. If it gets a match to a non privileged member, it is posted as that member but with a "may not be true source" warning tagged on.

The hook detects whether to reply to a topic (and which one) or make a new one based on the subject line, including presence of 'Re:'. If multiple topics in the target forum share a title, priority is given to the most recently active.

The hook is intelligent enough to check forum access.

[title="3"]Sending[/title]

The forum tracking system doubles up as a mailing list subscription system. If a member is tracking a maillist-supporting forum and a new message is posted in it, they will receive mails in 'mailing list style' sent from the maillist address of that forum. They could then reply to those mails.

A new Personal Zone 'tracking' module is made so that tracking can easily be turned on/off globally, and for each individual forum to which the member has access. The interface notes which forums are in mailing list, with an explanation that tracking mails to those will be in maillist style.

[title="2"]cns_webmail[/title]

[title="3"]Receiving[/title]

If the to address is found to correspond to <username>@<domain> it is claimed with 'level 2' priority.
Received mails are then sent as new PT's or replies to PT's based on the subject line (just like the forum does with regular topics).
As with the forum, "may not be true source" warnings are used.

[title="3"]Sending[/title]

Whilst the forum regular sends out tracking mails in two formats, depending on whether there is maillist support, all PT tracking mails are sent out in a halfway format, that looks like a cross between a regular mail and a tracking mail. They are sent with the <replier>@<domain> from address

[title="2"]ticket[/title]

[title="3"]Receiving[/title]

It claims mail sent to the mail name specified in the 'ticket_mail_name' config option. This option defaults to 'staff'.

[title="3"]Sending[/title]

Reply notifications are sent out much like PT-notifications -- half way between a normal mail reply format, and an Composr notification.



Notes:
- mails sent out will be given from/reply addresses that correspond to something Composr can read. However mails received will be expected to have either a from address corresponding to what a member has set in their profile or a from name corresponding to a username, or else be assumed as 'Guest'. If it's found that the from address a mail Composr receives corresponds to a <username>@domain then it is dumped for security reasons (in case someones trying to cause an infinite mail notification sending loop).
- Comcode 'quote' tags are converted to/from normal email quote form
Steps to reproduce

Funded? No
The system will post a comment when this issue is modified (e.g., status changes). To be notified of this, click "Enable comment notifications".

Rating

Unrated