I'm rewriting all sender addresses to one address in Ppostfix.main.cf includes this line:sender_canonical_maps = pcre:/etc/postfix/canonical_senderThe file canonical_sender looks like this:/.+/ name@domain.comIt works as it should and does everything I want, but I would like to understand what /.+/ does and what the difference compared to /.*/ is.
postfix: what does /.+/ in pcre do?
regular expression;postfix
/.+/ is a regex that matches every string with 1 or more characters. /.*/ is a regex that matches every string with 0 or more characters.The . matches any character, and the * and + quantifiers qualify the preceding expression to be done 0-or-more times and 1-or-more times respectively.In the context of postfix, both seem equivalent, since I don't think it can ever reach at that point with an empty recipient (the two regex only differ in their treatment of the empty string).