Friday, 19 February 2016

How to Set Up a CentOS Email ServerIn Feburary 2016 19,

In Feburary 2016 19,
Open a terminal by clicking 'Applications,' 'Accessories,' and 'Terminal.'
Type 'sudo yum install postfix.i386.' Give the root password if asked and answer 'yes' to any questions. PostFix is used to send and receive email from the Internet. Type 'sudo yum install dovecot.' Again, give the root password and answer yes to any questions you are asked by the installer. Dovecot will provide users with IMAP or POP3 access to their email accounts.
Edit the configuration file for Postfix. Type 'sudo nano /etc/postfix/main.cf' to open the configuration file in the Nano text editor. The defaults will work well for most systems, but a more sophisticated mail server will require you to specify some of the options in the configuration file. The most important setting is 'home_mailbox.' This will be each user's mailbox directory in their homepage. If you wish to use the Maildir format, the directory should end with a trailing forward slash, like this:home_mailbox = mail/Another option is the mbox format, and to use this format, simply leave off the trailing forward slash: home_mailbox = mailBoth formats are powerful, however there are subtle and complex differences between them. Whichever you choose to use, remember that choice. Find the 'myhostname' and 'mydomain' settings and give them the domain name you have associated with your computer. For example, if you own the domain name 'happy.com,' the options should read:myhostname=mail.happy.com
mydomain=happy.comYou can exit nano by hitting Ctrl-O (to save) and Ctrl-X (to exit.)
Edit the configuration file for Dovecot. Type 'sudo nano /etc/dovecot.conf.' The most important option is protocols. Ensure that this includes the protocol you wish your email users to use. The most popular options are 'imap' and 'pop3,' and you can enable secure connections by appending an 's' to each option.
Set the mail location to the same directory you chose in Step 3. Precede it with the format you choose in step 3. For example:mail_location = maildir:~/mailormail_location = mbox:~/mailFinally, if you use a 64-bit version of CentOS, change the 'login_process_size' to '64.'
Create a user mailbox. Type the following:mkdir /home/bill/mail
chown bill:bill /home/bill/mail
chmod -R 700 /home/john/mailThis creates the mail directory, ensures that the user owns his mail directory, and allows him to access it. This must be repeated for each user who has an email account. In this example, 'bill' has the email account 'bill@happy.com.'
Start the server. Type this code in the terminal:chkconfig --level 345 dovecot on
/etc/init.d/dovecot start
/etc/init.d/postfix start
In Feburary 2016 19,

No comments:

Post a Comment