Setup a mail server with Postfix and Dovecot on Ubuntu Debian.Mail system for your own domain.You have your own domain name and your very own vpsdedicated server and want to use the domain name for emails.So you need to setup a mail server using an smtp server and an imappop server.This tutorial shows you how to setup Postfix smtp server and Dovecot imappop server.The task of the smtp server is to accept incoming mails and relay outgoing mails from authorised users on the system.Whereas Dovecot allows authorized users to access their Inbox and read whatever mails there are.The Simple Configuration We are not doing this.In the simplest kind of configuration for Postfix, just specify your domain name xyz.This technique is simple but with heavy drawbacks.Im sorry, theres no heartbeat, my doctor said to me.She didnt sound very sorry, leaving the room so quicklyostensibly so I could pull up my.Firstly you need to create a new unix user account for every new email address we need.Secondly the users have to login with their system passwords.So this is not a very flexible strategy to setup mail accounts.Separately you can configure Dovecot to read the incoming mails from the directory where Postfix stores them varmail by default.There is an article on Digital.Ocean that shows how to setup postfix with dovecot like that.We are going to setup things in a way that you can quickly create email addresses just by writing them in a file along with the password.We shall add as many domains as we like and create as many emails and it would all be encrypted and authenticated.Since the email accounts we shall be creating are not related to any system users or system domains, they are called virtual users and virtual domains.Virtual means, that not related to any system specific thing.How will it work The technical jargon.All incoming mails destined to your server shall be received by Postfix SMTP and then handed over to Dovecot LMTP for storing in the Inbox.This is better because dovecots inbuilt lmtp service offers more features like quotas, permissions, flexible directory structures for mailboxes etc.Incoming mail From somewhere Postfix SMTP Dovecot LMTP Mail.BoxInbox. And due to this Postfix is reduced to just a tranmission agent that just moves mails in and out, and nothing else.All outgoing mails shall be send out by Postfix.But only from authenticated accounts.Outgoing mail Thunderbird Postfix SMTP Destination SMTP like gmail.Dovecot shall provide IMAPPOP services to allow mail clients to read Inbox.Thunderbird lt Dovecot IMAP lt Inbox.Dovecot shall exclusively provide authentication mechanism to Postfix via SASL.The email accounts username passwords shall be stored in a file.F00_image034_5F00_1D68C353.png]];var lpix_1=pix_1.length;var p1_0= [[1114' alt='Install Files Given No Destination C Make Tutorial Pdf' title='Install Files Given No Destination C Make Tutorial Pdf' />This tutorial covers managing, modifying and monitoring a Linux based computer.Monitor the system Monitor the system.Process management.If you wish to setup domains and email accounts in a database instead of a file, then following this tutorial at linode.Setup MX records for domain.Before getting any further, ensure that the MX records for your domains that you are going to use with your mail server, are properly set.Most server providers like Linode provide an easy interface to setup zone entries for mx records.If your domain is example.Use the dig command to verify Find the MX mail exchange server.MX amazon. com short.Find the ip address of the mx server.Ensure that the ip address of your MX mail server is of that server on which you are going to setup postfix and dovecot.Install and Configure Postfix.The first thing to setup is Postfix.Do not forget that in our setup, Postfix is going to transmit all outgoing mails, but for all incoming mails, it would hand them over to Dovecot for storage and later access by email clients.Things to know first.Postfix logs all its actions in a file called varlogmail.Check it for useful information and save time diagnosing problems.The postconf command is the tool to peek inside the configurations of Postfix.It lists out everything in a namevalue format linewise.So use the grep command to find whatever needed.All the Postfix configuration parameters lie in the file etcpostfixmain.The parameters are explained in man pages found at man 5 postconfInstall Postfix.Okay, so if you havent already done so, install Postfix.Its right there in the repositories so you shouldnt look elsewhere unless you want something newer.Dont worry, the rest is not going to be that easy.Install Files Given No Destination C Make Tutorial' title='Install Files Given No Destination C Make Tutorial' />After installing Postfix you may want to check the version.Here is the command to do that.Configure main. cf.In this section we shall configure several things in the Postfix main configuration file located at etcpostfixmain.These include hostnames, parameters for SASL authentication, unix sockets for dovecot lmtp and dovecot sasl authentication service and list of our virtualmailboxdomains for which Postfix shall be responsible for receiving incoming mails.The tricky parameters The following parameters are the 3 super confusing parameters that you need to understand and configure properly to avoid unexpected problems.You could be hosting multiple domains on your server, say abc.You have to use one of them as a primary domain and use it for myorigin.The myorigin field is the one that is configured automatically while postfix installs and asks you for the domain of the server.By default myorigin is configured to point to etcmailname so you can either fill in your default domain in etcmailname or specify in the configuration file directly.The domain specified with myorigin is used for mails generated by Postfix.For example when it fails to deliver a mail, it would reply with a from address of Mail Delivery Systemlt email protected.The myhostname parameter is supposed to contain the your mail server name as indicated by your mx record.This is the name that Postfix uses in smtp communication to identify itself.For example HELO myhostname.If you set myhostname to a certain domain, then you should be able to setup the SPF records for that domain later.This is dictated by the SPF specifications.You might as well leave myhostname to just localhost and things would still work just fine.However in that case your server would use a message like HELO localhost when connecting to other mail servers like gmail, and gmail would angrily reject the mail calling it unsolicited.Therefore it is recommended to configure myhostname to a proper domain name with valid A and TXT SPF records.Also make sure to set myorigin.Example configuration myhostname mail.Technically, on a single a server, you can use the same value of myorigin for myhostname.However in diverse setups involving multiple separate servers, the values of these fields need to setup more carefully.To learn more read the Postfix basic configuration guide.Configure the LMTP socket main.The virtualtransport parameter tells postfix to forwardtransport the mails to dovecot for those domains that are listed in virtualmailboxdomains.Handing off local delivery to Dovecots LMTP.The path privatedovecot lmtp is relative to varspoolpostfix.The actual unix socket shall be configured later in the Dovecot configuration section.Configure SASL main.Here we set the parameters to setup SASL based authentication for Postfix.Postfix internally is capable of talking to Dovecots SASL service via a unix socket.Enabling SMTP for authenticated users, and handing off authentication to Dovecot.To check what different smtpdsasltype plugins your installation of Postfix supports run the following command.Add mailbox domains main.Over here we specify the domains for which Postfix shall accept incoming mails.So specify all your inhouse domains over here.We shall be putting the domains in a file named virtualmailboxdomains.Virtual domains, users, and aliases.Enter the domains, one in a lineexample. Corel Video Studio Crack Download . OK. mysite. com OKThen run postmap on the file.It will create a file named virtualmailboxdomains.Postfix postmap etcpostfixvirtualmailboxdomains.The virtualmailboxmaps table can be used to specify valid email addresses for the domains listed in virtualmailboxdomains.However this is not necessary, since the SASL authentication via Dovecot would be doing the verification.Enable SMTPS and MSA master.In addition to the smtp service on port 2.SMTPS will operate on port 4.MSA Mail submission Agent will operate on port 5.SMTP uses SSLTLS authentication type and MSA uses STARTTLS.Find the section on submission and smtps in the file named etcpostfixmaster.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
November 2017
Categories |