helpscout / helpscout-api-php

PHP Wrapper for the Help Scout API
MIT License
98 stars 62 forks source link

Existing customer emails are invalid? #247

Closed cheesegrits closed 4 years ago

cheesegrits commented 4 years ago

Thank you for taking the time to submit an issue with all the details shown below. Our engineering team monitors issues submitted and strives to respond with 1-2 business days.

Current behavior

Some customers which exist in HelpScout cannot be recreated in another mailbox through the API because their emails (which already exist in HelpScout) are flagged as invalid. Very probably because the emails are too long. But ... if they already exist in HelpScout, then something, somewhere is allowing them to be created in the first place.

Expected behavior

If a customer exists with a given email in a HelpScout mailbox, I would expect to be able to migrate it through the API ... create another customer account with the exact same name and email in another mailbox, to which I can then copy existing conversations.

Basically, I'm writing some code to migrate an existing mailbox from one HelpScout account to another, as part of the sale and transfer of a company. HelpScout don't provide the ability to migrate mailboxes, so I'm having to write the code to do it. The existing mailbox has about 600 or so accounts with these crazy long reply.github.com emails on them, which I'm now stuck being unable to migrate.

Steps to reproduce

Try and create a custom with the email:

reply+0116c23981b113e24f60d104d8f79879c9cd201b2abc714492cf00000001186aea1a92a169ce0f779d0f@reply.github.com

... through the API.

bkuhl commented 4 years ago

Hey Hugh,

You're on the right track and doing the right thing, though I'm not sure why this email is being rejected. When interacting with our public API we do perform an email validation check which is why this is being rejected. I do not believe validation checks are performed against the from email addresses on inbound emails. I've reached out to our team that maintains the public API to gain some insight into how we're validating these email addresses and what we can do to ensure you're able to finish working on this migration. We'll follow up here when we know more!

bkuhl commented 4 years ago

Hey Hugh, I've got some more details here. What's happening is there is a validation check in place for processing inbound emails, but the GitHub emails are getting through it, whereas PubAPI uses RFC 5321 for email validation which limits the "local part" of the email to 64 characters, which GitHub exceeds, causing the failure.

We're looking into establishing consistency between these two mechanisms and will follow up when we know more.

bkuhl commented 4 years ago

Our API team has just released an update that changes our email validation so that the local parts of the email can be longer than 64 characters. Please let us know if you encounter any other issues!