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
scripts: disallow alias = account #3270
Conversation
We do not support aliases that are accounts at the same time. This commit provides a guard that checks the condition.
@polarathene I am not 100% certain whether we should disallow both directions, but to me that makes sense. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! 😀
Preventing either DB adding a key that belongs to the other makes sense to me 👍
@@ -74,6 +74,10 @@ function _arg_expect_mail_account | |||
function _account_should_not_exist_yet | |||
{ | |||
__account_already_exists && _exit_with_error "'${MAIL_ACCOUNT}' already exists" | |||
if grep -q "^${MAIL_ACCOUNT}" "${DATABASE_VIRTUAL}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember, that we had a similar issue in the past:
postfix-virtual.cf
looks like:
myalias@example.com user@example.com
The grep statement above would also match on:
Adding a space for example should fix it:
if grep -q "^${MAIL_ACCOUNT} " "${DATABASE_VIRTUAL}"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should be handled in both lookups then? But for accounts table, instead of space a |
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You are right.
Description
We do not support aliases that are accounts at the same time. This commit provides a guard that checks the condition.
@bibiak1 made us aware of the fact that we allow creating aliases as users (and vice versa). I think we do not support this, and at least to me, it does not make a lot of sense.
Fixes #3262
Closes #3259
Type of change
Checklist: