ML
    • Recent
    • Categories
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Basic Email Sending with Linux

    IT Discussion
    postfix fedora linux fedora 27 mailx smtp email
    6
    14
    1.6k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • scottalanmillerS
      scottalanmiller
      last edited by

      Sending email directly from Linux is super, duper simple. In this example, we will use Fedora 27 which is actually one of the hardest Linux editions to use for email because the underlying components are not included by default on their server installs like they used to be. In order to send email from any system, we need two components: an MTA (the email server that sends email out using the SMTP protocol) and an email client (the thing that actually tells the MTA to send a message.) This is the same for any OS, nothing unique to Linux. Linux just makes this all SO easy.

      First let's install our two components. On Linux, postfix has come out as the clear MTA favourite over the last few decades. You can use others if you want, like sendmail, but postfix is the most commonly used, easiest to use, most often included by default for distros where you don't need to add it, etc. Then we will use mailx which gives us the "mail" command that allows us to actually tell postfix what to send.

      On Fedora using the dnf command we just need this...

      dnf -y install postfix mailx
      

      Now it is easy to forget that the MTA is a service, not an "as needed" application. So we just need to kick it off so that it is running.

      systemctl start postfix
      

      Now we are literally all set and can email ourselves from our system! Seriously, that's all that is required. It's that easy on Linux. No third party software and zero configuration. It "Just works".

      Here is a sample command to send your first email....

      echo "This is my email message" | mail -s "This is my email subject" [email protected]
      

      Now if you want postfix to run all of the time, you'll want to set it to start automatically to make this easier in the future.

      systemctl enable postfix
      

      Linux.... simple and effective.

      1 Reply Last reply Reply Quote 4
      • wirestyle22W
        wirestyle22
        last edited by

        I'd love a Zimbra install guide 😄

        scottalanmillerS 1 Reply Last reply Reply Quote 0
        • BRRABillB
          BRRABill
          last edited by

          @scottalanmiller

          If you have multiple servers on a network, do you install postfix on each one? Or just set up one? What's YOUR best practice there?

          JaredBuschJ scottalanmillerS 2 Replies Last reply Reply Quote 0
          • JaredBuschJ
            JaredBusch @BRRABill
            last edited by

            @brrabill said in Basic Email Sending with Linux:

            @scottalanmiller

            If you have multiple servers on a network, do you install postfix on each one? Or just set up one? What's YOUR best practice there?

            oh FFS I went through this with you the other day..

            I assume this thread is a response to a private conversation you had with @scottalanmiller after your failure to get email from your dnf-automatic setup.

            Start a thread to discuss that if you want, I am not going to clutter this thread with anymore replies regarding this.

            BRRABillB DashrenderD 2 Replies Last reply Reply Quote 0
            • BRRABillB
              BRRABill @JaredBusch
              last edited by

              @jaredbusch

              Where is my "so salty" meme?

              1 Reply Last reply Reply Quote 0
              • scottalanmillerS
                scottalanmiller @wirestyle22
                last edited by

                @wirestyle22 said in Basic Email Sending with Linux:

                I'd love a Zimbra install guide 😄

                Here you go...

                https://mangolassi.it/topic/8344/installing-zimbra-email-8-6-on-centos-7

                1 Reply Last reply Reply Quote 0
                • scottalanmillerS
                  scottalanmiller @BRRABill
                  last edited by

                  @brrabill said in Basic Email Sending with Linux:

                  @scottalanmiller

                  If you have multiple servers on a network, do you install postfix on each one? Or just set up one? What's YOUR best practice there?

                  Yes, otherwise how will you send out the email as the client needs to communicate over the network and postfix is what provides the network protocol. The mailx command doesn't have a network component, it just drops files into the postfix local queue.

                  JaredBuschJ 1 Reply Last reply Reply Quote 1
                  • JaredBuschJ
                    JaredBusch @scottalanmiller
                    last edited by

                    @scottalanmiller said in Basic Email Sending with Linux:

                    @brrabill said in Basic Email Sending with Linux:

                    @scottalanmiller

                    If you have multiple servers on a network, do you install postfix on each one? Or just set up one? What's YOUR best practice there?

                    Yes, otherwise how will you send out the email as the client needs to communicate over the network and postfix is what provides the network protocol. The mailx command doesn't have a network component, it just drops files into the postfix local queue.

                    Correct answer to his incorrectly worded question.

                    The correct answer to him is no.

                    scottalanmillerS 1 Reply Last reply Reply Quote 2
                    • scottalanmillerS
                      scottalanmiller @JaredBusch
                      last edited by

                      @jaredbusch said in Basic Email Sending with Linux:

                      @scottalanmiller said in Basic Email Sending with Linux:

                      @brrabill said in Basic Email Sending with Linux:

                      @scottalanmiller

                      If you have multiple servers on a network, do you install postfix on each one? Or just set up one? What's YOUR best practice there?

                      Yes, otherwise how will you send out the email as the client needs to communicate over the network and postfix is what provides the network protocol. The mailx command doesn't have a network component, it just drops files into the postfix local queue.

                      Correct answer to his incorrectly worded question.

                      The correct answer to him is no.

                      LOL

                      1 Reply Last reply Reply Quote 0
                      • ObsolesceO
                        Obsolesce
                        last edited by

                        If your email is hosted through somewhere else, such as O365, you'll need to edit your SPF record to allow emails from that server or use an SMTP server that authenticates with and relays to O365.

                        DNF-Automatic, for example, from what I've seen, does not have SMTP authentication options. So I've been using an SMTP server.

                        DashrenderD 1 Reply Last reply Reply Quote 0
                        • DashrenderD
                          Dashrender @Obsolesce
                          last edited by

                          @tim_g said in Basic Email Sending with Linux:

                          If your email is hosted through somewhere else, such as O365, you'll need to edit your SPF record to allow emails from that server or use an SMTP server that authenticates with and relays to O365.

                          DNF-Automatic, for example, from what I've seen, does not have SMTP authentication options. So I've been using an SMTP server.

                          O365 has options for IP authenticated relay (but I think it's only to your own domains, it won't relay through O365 to other domains - again I think).

                          1 Reply Last reply Reply Quote 0
                          • DashrenderD
                            Dashrender @JaredBusch
                            last edited by

                            @jaredbusch said in Basic Email Sending with Linux:

                            @brrabill said in Basic Email Sending with Linux:

                            @scottalanmiller

                            If you have multiple servers on a network, do you install postfix on each one? Or just set up one? What's YOUR best practice there?

                            oh FFS I went through this with you the other day..

                            I assume this thread is a response to a private conversation you had with @scottalanmiller after your failure to get email from your dnf-automatic setup.

                            Start a thread to discuss that if you want, I am not going to clutter this thread with anymore replies regarding this.

                            https://i.imgur.com/iwOuYCN.jpg

                            wirestyle22W 1 Reply Last reply Reply Quote 0
                            • wirestyle22W
                              wirestyle22 @Dashrender
                              last edited by

                              @dashrender said in Basic Email Sending with Linux:

                              @jaredbusch said in Basic Email Sending with Linux:

                              @brrabill said in Basic Email Sending with Linux:

                              @scottalanmiller

                              If you have multiple servers on a network, do you install postfix on each one? Or just set up one? What's YOUR best practice there?

                              oh FFS I went through this with you the other day..

                              I assume this thread is a response to a private conversation you had with @scottalanmiller after your failure to get email from your dnf-automatic setup.

                              Start a thread to discuss that if you want, I am not going to clutter this thread with anymore replies regarding this.

                              https://i.imgur.com/iwOuYCN.jpg

                              hahahahahahahahaha

                              got em

                              1 Reply Last reply Reply Quote 0
                              • wirestyle22W
                                wirestyle22
                                last edited by wirestyle22

                                @JaredBusch before this post
                                0_1513632960663_before.jpg

                                @JaredBusch after this post
                                0_1513632969516_after.jpg

                                1 Reply Last reply Reply Quote 0
                                • 1 / 1
                                • First post
                                  Last post