Looking for strict local mail server (no email sending and receving from outside world)












1














I am looking for a mail solution (or server) that work only inside an office and only employees inside the office can send and receive the email from each other. I don't want the employee to send email to the outside world even if they try to send email to abc[at]gmail.com, etc.



In brief, I want to set up a mail server in my office (for 60+ employees) with a local domain name (say aman.local) and each employee will have their own email address (e.g. emp1@aman.local, emp2@aman.local, etc) on aman.local domain. And the employees will communicate with each other using the above email addresses. Here, the mail server should only process email with aman.local domain name and reject processing of other domain names (like gmail.com, etc) to restrict remote email sending.



So far I tried the following things:



I know I can restrict the incoming email by skipping the MX config.




  1. hMailServer, Poste.io, and Mailu.com but didn't find a way to restrict remote email sending (say to gmail.com, etc)

  2. Tried to find a way in Roundcude Webmail client to reject sending to email other than the allowed domain name. But all in vain.


Thanks in Advance. :)










share|improve this question



























    1














    I am looking for a mail solution (or server) that work only inside an office and only employees inside the office can send and receive the email from each other. I don't want the employee to send email to the outside world even if they try to send email to abc[at]gmail.com, etc.



    In brief, I want to set up a mail server in my office (for 60+ employees) with a local domain name (say aman.local) and each employee will have their own email address (e.g. emp1@aman.local, emp2@aman.local, etc) on aman.local domain. And the employees will communicate with each other using the above email addresses. Here, the mail server should only process email with aman.local domain name and reject processing of other domain names (like gmail.com, etc) to restrict remote email sending.



    So far I tried the following things:



    I know I can restrict the incoming email by skipping the MX config.




    1. hMailServer, Poste.io, and Mailu.com but didn't find a way to restrict remote email sending (say to gmail.com, etc)

    2. Tried to find a way in Roundcude Webmail client to reject sending to email other than the allowed domain name. But all in vain.


    Thanks in Advance. :)










    share|improve this question

























      1












      1








      1







      I am looking for a mail solution (or server) that work only inside an office and only employees inside the office can send and receive the email from each other. I don't want the employee to send email to the outside world even if they try to send email to abc[at]gmail.com, etc.



      In brief, I want to set up a mail server in my office (for 60+ employees) with a local domain name (say aman.local) and each employee will have their own email address (e.g. emp1@aman.local, emp2@aman.local, etc) on aman.local domain. And the employees will communicate with each other using the above email addresses. Here, the mail server should only process email with aman.local domain name and reject processing of other domain names (like gmail.com, etc) to restrict remote email sending.



      So far I tried the following things:



      I know I can restrict the incoming email by skipping the MX config.




      1. hMailServer, Poste.io, and Mailu.com but didn't find a way to restrict remote email sending (say to gmail.com, etc)

      2. Tried to find a way in Roundcude Webmail client to reject sending to email other than the allowed domain name. But all in vain.


      Thanks in Advance. :)










      share|improve this question













      I am looking for a mail solution (or server) that work only inside an office and only employees inside the office can send and receive the email from each other. I don't want the employee to send email to the outside world even if they try to send email to abc[at]gmail.com, etc.



      In brief, I want to set up a mail server in my office (for 60+ employees) with a local domain name (say aman.local) and each employee will have their own email address (e.g. emp1@aman.local, emp2@aman.local, etc) on aman.local domain. And the employees will communicate with each other using the above email addresses. Here, the mail server should only process email with aman.local domain name and reject processing of other domain names (like gmail.com, etc) to restrict remote email sending.



      So far I tried the following things:



      I know I can restrict the incoming email by skipping the MX config.




      1. hMailServer, Poste.io, and Mailu.com but didn't find a way to restrict remote email sending (say to gmail.com, etc)

      2. Tried to find a way in Roundcude Webmail client to reject sending to email other than the allowed domain name. But all in vain.


      Thanks in Advance. :)







      ubuntu postfix mail-server roundcube email-server






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Dec 16 '18 at 13:55









      AmanAman

      83




      83






















          1 Answer
          1






          active

          oldest

          votes


















          0














          You can do at least two things:




          1. Use postfix and restrict the domains of senders and recipients as it is described here



          Restrict Sender and Recipient



          This section describes how to restrict both the sender and recipient.
          Example usage of this is when you have a private domain which should
          not be allowed to send to the internet. Edit main.cf1. Edit the file
          /etc/postfix/main.cf and add the lines below.




          smtpd_recipient_restrictions =    check_sender_access 
          hash:/etc/postfix/sender_access, reject_unauth_destinations

          smtpd_restriction_classes = local_only
          local_only = check_recipient_access
          hash:/etc/postfix/local_domains, reject



          Edit sender_access




          1. Create the file /etc/postfix/sender_access and review the example below.




          acme.local  local_only



          Edit local_domains




          1. Create the file /etc/postfix/local_domains and review the example below.




          acme.local  OK



          Edit sender_access




          1. Type in the command belows in a terminal window to create the hash files.




          postmap /etc/postfix/sender_access 
          postmap /etc/postfix/local_domains



          1. The other way is to set your firewall to reject all incomming and outgoing communications via ports 25, 465 and 587






          share|improve this answer

















          • 1




            Thanks Romeo! Your solution worked!
            – Aman
            Dec 17 '18 at 18:25











          Your Answer








          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "3"
          };
          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%2fsuperuser.com%2fquestions%2f1385015%2flooking-for-strict-local-mail-server-no-email-sending-and-receving-from-outside%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









          0














          You can do at least two things:




          1. Use postfix and restrict the domains of senders and recipients as it is described here



          Restrict Sender and Recipient



          This section describes how to restrict both the sender and recipient.
          Example usage of this is when you have a private domain which should
          not be allowed to send to the internet. Edit main.cf1. Edit the file
          /etc/postfix/main.cf and add the lines below.




          smtpd_recipient_restrictions =    check_sender_access 
          hash:/etc/postfix/sender_access, reject_unauth_destinations

          smtpd_restriction_classes = local_only
          local_only = check_recipient_access
          hash:/etc/postfix/local_domains, reject



          Edit sender_access




          1. Create the file /etc/postfix/sender_access and review the example below.




          acme.local  local_only



          Edit local_domains




          1. Create the file /etc/postfix/local_domains and review the example below.




          acme.local  OK



          Edit sender_access




          1. Type in the command belows in a terminal window to create the hash files.




          postmap /etc/postfix/sender_access 
          postmap /etc/postfix/local_domains



          1. The other way is to set your firewall to reject all incomming and outgoing communications via ports 25, 465 and 587






          share|improve this answer

















          • 1




            Thanks Romeo! Your solution worked!
            – Aman
            Dec 17 '18 at 18:25
















          0














          You can do at least two things:




          1. Use postfix and restrict the domains of senders and recipients as it is described here



          Restrict Sender and Recipient



          This section describes how to restrict both the sender and recipient.
          Example usage of this is when you have a private domain which should
          not be allowed to send to the internet. Edit main.cf1. Edit the file
          /etc/postfix/main.cf and add the lines below.




          smtpd_recipient_restrictions =    check_sender_access 
          hash:/etc/postfix/sender_access, reject_unauth_destinations

          smtpd_restriction_classes = local_only
          local_only = check_recipient_access
          hash:/etc/postfix/local_domains, reject



          Edit sender_access




          1. Create the file /etc/postfix/sender_access and review the example below.




          acme.local  local_only



          Edit local_domains




          1. Create the file /etc/postfix/local_domains and review the example below.




          acme.local  OK



          Edit sender_access




          1. Type in the command belows in a terminal window to create the hash files.




          postmap /etc/postfix/sender_access 
          postmap /etc/postfix/local_domains



          1. The other way is to set your firewall to reject all incomming and outgoing communications via ports 25, 465 and 587






          share|improve this answer

















          • 1




            Thanks Romeo! Your solution worked!
            – Aman
            Dec 17 '18 at 18:25














          0












          0








          0






          You can do at least two things:




          1. Use postfix and restrict the domains of senders and recipients as it is described here



          Restrict Sender and Recipient



          This section describes how to restrict both the sender and recipient.
          Example usage of this is when you have a private domain which should
          not be allowed to send to the internet. Edit main.cf1. Edit the file
          /etc/postfix/main.cf and add the lines below.




          smtpd_recipient_restrictions =    check_sender_access 
          hash:/etc/postfix/sender_access, reject_unauth_destinations

          smtpd_restriction_classes = local_only
          local_only = check_recipient_access
          hash:/etc/postfix/local_domains, reject



          Edit sender_access




          1. Create the file /etc/postfix/sender_access and review the example below.




          acme.local  local_only



          Edit local_domains




          1. Create the file /etc/postfix/local_domains and review the example below.




          acme.local  OK



          Edit sender_access




          1. Type in the command belows in a terminal window to create the hash files.




          postmap /etc/postfix/sender_access 
          postmap /etc/postfix/local_domains



          1. The other way is to set your firewall to reject all incomming and outgoing communications via ports 25, 465 and 587






          share|improve this answer












          You can do at least two things:




          1. Use postfix and restrict the domains of senders and recipients as it is described here



          Restrict Sender and Recipient



          This section describes how to restrict both the sender and recipient.
          Example usage of this is when you have a private domain which should
          not be allowed to send to the internet. Edit main.cf1. Edit the file
          /etc/postfix/main.cf and add the lines below.




          smtpd_recipient_restrictions =    check_sender_access 
          hash:/etc/postfix/sender_access, reject_unauth_destinations

          smtpd_restriction_classes = local_only
          local_only = check_recipient_access
          hash:/etc/postfix/local_domains, reject



          Edit sender_access




          1. Create the file /etc/postfix/sender_access and review the example below.




          acme.local  local_only



          Edit local_domains




          1. Create the file /etc/postfix/local_domains and review the example below.




          acme.local  OK



          Edit sender_access




          1. Type in the command belows in a terminal window to create the hash files.




          postmap /etc/postfix/sender_access 
          postmap /etc/postfix/local_domains



          1. The other way is to set your firewall to reject all incomming and outgoing communications via ports 25, 465 and 587







          share|improve this answer












          share|improve this answer



          share|improve this answer










          answered Dec 16 '18 at 14:25









          Romeo NinovRomeo Ninov

          1,7142914




          1,7142914








          • 1




            Thanks Romeo! Your solution worked!
            – Aman
            Dec 17 '18 at 18:25














          • 1




            Thanks Romeo! Your solution worked!
            – Aman
            Dec 17 '18 at 18:25








          1




          1




          Thanks Romeo! Your solution worked!
          – Aman
          Dec 17 '18 at 18:25




          Thanks Romeo! Your solution worked!
          – Aman
          Dec 17 '18 at 18:25


















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Super User!


          • 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%2fsuperuser.com%2fquestions%2f1385015%2flooking-for-strict-local-mail-server-no-email-sending-and-receving-from-outside%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

          Plaza Victoria

          Puebla de Zaragoza

          Musa