Postfix as Outbound relay FROM gmail for my domain

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












One of the config options in G suite (or google for my domain or whatever its called now) lets one designate some external server to relay outbound email from gmail (i.e. email sent in gmail goes through the external server). I'd like to setup postfix to do this but all the results only cover using postfix to relay to not from gmail.



My understanding is that I would include the gmail ip addresses in my mynetworks setting (or otherwise permit it in smtpd_relay_restrictions). However, the docs for G suite tell us that these ip addresses change frequently and should be dynamically (or at least regularly) inferred via the following procedure:




nslookup -q=TXT _spf.google.com 8.8.8.8


This returns a list of the domains included in Google's SPF record, such as:
_netblocks.google.com, _netblocks2.google.com, _netblocks3.google.com



Now look up the DNS records associated with those domains, one at a time, like so:



nslookup -q=TXT _netblocks.google.com 8.8.8.8

nslookup -q=TXT _netblocks2.google.com 8.8.8.8

nslookup -q=TXT _netblocks3.google.com 8.8.8.8



And I can't figure out how I would automatically set up mynetworks to include this whole list.







share|improve this question
























    up vote
    0
    down vote

    favorite












    One of the config options in G suite (or google for my domain or whatever its called now) lets one designate some external server to relay outbound email from gmail (i.e. email sent in gmail goes through the external server). I'd like to setup postfix to do this but all the results only cover using postfix to relay to not from gmail.



    My understanding is that I would include the gmail ip addresses in my mynetworks setting (or otherwise permit it in smtpd_relay_restrictions). However, the docs for G suite tell us that these ip addresses change frequently and should be dynamically (or at least regularly) inferred via the following procedure:




    nslookup -q=TXT _spf.google.com 8.8.8.8


    This returns a list of the domains included in Google's SPF record, such as:
    _netblocks.google.com, _netblocks2.google.com, _netblocks3.google.com



    Now look up the DNS records associated with those domains, one at a time, like so:



    nslookup -q=TXT _netblocks.google.com 8.8.8.8

    nslookup -q=TXT _netblocks2.google.com 8.8.8.8

    nslookup -q=TXT _netblocks3.google.com 8.8.8.8



    And I can't figure out how I would automatically set up mynetworks to include this whole list.







    share|improve this question






















      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      One of the config options in G suite (or google for my domain or whatever its called now) lets one designate some external server to relay outbound email from gmail (i.e. email sent in gmail goes through the external server). I'd like to setup postfix to do this but all the results only cover using postfix to relay to not from gmail.



      My understanding is that I would include the gmail ip addresses in my mynetworks setting (or otherwise permit it in smtpd_relay_restrictions). However, the docs for G suite tell us that these ip addresses change frequently and should be dynamically (or at least regularly) inferred via the following procedure:




      nslookup -q=TXT _spf.google.com 8.8.8.8


      This returns a list of the domains included in Google's SPF record, such as:
      _netblocks.google.com, _netblocks2.google.com, _netblocks3.google.com



      Now look up the DNS records associated with those domains, one at a time, like so:



      nslookup -q=TXT _netblocks.google.com 8.8.8.8

      nslookup -q=TXT _netblocks2.google.com 8.8.8.8

      nslookup -q=TXT _netblocks3.google.com 8.8.8.8



      And I can't figure out how I would automatically set up mynetworks to include this whole list.







      share|improve this question












      One of the config options in G suite (or google for my domain or whatever its called now) lets one designate some external server to relay outbound email from gmail (i.e. email sent in gmail goes through the external server). I'd like to setup postfix to do this but all the results only cover using postfix to relay to not from gmail.



      My understanding is that I would include the gmail ip addresses in my mynetworks setting (or otherwise permit it in smtpd_relay_restrictions). However, the docs for G suite tell us that these ip addresses change frequently and should be dynamically (or at least regularly) inferred via the following procedure:




      nslookup -q=TXT _spf.google.com 8.8.8.8


      This returns a list of the domains included in Google's SPF record, such as:
      _netblocks.google.com, _netblocks2.google.com, _netblocks3.google.com



      Now look up the DNS records associated with those domains, one at a time, like so:



      nslookup -q=TXT _netblocks.google.com 8.8.8.8

      nslookup -q=TXT _netblocks2.google.com 8.8.8.8

      nslookup -q=TXT _netblocks3.google.com 8.8.8.8



      And I can't figure out how I would automatically set up mynetworks to include this whole list.









      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 22 '17 at 11:10









      Peter Gerdes

      1114




      1114

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );








           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f412481%2fpostfix-as-outbound-relay-from-gmail-for-my-domain%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes










           

          draft saved


          draft discarded


























           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f412481%2fpostfix-as-outbound-relay-from-gmail-for-my-domain%23new-answer', 'question_page');

          );

          Post as a guest













































































          Popular posts from this blog

          How to check contact read email or not when send email to Individual?

          Displaying single band from multi-band raster using QGIS

          How many registers does an x86_64 CPU actually have?