Send system mail Ubuntu 18.04Local system mail and command line mail through gmailSetting up webserver with...

How could our ancestors have domesticated a solitary predator?

Is it true that real estate prices mainly go up?

Making a sword in the stone, in a medieval world without magic

How much attack damage does the AC boost from a shield prevent on average?

Good allowance savings plan?

What to do when during a meeting client people start to fight (even physically) with each others?

Offered promotion but I'm leaving. Should I tell?

How to create a hard link to an inode (ext4)?

Peter's Strange Word

Why is Beresheet doing a only a one-way trip?

If the Captain's screens are out, does he switch seats with the co-pilot?

Do I really need to have a scientific explanation for my premise?

Does "variables should live in the smallest scope as possible" include the case "variables should not exist if possible"?

They call me Inspector Morse

Is there a window switcher for GNOME that shows the actual window?

Do f-stop and exposure time perfectly cancel?

Extra alignment tab has been changed to cr. } using table, tabular and resizebox

Logic. Truth of a negation

Should I tell my boss the work he did was worthless

BitNot does not flip bits in the way I expected

Unreachable code, but reachable with exception

My story is written in English, but is set in my home country. What language should I use for the dialogue?

Is Gradient Descent central to every optimizer?

Solving "Resistance between two nodes on a grid" problem in Mathematica



Send system mail Ubuntu 18.04


Local system mail and command line mail through gmailSetting up webserver with ISPConfig : mail configurationSend mail as from my personal gmail accountSend mail from command line?Virtual user mail server setupNot able to send/receive emails outside my Domain from recently configured email-serversetup sendmail smtp to add use it as gmail aliasPOSTFIX: Can Not Send Mail To Other Domains Using Mail ClientUsing Ubuntu as an SMTP server for Gmail













1















Hello I have looked at many different guides on the web for how to send system mail to my gmail from ubuntu 18.04 in case of problems on the device / server - But can't find a simple guide that i think makes sense? Someone who has some advice?



I don't want to set up a mail server but keep it as simple as possible when I'm a beginner. If I could use google smtp server to do that it would be an advantage rather than having to mess with my own domain :)










share|improve this question



























    1















    Hello I have looked at many different guides on the web for how to send system mail to my gmail from ubuntu 18.04 in case of problems on the device / server - But can't find a simple guide that i think makes sense? Someone who has some advice?



    I don't want to set up a mail server but keep it as simple as possible when I'm a beginner. If I could use google smtp server to do that it would be an advantage rather than having to mess with my own domain :)










    share|improve this question

























      1












      1








      1


      1






      Hello I have looked at many different guides on the web for how to send system mail to my gmail from ubuntu 18.04 in case of problems on the device / server - But can't find a simple guide that i think makes sense? Someone who has some advice?



      I don't want to set up a mail server but keep it as simple as possible when I'm a beginner. If I could use google smtp server to do that it would be an advantage rather than having to mess with my own domain :)










      share|improve this question














      Hello I have looked at many different guides on the web for how to send system mail to my gmail from ubuntu 18.04 in case of problems on the device / server - But can't find a simple guide that i think makes sense? Someone who has some advice?



      I don't want to set up a mail server but keep it as simple as possible when I'm a beginner. If I could use google smtp server to do that it would be an advantage rather than having to mess with my own domain :)







      mail gmail






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 25 at 12:53









      Rene MortensenRene Mortensen

      205




      205






















          1 Answer
          1






          active

          oldest

          votes


















          2














          Install the packages needed to get a basic system for handling mail:



          sudo apt-get install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules


          Next modify (as root) the configuration file /etc/postfix/main.cf to have something like this:



          relayhost = [smtp.gmail.com]:587
          smtp_sasl_auth_enable = yes
          smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
          smtp_sasl_security_options = noanonymous
          smtp_tls_CApath = /etc/ssl/certs
          smtpd_tls_CApath = /etc/ssl/certs
          smtp_use_tls = yes


          Next create/modify (as root) the /etc/postfix/sasl_passwd to contain:



          [smtp.gmail.com]:587    USERNAME@gmail.com:PASSWORD


          Make sure the permissions for the file are correct or it might get mad:



          sudo chmod 400 /etc/postfix/sasl_passwd
          sudo postmap /etc/postfix/sasl_passwd


          Lastly reload postifx:



          sudo /etc/init.d/postfix reload


          Now you can run a test:



          echo "Test mail thingy" | mail -s "Test Postfix Subject" username@gmail.com


          You should get an email that comes from the SMTP account you configured.






          share|improve this answer


























          • Thank you :) How do i set it to send local output - or if you did it in your guide above how it works :)?

            – Rene Mortensen
            Jan 25 at 14:31











          • I have followed the above but do not get any mail in my inbox when I run the command: echo "Test mail thingy" | mail -s "Test Postfix Subject" rmortensen84@gmail.com

            – Rene Mortensen
            Jan 25 at 16:03











          • You'll want to look at /var/log/mail.log for why the send failed. If it says SSL authentication failed you might have to go to this URL to authorize your "device" google.com/accounts/DisplayUnlockCaptcha

            – Kristopher Ives
            Jan 25 at 17:56











          • It's also possible that if it says SSL error it's because /etc/ssl/certs doesn't contain the certificate for Gmail, although I'm not certain why, but I have read you may also need to set smtpd_tls_CApath which I have added to the config example in this answer.

            – Kristopher Ives
            Jan 25 at 17:58











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "89"
          };
          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',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112772%2fsend-system-mail-ubuntu-18-04%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          1 Answer
          1






          active

          oldest

          votes








          1 Answer
          1






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes









          2














          Install the packages needed to get a basic system for handling mail:



          sudo apt-get install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules


          Next modify (as root) the configuration file /etc/postfix/main.cf to have something like this:



          relayhost = [smtp.gmail.com]:587
          smtp_sasl_auth_enable = yes
          smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
          smtp_sasl_security_options = noanonymous
          smtp_tls_CApath = /etc/ssl/certs
          smtpd_tls_CApath = /etc/ssl/certs
          smtp_use_tls = yes


          Next create/modify (as root) the /etc/postfix/sasl_passwd to contain:



          [smtp.gmail.com]:587    USERNAME@gmail.com:PASSWORD


          Make sure the permissions for the file are correct or it might get mad:



          sudo chmod 400 /etc/postfix/sasl_passwd
          sudo postmap /etc/postfix/sasl_passwd


          Lastly reload postifx:



          sudo /etc/init.d/postfix reload


          Now you can run a test:



          echo "Test mail thingy" | mail -s "Test Postfix Subject" username@gmail.com


          You should get an email that comes from the SMTP account you configured.






          share|improve this answer


























          • Thank you :) How do i set it to send local output - or if you did it in your guide above how it works :)?

            – Rene Mortensen
            Jan 25 at 14:31











          • I have followed the above but do not get any mail in my inbox when I run the command: echo "Test mail thingy" | mail -s "Test Postfix Subject" rmortensen84@gmail.com

            – Rene Mortensen
            Jan 25 at 16:03











          • You'll want to look at /var/log/mail.log for why the send failed. If it says SSL authentication failed you might have to go to this URL to authorize your "device" google.com/accounts/DisplayUnlockCaptcha

            – Kristopher Ives
            Jan 25 at 17:56











          • It's also possible that if it says SSL error it's because /etc/ssl/certs doesn't contain the certificate for Gmail, although I'm not certain why, but I have read you may also need to set smtpd_tls_CApath which I have added to the config example in this answer.

            – Kristopher Ives
            Jan 25 at 17:58
















          2














          Install the packages needed to get a basic system for handling mail:



          sudo apt-get install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules


          Next modify (as root) the configuration file /etc/postfix/main.cf to have something like this:



          relayhost = [smtp.gmail.com]:587
          smtp_sasl_auth_enable = yes
          smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
          smtp_sasl_security_options = noanonymous
          smtp_tls_CApath = /etc/ssl/certs
          smtpd_tls_CApath = /etc/ssl/certs
          smtp_use_tls = yes


          Next create/modify (as root) the /etc/postfix/sasl_passwd to contain:



          [smtp.gmail.com]:587    USERNAME@gmail.com:PASSWORD


          Make sure the permissions for the file are correct or it might get mad:



          sudo chmod 400 /etc/postfix/sasl_passwd
          sudo postmap /etc/postfix/sasl_passwd


          Lastly reload postifx:



          sudo /etc/init.d/postfix reload


          Now you can run a test:



          echo "Test mail thingy" | mail -s "Test Postfix Subject" username@gmail.com


          You should get an email that comes from the SMTP account you configured.






          share|improve this answer


























          • Thank you :) How do i set it to send local output - or if you did it in your guide above how it works :)?

            – Rene Mortensen
            Jan 25 at 14:31











          • I have followed the above but do not get any mail in my inbox when I run the command: echo "Test mail thingy" | mail -s "Test Postfix Subject" rmortensen84@gmail.com

            – Rene Mortensen
            Jan 25 at 16:03











          • You'll want to look at /var/log/mail.log for why the send failed. If it says SSL authentication failed you might have to go to this URL to authorize your "device" google.com/accounts/DisplayUnlockCaptcha

            – Kristopher Ives
            Jan 25 at 17:56











          • It's also possible that if it says SSL error it's because /etc/ssl/certs doesn't contain the certificate for Gmail, although I'm not certain why, but I have read you may also need to set smtpd_tls_CApath which I have added to the config example in this answer.

            – Kristopher Ives
            Jan 25 at 17:58














          2












          2








          2







          Install the packages needed to get a basic system for handling mail:



          sudo apt-get install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules


          Next modify (as root) the configuration file /etc/postfix/main.cf to have something like this:



          relayhost = [smtp.gmail.com]:587
          smtp_sasl_auth_enable = yes
          smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
          smtp_sasl_security_options = noanonymous
          smtp_tls_CApath = /etc/ssl/certs
          smtpd_tls_CApath = /etc/ssl/certs
          smtp_use_tls = yes


          Next create/modify (as root) the /etc/postfix/sasl_passwd to contain:



          [smtp.gmail.com]:587    USERNAME@gmail.com:PASSWORD


          Make sure the permissions for the file are correct or it might get mad:



          sudo chmod 400 /etc/postfix/sasl_passwd
          sudo postmap /etc/postfix/sasl_passwd


          Lastly reload postifx:



          sudo /etc/init.d/postfix reload


          Now you can run a test:



          echo "Test mail thingy" | mail -s "Test Postfix Subject" username@gmail.com


          You should get an email that comes from the SMTP account you configured.






          share|improve this answer















          Install the packages needed to get a basic system for handling mail:



          sudo apt-get install postfix mailutils libsasl2-2 ca-certificates libsasl2-modules


          Next modify (as root) the configuration file /etc/postfix/main.cf to have something like this:



          relayhost = [smtp.gmail.com]:587
          smtp_sasl_auth_enable = yes
          smtp_sasl_password_maps = hash:/etc/postfix/sasl_passwd
          smtp_sasl_security_options = noanonymous
          smtp_tls_CApath = /etc/ssl/certs
          smtpd_tls_CApath = /etc/ssl/certs
          smtp_use_tls = yes


          Next create/modify (as root) the /etc/postfix/sasl_passwd to contain:



          [smtp.gmail.com]:587    USERNAME@gmail.com:PASSWORD


          Make sure the permissions for the file are correct or it might get mad:



          sudo chmod 400 /etc/postfix/sasl_passwd
          sudo postmap /etc/postfix/sasl_passwd


          Lastly reload postifx:



          sudo /etc/init.d/postfix reload


          Now you can run a test:



          echo "Test mail thingy" | mail -s "Test Postfix Subject" username@gmail.com


          You should get an email that comes from the SMTP account you configured.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited 11 mins ago









          Ron

          1034




          1034










          answered Jan 25 at 13:50









          Kristopher IvesKristopher Ives

          2,90211525




          2,90211525













          • Thank you :) How do i set it to send local output - or if you did it in your guide above how it works :)?

            – Rene Mortensen
            Jan 25 at 14:31











          • I have followed the above but do not get any mail in my inbox when I run the command: echo "Test mail thingy" | mail -s "Test Postfix Subject" rmortensen84@gmail.com

            – Rene Mortensen
            Jan 25 at 16:03











          • You'll want to look at /var/log/mail.log for why the send failed. If it says SSL authentication failed you might have to go to this URL to authorize your "device" google.com/accounts/DisplayUnlockCaptcha

            – Kristopher Ives
            Jan 25 at 17:56











          • It's also possible that if it says SSL error it's because /etc/ssl/certs doesn't contain the certificate for Gmail, although I'm not certain why, but I have read you may also need to set smtpd_tls_CApath which I have added to the config example in this answer.

            – Kristopher Ives
            Jan 25 at 17:58



















          • Thank you :) How do i set it to send local output - or if you did it in your guide above how it works :)?

            – Rene Mortensen
            Jan 25 at 14:31











          • I have followed the above but do not get any mail in my inbox when I run the command: echo "Test mail thingy" | mail -s "Test Postfix Subject" rmortensen84@gmail.com

            – Rene Mortensen
            Jan 25 at 16:03











          • You'll want to look at /var/log/mail.log for why the send failed. If it says SSL authentication failed you might have to go to this URL to authorize your "device" google.com/accounts/DisplayUnlockCaptcha

            – Kristopher Ives
            Jan 25 at 17:56











          • It's also possible that if it says SSL error it's because /etc/ssl/certs doesn't contain the certificate for Gmail, although I'm not certain why, but I have read you may also need to set smtpd_tls_CApath which I have added to the config example in this answer.

            – Kristopher Ives
            Jan 25 at 17:58

















          Thank you :) How do i set it to send local output - or if you did it in your guide above how it works :)?

          – Rene Mortensen
          Jan 25 at 14:31





          Thank you :) How do i set it to send local output - or if you did it in your guide above how it works :)?

          – Rene Mortensen
          Jan 25 at 14:31













          I have followed the above but do not get any mail in my inbox when I run the command: echo "Test mail thingy" | mail -s "Test Postfix Subject" rmortensen84@gmail.com

          – Rene Mortensen
          Jan 25 at 16:03





          I have followed the above but do not get any mail in my inbox when I run the command: echo "Test mail thingy" | mail -s "Test Postfix Subject" rmortensen84@gmail.com

          – Rene Mortensen
          Jan 25 at 16:03













          You'll want to look at /var/log/mail.log for why the send failed. If it says SSL authentication failed you might have to go to this URL to authorize your "device" google.com/accounts/DisplayUnlockCaptcha

          – Kristopher Ives
          Jan 25 at 17:56





          You'll want to look at /var/log/mail.log for why the send failed. If it says SSL authentication failed you might have to go to this URL to authorize your "device" google.com/accounts/DisplayUnlockCaptcha

          – Kristopher Ives
          Jan 25 at 17:56













          It's also possible that if it says SSL error it's because /etc/ssl/certs doesn't contain the certificate for Gmail, although I'm not certain why, but I have read you may also need to set smtpd_tls_CApath which I have added to the config example in this answer.

          – Kristopher Ives
          Jan 25 at 17:58





          It's also possible that if it says SSL error it's because /etc/ssl/certs doesn't contain the certificate for Gmail, although I'm not certain why, but I have read you may also need to set smtpd_tls_CApath which I have added to the config example in this answer.

          – Kristopher Ives
          Jan 25 at 17:58


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Ask Ubuntu!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f1112772%2fsend-system-mail-ubuntu-18-04%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          List of shipwrecks in 1808...

          Is there a lightweight tool to crop images quickly?Cropping Images using Command Line Tools OnlyHow to crop...

          Unit packagekit.service is masked Announcing the arrival of Valued Associate #679: Cesar...