-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Allow regex in email address aliases #4015
base: master
Are you sure you want to change the base?
Conversation
Hm, aliases in mailcow not only allow incoming mail, but also and outgoing. Does this work here? Also regex aliases not break alias expanding in rspamd? |
Do you mean address rewriting? I only implemented regex for incoming mail aliases. What exactly do you mean by alias expanding? The global filter maps seemed to work fine. |
|
|
Hi @andryyy what you think?:) |
any chance getting this merged? |
This pull request has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. |
this looks like a very decent feature to support. any chance of getting this merged? I might need it to create a for example |
If I understand this correctly this would allow to bind aliases to the services they are used for. This is great because they will refrain from selling traceable addresses, and they can selectively be revoked. |
That's indeed a neat feature! I'd like to wait for a quick check and OK from @andryyy before merging it. |
This is awesome and absolute critical for my migration path. I'm looking forward to try this! |
Me too! Really looking forward to this feature! |
I was just writing a feature request for this, great to see someone already did the work ! |
@chaserdoe FYI there was some refactoring in upstream As far as I can tell these changes were done:
I'm not very fluent in php, maybe you have a chance to merge in the latest changes. Otherwise I will give a try sooner or later. Beside that: the regexp alias feature has worked very well in the last two months at my installation. |
I've just created an offical ticket asking for the merge of this PR. I offered buying another SAL, maybe some of the watchers are also interested and could chime in. Merging this feature probably is just a few hours of work (plus maintaining it of course). Cheers |
This will have so many bad effects on routing, policies and spam filter settings that I’m against merging it. I will not veto it, feel free, I will not support it though. |
@andryyy I understand that, and I had some corner cases myself in the past 9 months, but on the other hand it's a feature I which is extremely useful I cannot give up, I have 15 years of 'reto-company-.*' email addresses ;). So maybe it just needs a very fat disclaimer with all the corner cases that are not supported (i.e. sending mails from SOGo). |
Not sure what the status of this is, or if it will be supported but I found a quick, dirty, unsupported workaround that's been working for me for the last few months. Step 1Create regex virtual map file for postfix
This is where you will create your regex rules.
Step 2Next configure the extra.cf to look for this file. NOTE: since you are replacing virtual_alias_maps from the main config (main.cf) you MUST include the original alias maps + your new alias map.
Add this line
Step 3Run postmap
Step 4Reload postfix
|
I Just tried it and this is working fine. |
Thank you for this workaround! BTW my use case would be to have an alias for |
+1 (also coming from self-hosted postfix server where I used the regex. Now I have to edit the regex file in the postfix docker container, which is sub-optimal. (but doable, as the regexes do not change often.) |
I've taken a keen interest in this PR and after reading through the comments, I understand some of the concerns that are raised. Instead of using full regex, we could limit ourselves to wildcard support. We can implement this by using the PHP glob() function, which is simpler and less risky compared to a full regex implementation. @andryyy Before proceeding, I'd appreciate your thoughts on this. Could this approach address some of your concerns? Could you elaborate a bit more on the potential problems you foresee with this use case so that I can create some test scenarios? EDIT: After some discussions with the mailcow team on the telegram chan. This feature is not expected and never be merged. |
@andryyy hey could you imagine working/accepting on solution that works like the "workaround" described by andy (apharp) in #4015 (comment) I.e. no gui support, and just accepting a new file at a certain path (which is empty by default installation). the difference to the workaround would just be, that we don't have to overwrite the built-in 'virtual_alias_maps' What do you think? |
Implemented #2507