Skip to content

Use PCRE for alias regular expressions instead of the basic type#751

Merged
johansmitsnl merged 1 commit intodocker-mailserver:masterfrom
damianmoore:pcre-regexp-aliases
Dec 7, 2017
Merged

Use PCRE for alias regular expressions instead of the basic type#751
johansmitsnl merged 1 commit intodocker-mailserver:masterfrom
damianmoore:pcre-regexp-aliases

Conversation

@damianmoore
Copy link
Copy Markdown
Contributor

I spent quite a while trying to set up an alias in config/postfix-regexp.cf like this:

I wanted the client to recieve mail for a couple of users @customer.com and everything else to be sent to me so I can deal with maintenence stuff. The negative-lookahead regular expression seemed to be the solution but I couldn't get Postfix to understand it.

It turns out Postfix has 2 regular expression implementations denoted by the prefixes regexp: and pcre: in config files. Perl-compatibe regular expressions (PCRE) seem to be the main implementation wherever I've used them before, however the Postfix config here uses the basic type by default.

I am currently overriding by putting the following in config/postfix-main.cf but I think it would save people a lot of trouble if pcre: was enabled by default for aliases.

virtual_alias_maps = texthash:/etc/postfix/virtual pcre:/etc/postfix/regexp

@johansmitsnl
Copy link
Copy Markdown
Contributor

Could you add a test to verify the change works and keeps working with future changes?

@johansmitsnl
Copy link
Copy Markdown
Contributor

Don't want to rush you but is there any progress?

@johansmitsnl johansmitsnl merged commit 01a41e9 into docker-mailserver:master Dec 7, 2017
@johansmitsnl
Copy link
Copy Markdown
Contributor

Thanks for the contribution

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