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. |
polarathene
left a comment
There was a problem hiding this comment.
LGTM! 😀
Preventing either DB adding a key that belongs to the other makes sense to me 👍
| 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.
I remember, that we had a similar issue in the past:
postfix-virtual.cf looks like:
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.
That should be handled in both lookups then? But for accounts table, instead of space a |?
|
If you don't support it, then emit a warning. Call it an advanced option. something other than a pointless block. |
I'm fine with a change to allow it with a warning emitted, or a prompt for confirmation before continuing. You're welcome to open a PR if the other maintainers are comfortable with the change. It should include test coverage that avoids errors like this one. FWIW we do make this concern more prominent in our docs from DMS v15 onwards:
Yes but DMS is another layer on top of that. Virtual aliases by default will be used to create dummy accounts in Dovecot. A side-effect is you can login with that (and some users do this), even though that is unintentional and not supported, it's the only option we have for Dovecot Quota support to work without writing and maintaining our own policy check service for Postfix. Could you please add some context to why you need an alias to your mailbox account with the same address? We enforced this block due to various bug reports caused by misconfigurations (more context here). It's also possible you are dealing with an XY problem where you are dismissing our decision to forbid aliases sharing mailbox addresses to solve a problem that would be better supported by other features from Postfix. If so your concern is more for the lack of official support via DMS for such, but even if we had that in place you may have only been familiar with aliases and not considered it? The valid use-cases that I'm aware of are:
Invalid use-cases tend to be forwarding to an external mail server, often |
Thank you for chiming into this closed issue. I also appreciate the kindness with which this @polarathene was too kind when he gave a friendly answer here. But I have zero tolerance when it comes to impoliteness. Formulate what you want in a direct, precise, and friendly manner. You are not entitled to demand changes to this project, you can ask for them nicely. At the risk of repeating myself: This project is free, open-source, and maintained by individuals in their spare time. This happens again, and you'll be posting nowhere on this whole project, @KevinBrogan. I've made myself clear here, no discussion necessary anymore. |

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: