Skip to content

[16.0] [MIG] mail_alias_with_domain#1624

Closed
NL66278 wants to merge 3 commits intoOCA:16.0from
Therp:16.0-mig-mail_alias_with_domain
Closed

[16.0] [MIG] mail_alias_with_domain#1624
NL66278 wants to merge 3 commits intoOCA:16.0from
Therp:16.0-mig-mail_alias_with_domain

Conversation

@NL66278
Copy link

@NL66278 NL66278 commented Mar 26, 2025

Make it possible to handle incoming mails with aliases that take the smtp domain of the incoming mail into account. So you can have mail addresses like invoice@my_one_company.com and invoice@my_other_company.com and link them to records in the right company.

@NL66278 NL66278 force-pushed the 16.0-mig-mail_alias_with_domain branch 2 times, most recently from eebecec to 00055d5 Compare April 7, 2025 08:26
@NL66278 NL66278 changed the title [WIP] [16.0] [MIG] mail_alias_with_domain [16.0] [MIG] mail_alias_with_domain Apr 7, 2025
@NL66278 NL66278 force-pushed the 16.0-mig-mail_alias_with_domain branch 2 times, most recently from 64a79d7 to adab305 Compare April 7, 2025 15:45
@NL66278
Copy link
Author

NL66278 commented Apr 8, 2025

Test fail on another module. Can be corrected after merge of this PR: #1628

@NL66278 NL66278 force-pushed the 16.0-mig-mail_alias_with_domain branch from adab305 to e17f18e Compare April 9, 2025 09:42
emails = {email for email in (tools.email_split(message_dict["recipients"]))}
alias_names = []
for email in emails:
clean_email = Alias.get_clean_email(email)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in which cases does email_split return something else than an email address?


alias_entry = fields.Char(
help="This will be used to enter an email, complete with domain",
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should be unique

@api.depends("alias_name")
def _compute_alias_domain(self):
alias_with_domain = self.filtered(
lambda r: r.alias_name and "__at__" in r.alias_name
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't find it super far fetched to have this in a mail address. did you consider using a character illegal in both localparts and domain names, like '&'?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hbrunn Taken up most of your remarks in new PR here: #1797

Only not this one. Using & led to other problems, and apparently is actually allowed also, just like _ and most printable characters. At least according to this site: https://www.ditig.com/characters-allowed-in-email-addresses. But even if __at__ is used in some email address - never encountered anything like it -, it will be extremely unlikely that this also will coincide with en email address used as an alias.

@github-actions
Copy link

github-actions bot commented Oct 5, 2025

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Oct 5, 2025
@github-actions github-actions bot closed this Nov 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale PR/Issue without recent activity, it'll be soon closed automatically.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants