Integrating Postfix with Email Delivery

Configure Postfix to Send Email Through Email Delivery

You can use Postfix to send emails through Email Delivery. Before you use Postfix you must configure Oracle Cloud Infrastructure Email Delivery in your Postfix application.


The paths and commands used below for specifying file locations are specific to Ubuntu/Debian; your file paths or editing commands may differ depending on the operating system you are using. The changes to the configuration files are the same.

To enable Postfix to integrate with Email Delivery:

  1. Make sure Email Delivery is configured to send email. See Getting Started with Email Delivery.


    The SMTP credentials are required to configure Postfix to use Email Delivery. Be sure to note the user name and password when you generate the SMTP credentials.

  2. To open the file, run the following command:

    sudo vi /etc/postfix/

    Add the following information to the end of the file:

    smtp_tls_security_level = may 
    smtp_sasl_auth_enable = yes 
    smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd 
    smtp_sasl_security_options =
  3. Update the Postfix file.

    If the following line is present, either remove the line or turn it off:

    smtpd_use_tls = yes
  4. Update relayhost to include your SMTP connection endpoint and port. For example:

    relayhost =		
  5. Create the sasl_passwd file in the same directory as

    Run the following command:

    sudo vi /etc/postfix/sasl_passwd
  6. Add your relay host and port by entering:

    server:port user:pass


    • server is your relay host and port is 25 or 587.
    • user is the user name and pass is the password you received when you generated your SMTP credentials.
  7. Enter the permissions in the password file.

    Run the following command:

    sudo chown root:root /etc/postfix/sasl_passwd && sudo chmod 600 /etc/postfix/sasl_passwd
  8. Generate the password hash.

    Run the following command:

    sudo postmap hash:/etc/postfix/sasl_passwd
  9. Reload Postfix.

    Run the following command:

    sudo postfix reload
  10. Test the configuration by sending a test email.

    Run the following command:

    echo "This is a test message" | mail -s "Test" -r "<approved sender email address>" <recipient email address>

    If you want to monitor the log while you send the test email, open a separate Terminal window and run the following command before running the test command:

    log stream --predicate '(process == "smtpd") || (process == "smtp")' --info

    A status=sent (250 Ok) message in the log indicates the email was sent successfully.


If you are using SASL authentication, you must use the following RPM package: cyrus-sasl-plain. See the PostFix website for further documentation on configuring SASL authentication.