Skip to content

JAMES-4213 Check whether alias target is valid when receiving email for alias#3073

Draft
felixauringer wants to merge 1 commit into
apache:masterfrom
giz-berlin:fix-invalid-alias-target
Draft

JAMES-4213 Check whether alias target is valid when receiving email for alias#3073
felixauringer wants to merge 1 commit into
apache:masterfrom
giz-berlin:fix-invalid-alias-target

Conversation

@felixauringer

@felixauringer felixauringer commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

Currently, it is only checked if the recipient is a user or if there is a mapping with the recipient as source. It is not checked that this mapping actually points to a local mailbox.
We do not want to accept emails that go directly to an error repository, so this should be catched after the SMTP RCPT command.

I opted to accept a recipient if it resolves to at least one mailbox that is present. I would be in favor to enforce that all targets it resolves to are valid but that may break some poorly maintained groups, I guess.

Note: This also prepares for linagora/tmail-backend#2446 by separating the check whether a mailbox exists from the step that applies the RRT. See also the MR in that repository: linagora/tmail-backend#2448.

Jira issue: https://issues.apache.org/jira/projects/JAMES/issues/JAMES-4213

Currently, it is only checked if the recipient is a user or
if there is a mapping with the recipient as source.
It is not checked that this mapping actually points to a local
mailbox.
We do not want to accept emails that go directly to an error
repository, so this should be catched after the SMTP RCPT
command.

I opted to accept a recipient if it resolves to at least one
mailbox that is present. I would be in favor to enforce that
all targets it resolves to are valid but that may break some
poorly maintained groups, I guess.
@felixauringer

felixauringer commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

I have not adapted the tests yet, so they will probably fail.

@felixauringer felixauringer changed the title fix: check whether alias target is valid when receiving email for alias JAMES-4213 Check whether alias target is valid when receiving email for alias Jun 24, 2026
@chibenwa

Copy link
Copy Markdown
Contributor

My point of view is that if there's an alias or somehting alike we manages this and if we manages this it should come in.

Some people actually have RRT mappings without local mailbox which is valid. And used.

I'd favour an approach that prevent invalid RRT creation in the first place and/or removes/correct RRT as needed,

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.

2 participants