How do I create a local mail account?

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











up vote
2
down vote

favorite












I want to create a local mail account suitable for apt-listchanges. In other words, local services will send mail to local@localhost (?) and I should be able to check that mailbox using a regular mail client (Thunderbird, Geany...)



This would preferably be a "system" account rather than a "user" account, but if userland apps can't access that, a "user" account will do.







share|improve this question


























    up vote
    2
    down vote

    favorite












    I want to create a local mail account suitable for apt-listchanges. In other words, local services will send mail to local@localhost (?) and I should be able to check that mailbox using a regular mail client (Thunderbird, Geany...)



    This would preferably be a "system" account rather than a "user" account, but if userland apps can't access that, a "user" account will do.







    share|improve this question
























      up vote
      2
      down vote

      favorite









      up vote
      2
      down vote

      favorite











      I want to create a local mail account suitable for apt-listchanges. In other words, local services will send mail to local@localhost (?) and I should be able to check that mailbox using a regular mail client (Thunderbird, Geany...)



      This would preferably be a "system" account rather than a "user" account, but if userland apps can't access that, a "user" account will do.







      share|improve this question














      I want to create a local mail account suitable for apt-listchanges. In other words, local services will send mail to local@localhost (?) and I should be able to check that mailbox using a regular mail client (Thunderbird, Geany...)



      This would preferably be a "system" account rather than a "user" account, but if userland apps can't access that, a "user" account will do.









      share|improve this question













      share|improve this question




      share|improve this question








      edited Feb 28 at 11:20

























      asked Feb 27 at 16:00









      d3vid

      741427




      741427




















          2 Answers
          2






          active

          oldest

          votes

















          up vote
          1
          down vote













          I'm not sure I understand what you mean by system and user
          accounts but if you're asking how to handle local e-mail on Linux
          it's quite simple. I don't use Ubuntu on the daily basis but I've
          just run the following in the virtual machine:



          $ sudo apt-get install sendmail


          sendmail is the name of the SMTP server that will deliver e-mails.



          $ sudo apt-get install mutt


          mutt is the name of the Mail User Agent that we'll use to read mail.



          Make sure that sendmail is running:



          $ ps aux | grep '[s]endmail'
          root 31687 0.0 0.1 108964 5408 ? Ss 19:24 0:00 sendmail: MTA: accepting connections


          Send a test e-mail to yourself:



          $ sendmail -i $(whoami) <<MAIL_END
          > Subject: test e-mail
          >
          > HELLO
          > MAIL_END


          Note that after pressing Enter you get:



          You have new mail in /var/mail/<USERNAME>



          Use mutt to read mail, for example:



          $ mutt -f /var/mail/ja


          Actually, when using mutt you don't even have to use -f:



          $ mutt


          is enough as mutt will try to open $MAIL. In Ubuntu it's defined by default:



          $ echo $MAIL
          /var/mail/ja





          share|improve this answer





























            up vote
            0
            down vote













            On a Debian-based system you should already have exim4 which provides the sendmail utility. Configure it as follows:



            1. Confirm FQDN



            exim4 requires a "fully qualified" domain name for your local machine, which just means it needs a dot in it. Confirm this with the following:



            $ hostname
            $ hostname --fqdn


            These will return your machine name and your FQDN. By default your FQDN is exactly the same as your machine name and does not contain a dot, and you need to change it.



            (If it is different and contains a dot, skip step 2.)



            2. Modify hosts file



            We will now set your FQDN. To do this modify your hosts file:



            sudo nano /etc/hosts


            You should see the following lines in the file (gaps are tabs):



            127.0.0.1 localhost
            127.0.1.1 HOSTNAME


            change this to...



            127.0.0.1 localhost
            127.0.1.1 mail.localhost HOSTNAME


            ...then save and exit. Repeat step one to confirm that your hostname remains the same, and your FQDN has been updated.



            3. Configure exim4



            Configure exim4 as follows:



            sudo dpkg-reconfigure exim4-config


            In the questions that follow select the following options (and otherwise select the defaults):



            • "local delivery only; not on a network"

            • System mail name: "mail.localhost"

            • Other destinations for which mail is accepted: "mail.localhost"

            • Keep number of DNS queries minimal? Yes

            • Delivery method: mbox format in /var/mail

            • Where to send root and postmaster mail: USERNAME@localhost

              • Now system messages will be sent to your user account and you don't need special permissions to access them


            4. Test



            To test, you can send a local email with mail USERNAME@localhost. Fill in the prompts as follows



            $ mail USERNAME@localhost
            Cc: <leave blank, hit enter>
            Subject: test subject
            test body <hit enter>
            <hit Ctrl-D>


            You can confirm the message has been received by typing mail. Hit Q to quit the text-based mail client.



            5. Configure MUA GUI



            Now configure your preferred GUI client for mbox access, and check that your test message also appears in your inbox there.






            share|improve this answer




















              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%2f426963%2fhow-do-i-create-a-local-mail-account%23new-answer', 'question_page');

              );

              Post as a guest






























              2 Answers
              2






              active

              oldest

              votes








              2 Answers
              2






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes








              up vote
              1
              down vote













              I'm not sure I understand what you mean by system and user
              accounts but if you're asking how to handle local e-mail on Linux
              it's quite simple. I don't use Ubuntu on the daily basis but I've
              just run the following in the virtual machine:



              $ sudo apt-get install sendmail


              sendmail is the name of the SMTP server that will deliver e-mails.



              $ sudo apt-get install mutt


              mutt is the name of the Mail User Agent that we'll use to read mail.



              Make sure that sendmail is running:



              $ ps aux | grep '[s]endmail'
              root 31687 0.0 0.1 108964 5408 ? Ss 19:24 0:00 sendmail: MTA: accepting connections


              Send a test e-mail to yourself:



              $ sendmail -i $(whoami) <<MAIL_END
              > Subject: test e-mail
              >
              > HELLO
              > MAIL_END


              Note that after pressing Enter you get:



              You have new mail in /var/mail/<USERNAME>



              Use mutt to read mail, for example:



              $ mutt -f /var/mail/ja


              Actually, when using mutt you don't even have to use -f:



              $ mutt


              is enough as mutt will try to open $MAIL. In Ubuntu it's defined by default:



              $ echo $MAIL
              /var/mail/ja





              share|improve this answer


























                up vote
                1
                down vote













                I'm not sure I understand what you mean by system and user
                accounts but if you're asking how to handle local e-mail on Linux
                it's quite simple. I don't use Ubuntu on the daily basis but I've
                just run the following in the virtual machine:



                $ sudo apt-get install sendmail


                sendmail is the name of the SMTP server that will deliver e-mails.



                $ sudo apt-get install mutt


                mutt is the name of the Mail User Agent that we'll use to read mail.



                Make sure that sendmail is running:



                $ ps aux | grep '[s]endmail'
                root 31687 0.0 0.1 108964 5408 ? Ss 19:24 0:00 sendmail: MTA: accepting connections


                Send a test e-mail to yourself:



                $ sendmail -i $(whoami) <<MAIL_END
                > Subject: test e-mail
                >
                > HELLO
                > MAIL_END


                Note that after pressing Enter you get:



                You have new mail in /var/mail/<USERNAME>



                Use mutt to read mail, for example:



                $ mutt -f /var/mail/ja


                Actually, when using mutt you don't even have to use -f:



                $ mutt


                is enough as mutt will try to open $MAIL. In Ubuntu it's defined by default:



                $ echo $MAIL
                /var/mail/ja





                share|improve this answer
























                  up vote
                  1
                  down vote










                  up vote
                  1
                  down vote









                  I'm not sure I understand what you mean by system and user
                  accounts but if you're asking how to handle local e-mail on Linux
                  it's quite simple. I don't use Ubuntu on the daily basis but I've
                  just run the following in the virtual machine:



                  $ sudo apt-get install sendmail


                  sendmail is the name of the SMTP server that will deliver e-mails.



                  $ sudo apt-get install mutt


                  mutt is the name of the Mail User Agent that we'll use to read mail.



                  Make sure that sendmail is running:



                  $ ps aux | grep '[s]endmail'
                  root 31687 0.0 0.1 108964 5408 ? Ss 19:24 0:00 sendmail: MTA: accepting connections


                  Send a test e-mail to yourself:



                  $ sendmail -i $(whoami) <<MAIL_END
                  > Subject: test e-mail
                  >
                  > HELLO
                  > MAIL_END


                  Note that after pressing Enter you get:



                  You have new mail in /var/mail/<USERNAME>



                  Use mutt to read mail, for example:



                  $ mutt -f /var/mail/ja


                  Actually, when using mutt you don't even have to use -f:



                  $ mutt


                  is enough as mutt will try to open $MAIL. In Ubuntu it's defined by default:



                  $ echo $MAIL
                  /var/mail/ja





                  share|improve this answer














                  I'm not sure I understand what you mean by system and user
                  accounts but if you're asking how to handle local e-mail on Linux
                  it's quite simple. I don't use Ubuntu on the daily basis but I've
                  just run the following in the virtual machine:



                  $ sudo apt-get install sendmail


                  sendmail is the name of the SMTP server that will deliver e-mails.



                  $ sudo apt-get install mutt


                  mutt is the name of the Mail User Agent that we'll use to read mail.



                  Make sure that sendmail is running:



                  $ ps aux | grep '[s]endmail'
                  root 31687 0.0 0.1 108964 5408 ? Ss 19:24 0:00 sendmail: MTA: accepting connections


                  Send a test e-mail to yourself:



                  $ sendmail -i $(whoami) <<MAIL_END
                  > Subject: test e-mail
                  >
                  > HELLO
                  > MAIL_END


                  Note that after pressing Enter you get:



                  You have new mail in /var/mail/<USERNAME>



                  Use mutt to read mail, for example:



                  $ mutt -f /var/mail/ja


                  Actually, when using mutt you don't even have to use -f:



                  $ mutt


                  is enough as mutt will try to open $MAIL. In Ubuntu it's defined by default:



                  $ echo $MAIL
                  /var/mail/ja






                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited Feb 27 at 20:42

























                  answered Feb 27 at 18:33









                  Arkadiusz Drabczyk

                  7,18521532




                  7,18521532






















                      up vote
                      0
                      down vote













                      On a Debian-based system you should already have exim4 which provides the sendmail utility. Configure it as follows:



                      1. Confirm FQDN



                      exim4 requires a "fully qualified" domain name for your local machine, which just means it needs a dot in it. Confirm this with the following:



                      $ hostname
                      $ hostname --fqdn


                      These will return your machine name and your FQDN. By default your FQDN is exactly the same as your machine name and does not contain a dot, and you need to change it.



                      (If it is different and contains a dot, skip step 2.)



                      2. Modify hosts file



                      We will now set your FQDN. To do this modify your hosts file:



                      sudo nano /etc/hosts


                      You should see the following lines in the file (gaps are tabs):



                      127.0.0.1 localhost
                      127.0.1.1 HOSTNAME


                      change this to...



                      127.0.0.1 localhost
                      127.0.1.1 mail.localhost HOSTNAME


                      ...then save and exit. Repeat step one to confirm that your hostname remains the same, and your FQDN has been updated.



                      3. Configure exim4



                      Configure exim4 as follows:



                      sudo dpkg-reconfigure exim4-config


                      In the questions that follow select the following options (and otherwise select the defaults):



                      • "local delivery only; not on a network"

                      • System mail name: "mail.localhost"

                      • Other destinations for which mail is accepted: "mail.localhost"

                      • Keep number of DNS queries minimal? Yes

                      • Delivery method: mbox format in /var/mail

                      • Where to send root and postmaster mail: USERNAME@localhost

                        • Now system messages will be sent to your user account and you don't need special permissions to access them


                      4. Test



                      To test, you can send a local email with mail USERNAME@localhost. Fill in the prompts as follows



                      $ mail USERNAME@localhost
                      Cc: <leave blank, hit enter>
                      Subject: test subject
                      test body <hit enter>
                      <hit Ctrl-D>


                      You can confirm the message has been received by typing mail. Hit Q to quit the text-based mail client.



                      5. Configure MUA GUI



                      Now configure your preferred GUI client for mbox access, and check that your test message also appears in your inbox there.






                      share|improve this answer
























                        up vote
                        0
                        down vote













                        On a Debian-based system you should already have exim4 which provides the sendmail utility. Configure it as follows:



                        1. Confirm FQDN



                        exim4 requires a "fully qualified" domain name for your local machine, which just means it needs a dot in it. Confirm this with the following:



                        $ hostname
                        $ hostname --fqdn


                        These will return your machine name and your FQDN. By default your FQDN is exactly the same as your machine name and does not contain a dot, and you need to change it.



                        (If it is different and contains a dot, skip step 2.)



                        2. Modify hosts file



                        We will now set your FQDN. To do this modify your hosts file:



                        sudo nano /etc/hosts


                        You should see the following lines in the file (gaps are tabs):



                        127.0.0.1 localhost
                        127.0.1.1 HOSTNAME


                        change this to...



                        127.0.0.1 localhost
                        127.0.1.1 mail.localhost HOSTNAME


                        ...then save and exit. Repeat step one to confirm that your hostname remains the same, and your FQDN has been updated.



                        3. Configure exim4



                        Configure exim4 as follows:



                        sudo dpkg-reconfigure exim4-config


                        In the questions that follow select the following options (and otherwise select the defaults):



                        • "local delivery only; not on a network"

                        • System mail name: "mail.localhost"

                        • Other destinations for which mail is accepted: "mail.localhost"

                        • Keep number of DNS queries minimal? Yes

                        • Delivery method: mbox format in /var/mail

                        • Where to send root and postmaster mail: USERNAME@localhost

                          • Now system messages will be sent to your user account and you don't need special permissions to access them


                        4. Test



                        To test, you can send a local email with mail USERNAME@localhost. Fill in the prompts as follows



                        $ mail USERNAME@localhost
                        Cc: <leave blank, hit enter>
                        Subject: test subject
                        test body <hit enter>
                        <hit Ctrl-D>


                        You can confirm the message has been received by typing mail. Hit Q to quit the text-based mail client.



                        5. Configure MUA GUI



                        Now configure your preferred GUI client for mbox access, and check that your test message also appears in your inbox there.






                        share|improve this answer






















                          up vote
                          0
                          down vote










                          up vote
                          0
                          down vote









                          On a Debian-based system you should already have exim4 which provides the sendmail utility. Configure it as follows:



                          1. Confirm FQDN



                          exim4 requires a "fully qualified" domain name for your local machine, which just means it needs a dot in it. Confirm this with the following:



                          $ hostname
                          $ hostname --fqdn


                          These will return your machine name and your FQDN. By default your FQDN is exactly the same as your machine name and does not contain a dot, and you need to change it.



                          (If it is different and contains a dot, skip step 2.)



                          2. Modify hosts file



                          We will now set your FQDN. To do this modify your hosts file:



                          sudo nano /etc/hosts


                          You should see the following lines in the file (gaps are tabs):



                          127.0.0.1 localhost
                          127.0.1.1 HOSTNAME


                          change this to...



                          127.0.0.1 localhost
                          127.0.1.1 mail.localhost HOSTNAME


                          ...then save and exit. Repeat step one to confirm that your hostname remains the same, and your FQDN has been updated.



                          3. Configure exim4



                          Configure exim4 as follows:



                          sudo dpkg-reconfigure exim4-config


                          In the questions that follow select the following options (and otherwise select the defaults):



                          • "local delivery only; not on a network"

                          • System mail name: "mail.localhost"

                          • Other destinations for which mail is accepted: "mail.localhost"

                          • Keep number of DNS queries minimal? Yes

                          • Delivery method: mbox format in /var/mail

                          • Where to send root and postmaster mail: USERNAME@localhost

                            • Now system messages will be sent to your user account and you don't need special permissions to access them


                          4. Test



                          To test, you can send a local email with mail USERNAME@localhost. Fill in the prompts as follows



                          $ mail USERNAME@localhost
                          Cc: <leave blank, hit enter>
                          Subject: test subject
                          test body <hit enter>
                          <hit Ctrl-D>


                          You can confirm the message has been received by typing mail. Hit Q to quit the text-based mail client.



                          5. Configure MUA GUI



                          Now configure your preferred GUI client for mbox access, and check that your test message also appears in your inbox there.






                          share|improve this answer












                          On a Debian-based system you should already have exim4 which provides the sendmail utility. Configure it as follows:



                          1. Confirm FQDN



                          exim4 requires a "fully qualified" domain name for your local machine, which just means it needs a dot in it. Confirm this with the following:



                          $ hostname
                          $ hostname --fqdn


                          These will return your machine name and your FQDN. By default your FQDN is exactly the same as your machine name and does not contain a dot, and you need to change it.



                          (If it is different and contains a dot, skip step 2.)



                          2. Modify hosts file



                          We will now set your FQDN. To do this modify your hosts file:



                          sudo nano /etc/hosts


                          You should see the following lines in the file (gaps are tabs):



                          127.0.0.1 localhost
                          127.0.1.1 HOSTNAME


                          change this to...



                          127.0.0.1 localhost
                          127.0.1.1 mail.localhost HOSTNAME


                          ...then save and exit. Repeat step one to confirm that your hostname remains the same, and your FQDN has been updated.



                          3. Configure exim4



                          Configure exim4 as follows:



                          sudo dpkg-reconfigure exim4-config


                          In the questions that follow select the following options (and otherwise select the defaults):



                          • "local delivery only; not on a network"

                          • System mail name: "mail.localhost"

                          • Other destinations for which mail is accepted: "mail.localhost"

                          • Keep number of DNS queries minimal? Yes

                          • Delivery method: mbox format in /var/mail

                          • Where to send root and postmaster mail: USERNAME@localhost

                            • Now system messages will be sent to your user account and you don't need special permissions to access them


                          4. Test



                          To test, you can send a local email with mail USERNAME@localhost. Fill in the prompts as follows



                          $ mail USERNAME@localhost
                          Cc: <leave blank, hit enter>
                          Subject: test subject
                          test body <hit enter>
                          <hit Ctrl-D>


                          You can confirm the message has been received by typing mail. Hit Q to quit the text-based mail client.



                          5. Configure MUA GUI



                          Now configure your preferred GUI client for mbox access, and check that your test message also appears in your inbox there.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Feb 28 at 11:19









                          d3vid

                          741427




                          741427






















                               

                              draft saved


                              draft discarded


























                               


                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function ()
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f426963%2fhow-do-i-create-a-local-mail-account%23new-answer', 'question_page');

                              );

                              Post as a guest













































































                              Popular posts from this blog

                              Peggy Mitchell

                              Palaiologos

                              The Forum (Inglewood, California)