Introduction to Outgoing IPs

By default, when your mail server sends out email the SMTP connection will come from the system’s default IP address, typically that assigned to eth0 . Even if the email is from a domain that has its own private IP, that address will not be used when sending email.

This behavior can be changed on systems running Postfix version 2.7 and Virtualmin 3.94 or later, so that outgoing email from a domain with a private IP address appears to come from that address. This can be useful for separating email from multiple domains as seen by other mail servers, or for setting up per-domain reverse DNS records.

Initial Configuration

This feature requires Postfix 2.7 (seen on most modern Linux distributions), Virtualmin 3.93 and ideally Webmin 1.600. The steps to set it up are as follows :

  1. SSH into the system asroot, and edit the/etc/postfix/main.cffile.
  2. Look for a line starting withsender_dependent_default_transport_maps. If it already exists, your system is already ready.
  3. Otherwise, add the linesender_dependent_default_transport_maps = hash:/etc/postfix/dependent
  4. Run the commandtouch /etc/postfix/dependent
  5. Run the commandpostmap hash:/etc/postfix/dependent

Enabling In Virtualmin

To enable use of a domain’s IP address for outgoing SMTP connections in Virtualmin, simply go to Server Configuration -> Email Settings , and change Send outgoing email for domain from IP to Virtual server’s address . Then click the Save button.

You can also enable this feature using the API command modify-mail , with the --outgoing-ip flag.

Postfix

    Recent Comments

    No comments to show.

    Recent Comments

      Categories

      Recent Posts

      Installing PMTA

      PMTA Powermta Introduction PowerMTA is a Commercial ...

      By Ilirjan Trushilla / January 14, 2023

      Sender Dependent

      Introduction to Outgoing IPs By default, ...

      By Ilirjan Trushilla / January 14, 2023

      Preheader

      You can insert invisible pre-header text ...

      By Ilirjan Trushilla / January 14, 2023

      Calendar

      April 2024
      M T W T F S S
      1234567
      891011121314
      15161718192021
      22232425262728
      2930  

      Archives