PostFix Sender-based Routing

If you want to use a more fine-grained model you can choose to relay the outgoing traffic for domains over separate users. This allows you to apply different settings per domain, but also provides the end user access to their own logfiles.

  1. Create a sasl_passwd file for the individual outgoing user(s) containing the following data, filled in with the user credentials:
  2. @demo-domain.invalid outgoing@demo-domain.invalid:THEPASSWORD

  3. Create a sender_relay file containing the following data, filled in with the domain and smarthost details:
  4. @demo-domain.invalid [SMARTHOST1]:587
    @domain-alias.invalid [SMARTHOST2]:587

  5. Postmap both files:
  6. postmap /etc/postfix/sasl_passwd
    postmap /etc/postfix/sender_relay

  7. Add the following information to the file, ensuring this is populated with the appropriate smarthost:
  8. relayhost = [SMARTHOST]:587
    smtp_sasl_auth_enable = yes
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
    smtp_sasl_security_options =
    smtp_sender_dependent_authentication = yes
    sender_dependent_relayhost_maps = hash:/etc/postfix/sender_relay

    The above extract also configures server-wide, to also filter those that are not added on the sender_relay file. If you do not want this and only want to filter specific domains remove the relayhost line from above

  9. Restart PostFix
  10. Disclaimer: This documentation may contain references to third party software or websites. N-able has no control over third party software or content and is not responsible for the availability, security, or operation, of any third-party software. If you decide to utilize a release involving third-party software, you do so entirely at your own risk and subject to the applicable third party’s terms and conditions of the use of such software. No information obtained by you from N-able or this documentation shall create any warranty for such software.