Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

reworked getRecipient to support multiple recipients #5

Merged

Conversation

LeMoonStar
Copy link
Contributor

@LeMoonStar LeMoonStar commented Aug 4, 2022

The current getRecipient function only supports finding the first recipient. As an email can have multiple recipients, it should find all of them. Additionally, using Thunderbird's pre-parsed attributes of the MessageHeader object makes the code much more straightforward.

The new getRecipients function doesn't filter for the domain, allowing more freedom in the pattern matching. This also avoids having to set the account name to the domain. However, using a wildcard for the domain in the pattern matching will result in the Sort function matching the first recipient it finds no matter the domain, which might not be desirable.

As this change introduces support for Cc and Bcc, it resolves #3.

background.ts Outdated Show resolved Hide resolved
@networkException
Copy link
Owner

I think this is basically good to merge. I will look into a way to limit the mail domains that get matched by scanning the registered account identities on first launch and allowing a user to modify that list

@networkException
Copy link
Owner

I'm also thinking of simply including some non standard headers like x-github-recipient-address. We can iterate on getting possible recipients from more headers later

Co-authored-by: Jakob-Niklas See <github@nwex.de>
@LeMoonStar LeMoonStar marked this pull request as ready for review August 4, 2022 15:04
@networkException networkException merged commit 728437f into networkException:master Aug 4, 2022
@LeMoonStar
Copy link
Contributor Author

I'm also thinking of simply including some non standard headers like x-github-recipient-address. We can iterate on getting possible recipients from more headers later

Including non-standard headers is a good idea, however, I believe they should be part of a separate commit/PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support CC and BCC headers for the recipient
2 participants