Le 07/10/2010 16:47, Basti a écrit :
Hello List,
I want to rebuild my complete postfix setup, because requirements have
changed for it...
By now the server is just relaying to servers behind it, and all users
get checked by reject_unverified_recipients, and then routet to the
backend servers by a transport entry in mysql. The Domains are in a
mysql db, with following settings in postfix:
relay_domains = proxy:mysql:/etc/postfix/mysql-relay_domains.cf
transport_maps = proxy:mysql:/etc/postfix/mysql-transport.cf
The database schema: (id, domain, transport)
But now I need a setup where I can mix the following requirements:
- Relay for domains with unknown user list, with
reject_unverified_recipients and per domain backend server transport.
- Relay for domains with fixed user list, and one backend server
transport.
- Relay for domains with fixed user list, but each address can have an
alternative transport (usera@ -> servera, userb@, serverb). eMails to
non existing addresses should be rejected (unknown user).
Here is how to restate your needs so that you can solve them:
Req1) you want relay domains of two types:
- domains with a list of valid recipients
=> This is the usual case. list the users in relay_recipient_maps
- domains for which you use reject_unverified_recipients
=> For these:
1) use virtual_alias_maps so that all addresses are valid
(j...@example.org => j...@example.org)
2) use something like
smtpd_sender_restrictions =
check_recipient_access proxy:mysql:/etc/postfix/domainstoverify.cf
to do the above, you can simply add a "verify" column to your domain table.
Req2) you want both per domain and per user transports
This is a standard postfix functionality. you need nothing special. you
seem to already have per domain transports (the "transport" column you
talked about). so you can simply create a per-user transports table.
An alternative to per user transports is virtual_alias_maps, possibly
combined with smtp_generic_maps. virtual_alias_maps would do:
j...@example.com => j...@server1.example.com
and smtp_generic_maps would do the opposite.
(- Per Domain amavis feed to another 127.0.0.1:10xxx for policy banks
in pre-queue setup)
With pre-queue (proxy_filter), that's not possible in postfix. do that
in amavisd instead.
With post-queue (content_filter), the problem is one message will go to
one filter, even if it has multiple recipients. so FILTER per recipient
is fragile.
if you really want that, then you need to split before and after filter
smtpd's into 2 instances (run postfix twice), in which case you can use
transport_maps (with this, a message to multiple recipients can be split
and passed to different filters).
but you really should do that in amavisd instead.
But I really don´t have an idea how this could be made easily by using
a database setup. Maybe I just need some buzzwords for another google
research :-)