|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
From: Benjamin Morel (benjamin.morel
gmail.com)
Date: Mon Feb 11 2008 - 12:46:27 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Thank you very much Victor, it works now.
I did a mistake writing this mail, of course domain names should be enclosed
with slashes and dot escaped.
However I could not find in the doc this way to stop recursion. It's
perfect.
Thanks again and sorry to have thought it was a bug !
Ben
On Mon, Feb 11, 2008 at 04:26:52AM +0100, Benjamin Morel wrote:
[ Subject lines thart start a thread, should omit the word "bug" unless a
problem has been carefully verified and reported in detail. When reporting
unexpected behaviour, ask for help. ]
> I set this line in /etc/postfix/main.cf :
>
> virtual_alias_maps = regexp:/etc/postfix/virtual
> Here is my /etc/postfix/virtual :
>
> # BEGIN SNIPPET
>
> ^domain1\.com DOMAIN
> ^domain2\.com DOMAIN
The above lines violate the documented table syntax. In addition, virtual
alias rewriting applies to *ALL* domains, not just virtual alias domains.
So the above is not going to work the way you want, even if expressed
correctly.
> /^tech
/ email1
otherdomain.com
> /
/ email2
otherdomain.com
>
> # END SNIPPET
>
>
>
> My goal is to have a list of domains, where :
>
> - all emails sent to tech
thesedomains are forwarded to
> email1
otherdomain.com
>
> - all emails sent to anythingelse
thesedomains (catch-all) are forwarded
to
> email2
otherdomain.com.
this will not work as written. And does not even require regexp tables,
which
make this unnecessarily complicated.
> "Patterns are applied in the order as specified in the table, until a
> pattern is found that matches the search string".
>
> So the first matching pattern, and not the second one, should be used (as
> postmap correctly does).
>
> Any idea why ?
Virtual expansion is recursive, and your approach is fundamentally flawed.
With indexed files (hash, btree, ...) use:
# Catch-all with identity mapping for RHS to terminate recursion
domain catch-all
other-domain
catch-all
other-domain catch-all
other-domain
# Exception with identity mapping for RHS to terminate recursion
exception
domain exception
other-domain
exception
other-domain exception
other-domain
for each domain in question.
--
Viktor.
Disclaimer: off-list followups get on-list replies or get ignored.
Please do not ignore the "Reply-To" header.
To unsubscribe from the postfix-users list, visit
http://www.postfix.org/lists.html or click the link below:
<mailto:majordomo
postfix.org?body=unsubscribe%20postfix-users>
If my response solves your problem, the best way to thank me is to not
send an "it worked, thanks" follow-up. If you must respond, please put
"It worked, thanks" in the "Subject" so I can delete these quickly.
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]