[GH-ISSUE #253] Plus Addressing for tags #168

Closed
opened 2026-03-15 12:56:59 +03:00 by kerem · 10 comments
Owner

Originally created by @mitchellkellett on GitHub (Feb 28, 2024).
Original GitHub issue: https://github.com/axllent/mailpit/issues/253

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 yourusername@gmail.com, you could send mail to yourusername+friends@gmail.com or yourusername+mailinglists@gmail.com and still receive mail at yourusername@gmail.com.

Originally created by @mitchellkellett on GitHub (Feb 28, 2024). Original GitHub issue: https://github.com/axllent/mailpit/issues/253 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 yourusername@gmail.com, you could send mail to yourusername+friends@gmail.com or yourusername+mailinglists@gmail.com and still receive mail at yourusername@gmail.com.
kerem 2026-03-15 12:56:59 +03:00
Author
Owner

@axllent commented on GitHub (Feb 28, 2024):

That's a great idea, thanks!

<!-- gh-comment-id:1968208591 --> @axllent commented on GitHub (Feb 28, 2024): That's a great idea, thanks!
Author
Owner

@axllent commented on GitHub (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 user+tag@example.com 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.

<!-- gh-comment-id:1974757066 --> @axllent commented on GitHub (Mar 2, 2024): [Plus addressing](https://mailpit.axllent.org/docs/usage/tagging/#plus-addressing) has now been added to [v1.14.1](https://github.com/axllent/mailpit/releases/tag/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 `user+tag@example.com` 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.
Author
Owner

@mitchellkellett commented on GitHub (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

<!-- gh-comment-id:1982463778 --> @mitchellkellett commented on GitHub (Mar 7, 2024): Hey, sorry I didn't get to test this sooner. It seems to work fine with one tag <img width="469" alt="image" src="https://github.com/axllent/mailpit/assets/51467505/df49218f-448c-45a3-9024-19205f3a0aa4"> But not with 2 (I don't know what Google and the likes do if you use multiple plus addresses). <img width="509" alt="image" src="https://github.com/axllent/mailpit/assets/51467505/d67cf378-1356-4d8c-8ad7-4e68b2f4ca68"> Interestingly, it also applies the logic to the from as well. Not sure if that's intentional. I do like it, though. <img width="503" alt="image" src="https://github.com/axllent/mailpit/assets/51467505/a819398d-55d6-43ba-9282-0ba7e61d1089"> Title case worked as I expected it to. <img width="608" alt="image" src="https://github.com/axllent/mailpit/assets/51467505/e88ed336-4922-4def-b592-b010d83a7b93">
Author
Owner

@axllent commented on GitHub (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?

<!-- gh-comment-id:1982517343 --> @axllent commented on GitHub (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?
Author
Owner

@mitchellkellett commented on GitHub (Mar 7, 2024):

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.

<!-- gh-comment-id:1982564903 --> @mitchellkellett commented on GitHub (Mar 7, 2024): 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.
Author
Owner

@axllent commented on GitHub (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?

<!-- gh-comment-id:1982991800 --> @axllent commented on GitHub (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?
Author
Owner

@mitchellkellett commented on GitHub (Mar 8, 2024):

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

<!-- gh-comment-id:1984857753 --> @mitchellkellett commented on GitHub (Mar 8, 2024): Google tags it as two separate tags, so `tag1` and `tag2`. So I think that's the way to proceed personally.
Author
Owner

@axllent commented on GitHub (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.

<!-- gh-comment-id:1986955014 --> @axllent commented on GitHub (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.
Author
Owner

@mitchellkellett commented on GitHub (Mar 9, 2024):

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

<!-- gh-comment-id:1986992506 --> @mitchellkellett commented on GitHub (Mar 9, 2024): 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. <img width="721" alt="image" src="https://github.com/axllent/mailpit/assets/51467505/ff3f3f94-a792-4fd5-ad2d-bdd15aac722a"> 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. <img width="720" alt="image" src="https://github.com/axllent/mailpit/assets/51467505/683a4e8e-9343-4e23-8db9-80055a19bacb">
Author
Owner

@axllent commented on GitHub (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.

<!-- gh-comment-id:1987006378 --> @axllent commented on GitHub (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.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/mailpit#168
No description provided.