Developing Incoming Email Features - Request For Comment


I’m developing some new features for SuiteCRM that I’m hoping to get accepted to the project, and I’m looking for input and guidance as I’m working on it.

These features all revolve around how email is handled. The biggest is how incoming email is assigned.

Currently, we can use workflows to assign email. However, the system has no way to know if an incoming email is related to email already in the system. For instance…

Frank sends an email from SuiteCRM to Bob and it’s associated with the account “Bob’s Barbells”. When Bob replies, and if the reply makes it to SuiteCRM, SuiteCRM has no idea that it’s a reply to the original outgoing email. The only way it would have any idea it’s related to “Bob’s Barbells” is if the “From” field matches the Account, or one of the Account’s contacts. Even then, it doesn’t associate it with the account. It only shows it in the history subpanel because of the matching email address.

On top of this, unless the email came in a personal incoming email account check, the email will not be assigned to Frank. If the system roles are not permissive enough that Frank can see all incoming mail, he won’t even see the email from Bob, since it’s not assigned to him.

My fix works like this:

  1. All outgoing email has it’s Message Id saved in the ‘emails’ table.
  2. All incoming mail that’s retrieved via group email accounts has it’s ‘Reply To’ and ‘References’ headers checked against the list of emails sent from the system.
  3. If SuiteCRM finds that the incoming mail matches an outgoing mail, it will associate it with the record that the outgoing mail is associated with. In other words, it sets its parent record to the same record.

It can set the owner of the incoming email to either:

  1. The owner of the replied to email
  2. The owner of the parent record of the replied to email
  3. Do Nothing

Note that because this is using the ‘references’ field of the email, it doesn’t matter how many replies or forwards the conversation goes though (as long as the email clients preserve the references, like Gmail does), the incoming email will be recognised as being part of the thread. When it comes in, these functions will be followed. Even if the email gets forwarded to a 3rd party, and they reply back, the email will come in and be assigned/associated.

So, I’m looking for input. Other than the original email owner, or the owner of the parent record of the original email, who would you like to see the incoming email get assigned to? Any other suggestions?

(A thought as I’m typing this…) Would you like to see an option to delete email it receives that doesn’t match an existing thread? This would allow someone to forward emails, or all their incoming mail to a group mailbox, and it wouldn’t keep mail it didn’t need.

1 Like

I’ve created a pull request with my modifications:

I’m commenting here to bring this topic up again. We’ve had some activity in the issue report at:

We could really use a couple folks to test the PR and comment on it. Please help!