On 07/05/2010 14:32, Wietse Venema wrote:
Simon Croome:
# main.cf
transport_maps = hash:/etc/postfix/transports
# /etc/postfix/transports
firstname.lastn...@example.com relay:lotus.notes.server:25
firstname1.lastna...@example.com relay:lotus.notes.server:25
firstname2.lastna...@example.com relay:lotus.notes.server:25
example.com relay:ocs.server:25
If you take the transport_maps solution, then you need to set up
a relay-recipient_maps table with the addresses of valid recipients,
I can save you a lot of work if your problem description was accurate.
1) Set up the relay_recipient_maps over LDAP as discussed by Patrick.
This ensures that Postfix will NOT accept mail for bogus addresses.
2) Instead of one transport map entry per user, use a regular expression:
/etc/postfix/main.cf:
transport_maps = regexp:/etc/postfix/transports.regexp
/etc/postfix/transports.regexp
/\...@example\.com$/ relay:lotus.notes.server:25
/@example\.com$/ relay:ocs.server:25
The first pattern sends send first.l...@example.com to lotus.notes.server,
and the second sends all other example.com mail to ocs.server.
Caution: regular expressions are unlike file name wildcards. The
above example uses "\." to match a dot character, ".+" for wild-card,
and $ at the end.
Wietse
Thanks for you help with the above problem.
Could I ask what would be the best way to prevent connections to
postfix, similar to how tcp wrappers is used with sendmail.
I only want approx 4 ip addresses which would be in different network to
be able to connect the postfix daemon ?
Thanks again.