Ozy Mate:
> Dear Friends,
> 
> I have signed up with a 3rd party smtp server as relay host. This server
> needs the following lines in the main.cf of our server instead of relayhost
> direction:
> 
> smtp_sender_dependent_authentication = yes
> sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay
> smtp_sasl_auth_enable = yes
> smtp_sasl_security_options = noanonymous
> smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
> 
> This is working fine. However, all the senders/domains not listed in
> sender_relay file are still able to send emails directly from our email
> server. How can I block this? I mean sender not listed in sender_relay file
> should not be able to send any email from our Postfix server.

That's easy enough, use sender_dependent_default_transport_maps, 
and a default transport that returns mail as undeliverable.

/etc/postfix/main.cf:
    sender_dependent_default_transport_maps = hash:/etc/postfix/sender_relay
    default_transport = error:5.7.1 sender is not authorized

/etc/postfix/sender_relay:
    # sender          transport:nexthop
    us...@example.com smtp:relay-for-user-1.example
    us...@example.com smtp:relay-for-user-2.example

        Wietse


Reply via email to