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

Plus Addressing for tags #253

Closed
mitchellkellett opened this issue Feb 28, 2024 · 10 comments
Closed

Plus Addressing for tags #253

mitchellkellett opened this issue Feb 28, 2024 · 10 comments
Labels
awaiting feedback Additional feedback / information required enhancement New feature or request

Comments

@mitchellkellett
Copy link

Google, and now Office 365, supports plus addressing. It would be awesome if we could use plus addresses for tags as an alternative option via the header.

Append a plus (“+”) sign, with any combination of letters or numbers to follow, after your email address. For example, if your email address was [email protected], you could send mail to [email protected] or [email protected] and still receive mail at [email protected].

@axllent axllent added the enhancement New feature or request label Feb 28, 2024
@axllent
Copy link
Owner

axllent commented Feb 28, 2024

That's a great idea, thanks!

@axllent
Copy link
Owner

axllent commented Mar 2, 2024

Plus addressing has now been added to v1.14.1.

I have also added an option (--tags-title-case or MP_TAGS_TITLE_CASE=true) to automatically TitleCase newly-created tags (manual or automatic) which may be useful here, meaning [email protected] would create a tag called Tag (not tag). This option will not change any existing tags, only new ones.

Please confirm this works as you expect? Thanks.

@axllent axllent added the awaiting feedback Additional feedback / information required label Mar 2, 2024
@mitchellkellett
Copy link
Author

mitchellkellett commented Mar 7, 2024

Hey, sorry I didn't get to test this sooner.

It seems to work fine with one tag
image

But not with 2 (I don't know what Google and the likes do if you use multiple plus addresses).
image

Interestingly, it also applies the logic to the from as well. Not sure if that's intentional. I do like it, though.
image

Title case worked as I expected it to.
image

@axllent
Copy link
Owner

axllent commented Mar 7, 2024

Thanks for the testing & feedback @mitchellkellett. I don't think there is a standard for this type of thing as whilst Gmail (for instance) supports the test+tag1+tag2 syntax, it's not "translating" that into tags, it's just an address which you can do what you like with.

So your expectation is that test+tag1+tag2 would apply both tag1 and tag2? I'm sure that shouldn't be a problem, just not until next week as I'm away for a few days. I'll look into this though.

You are correct about the plus addressing detecting not only the To, but all fields (To, From, Cc and Bcc - this is intentional.

I'm also wondering if yes-no-maybe should become yes no maybe ~ as in - replaced with a space. This would only apply to plus addressing as it's not possible to otherwise have tags with spaces. What are your thoughts?

@mitchellkellett
Copy link
Author

My very quick test showed that Google was happy to accept multiple tags, but Outlook only liked one tag (it actually rejected the message when I used two).

So your expectation is that test+tag1+tag2 would apply both tag1 and tag2? I'm sure that shouldn't be a problem, just not until next week as I'm away for a few days. I'll look into this though.

Following the Google logic, yes, apply both tags.

I'm also wondering if yes-no-maybe should become yes no maybe ~ as in - replaced with a space. This would only apply to plus addressing as it's not possible to otherwise have tags with spaces. What are your thoughts?

I don't think it should have spaces, I think that you either combine multiple tags to get it or you concat them with hyphens.

@axllent
Copy link
Owner

axllent commented Mar 7, 2024

Are you meaning that test+tag1+tag2 should tag it as tag1 tag2 (one tag, two words), or as two separate tags?

@mitchellkellett
Copy link
Author

mitchellkellett commented Mar 8, 2024

Google tags it as two separate tags, so tag1 and tag2. So I think that's the way to proceed personally.

@axllent
Copy link
Owner

axllent commented Mar 9, 2024

The latest release adds support for adding multiple tags. I'm away for a few days so I haven't tested this as much as I would like to have, but could you please test this and confirm it is working as you expect now? Thanks.

@mitchellkellett
Copy link
Author

I found a bit of an unusual bug when I have MP_TAGS_TITLE_CASE=true. But otherwise, the tags are created correctly when the message is received.

I sent these 6 messages, which all worked fine.
image

I then went in and read the first one I sent, when I go back to the inbox, they've all be dropped down to lower case.
image

@axllent
Copy link
Owner

axllent commented Mar 9, 2024

Thanks for testing. Title casing only applies to new tags, but you already had the lowercase tags in the database from the previous tests. This is just a "cosmetic issue", not a functional one, so for the purpose of this I'm not worried about it. One day I'll try to find an elegant solution to this without having to query the database twice (set this tag, and then what tags do you actually have) as this would add a lot of unnecessary database queries for every new message.

Cool, I'll close this issue now as I'd say it's working.

@axllent axllent closed this as completed Mar 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
awaiting feedback Additional feedback / information required enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants