Skip to content
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

feat: allow a catchall alias to be used #7

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cjpit
Copy link

@cjpit cjpit commented Aug 22, 2022

No description provided.

@cjpit cjpit changed the title allow a catchall alias to be used feat: allow a catchall alias to be used Aug 22, 2022
@Hobby-Student
Copy link

Hobby-Student commented Nov 27, 2023

tried this on a current install and it works for manually added email addresses. Unfortunately it doesn't work on LDAP synced users, I also tried

proxyAddresses = smtp:@domain.tld

I try to find the LDAP sync filter and perhaps can submit another pull request

EDIT: just FYI

change

userdata["aliases"] += [alias for alias in aliases if formats.email.match(alias)]

to

userdata["aliases"] += [alias for alias in aliases if (formats.email.match(alias) or formats.email_domain.match(alias))]

see next post for details

@Hobby-Student
Copy link

this solution sounded very nice and simple. Unfortunately it's not a last resort catch all, it's a primarily catch all. This is what my quick tests have shown.

I tried to solve a problem like "AD user gets deleted, but incoming mails need to be delivered for the old address in a catch all mailbox". Not possible with this pull request.
For me, this needs some more digging to become something like "no address found, lets check this user as last resort"

@robert-scheck
Copy link
Contributor

Unfortunately it's not a last resort catch all, it's a primarily catch all.

From my point of understanding, this is a Postfix configuration issue; citing: https://serverfault.com/a/1094145:

The important part is that all real mailbox users are also put into the virtual alias lookup. This works around the fact that aliases have priority over real accounts. So it's not about the order of the entries, or whatever your mydestination is set to, you just have to add your real mailboxes as aliases, too, and the catchall will work as intended and only collect the mail for the undefined addresses.

Unfortunately, this seems to be a quite common configuration mistake (that I also run into already).

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.

5 participants