Build Iredmail mail server under Linux

Source: Internet
Author: User
Tags bz2 vps domain purchase dovecot mail account mx record roundcube spamassassin

Iredmail is an open-source, free mail server project that is published under the GPL (V2) protocol. Official website www.iredmail.org (domestic not accessible), can be accessed through www.iredmail.com.

Iredmail is a good Post Office Server free solution for small businesses, individuals or teams to build internal staff mailbox services;

Using Iredmail to build a mail server requires a public network of CentOS hosts. Recommended use of VPS;


Iredmail core components and their corresponding functions:

POSTFIX:SMTP Server

Dovecot:pop3/imap/managesieve Server

Apache:web Server

MySQL: Data that is used to store other programs, and can also be used to store mail accounts.

OpenLDAP: Used to store mail accounts.

Policyd:postfix Policy Server

AMAVISD: Provide DKIM signature and checksum, SPF Check, add "disclaimer" content for outgoing mail, and call SpamAssassin to do spam scanning based on message content, call ClamAV to do mail virus scan.

Roundcube: Web mail;

Awstats: Used to parse Apache and Postfix log files and generate simple charts.

Fail2ban: Scan various log files, found multiple password errors and other conditions can automatically block the other IP for a period of time. Used to ensure server security.

Iredadmin: Web-based mail account management program.


1, Iredmail Installation

Pre-preparation work, need to apply for an independent domain name, you can go to million or new network to buy domain names;

and purchase VPS, install the CentOS system, have a separate IP address; This simulation uses the huangxiaofan.com domain name;


The steps are as follows:

Hostname mail.huangxiaofan.com

Vim/etc/hosts//Join

127.0.0.1 mail.huangxiaofan.com


Configure DNS resolution in the Background settings for domain purchase:

MX record mail.huangxiaofan.com

A record put mail.huangxiaofan.com point to a VPS IP, this IP is we want to do mail server IP

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

Download Iredmail

wget http://www.iredmail.com/iRedMail-0.9.1.tar.bz2

(Currently the latest version is 0.9.1, will change later, please go to http://www.iredmail.com/download.html to download the latest version)

If your server is a domestic server, you need to do some processing before you install it:

Tar jxvf iredmail-0.9.1.tar.bz2

CD iredmail-0.9.1/pkgs

VI get_all.sh//change https://mirrors.fedoraproject.org to Http://mirrors.fedoraproject.org

Sed-i ' s/iredmail.org/106.187.51.47/g ' get_all.sh

Cd..


The U.S. VPS does not need to do the above operation, direct sh execution script;

SH iredmail.sh


After execution, we need to download the installation package, and then go to the graphical installation interface after completion.

Community forum address, and admin FAQ document address; Select Yes

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M01/6D/DD/wKiom1Vtf8KxY-SYAAIKmtBf49A468.jpg "style=" float: none; "title=" mail1.jpg "alt=" Wkiom1vtf8kxy-syaaikmtbf49a468.jpg "/>

Default message store directory/var/vmail, select Next;

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m02/6d/d9/wkiol1vtgwgbl1kcaah35lkpcv8853.jpg "title=" mail2.jpg "style=" Float:none; "alt=" Wkiol1vtgwgbl1kcaah35lkpcv8853.jpg "/>

Select Web server, space bar to select Apache

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m01/6d/d9/wkiol1vtgwbybozuaael4aobyv4935.jpg "title=" mail3.jpg "style=" Float:none; "alt=" Wkiol1vtgwbybozuaael4aobyv4935.jpg "/>

Select Back-end database to store mail accounts and select MySQL

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m01/6d/dd/wkiom1vtf9pjwropaakgionngmw647.jpg "title=" mail4.jpg "style=" Float:none; "alt=" Wkiom1vtf9pjwropaakgionngmw647.jpg "/>

Set the password to MySQL administrator root, cannot be empty and cannot have special characters;

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m02/6d/dd/wkiom1vtf9et8sqzaaf1hnqfzt8438.jpg "title=" mail5.jpg "style=" Float:none; "alt=" Wkiom1vtf9et8sqzaaf1hnqfzt8438.jpg "/>

Virtual domain name, not the same as the host name;

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m02/6d/d9/wkiol1vtgxwzkaufaafw5-gjtdw713.jpg "title=" mail6.jpg "style=" Float:none; "alt=" Wkiol1vtgxwzkaufaafw5-gjtdw713.jpg "/>

Set the domain administrator password, used to manage the background;

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m00/6d/d9/wkiol1vtgxrxhgjuaahanluzlk0887.jpg "title=" mail7.jpg "style=" Float:none; "alt=" Wkiol1vtgxrxhgjuaahanluzlk0887.jpg "/>

Installing components

DKIM, email authentication standard-domain key recognition mail standard. DomainKeys identified mail abbreviation;

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m00/6d/dd/wkiom1vtf-rj7k3-aamqmbbzagq246.jpg "title=" mail8.jpg "style=" Float:none; "alt=" Wkiom1vtf-rj7k3-aamqmbbzagq246.jpg "/>

Configuration complete, enter Y to continue the installation package;/usr/local/src/iredmail-0.9.1/config configuration file Save user name and password, need to move to a safe place;

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/6D/DD/wKiom1Vtf_GxhMq-AAKlY46AqSs224.jpg "title=" Mail9.jpg "style=" Float:none; "alt=" wkiom1vtf_gxhmq-aakly46aqss224.jpg "/>

Disable SELinux, whether the firewall rule provides select N, use the MySQL configuration file to select Y;

[INFO] Disable SELinux in/etc/selinux/config.< Question > Would you like to use firewall rules provided by iredmail?< Q Uestion > File:/etc/sysconfig/iptables, with SSHD port:22. [y|n]n[INFO] Skip firewall rules.< Question > Would you like to use MySQL configuration file shipped within IREDMA Il now?< Question > File:/etc/my.cnf. [Y|n]y

After the installation is complete, the login webmail and iredadmin background address, user name and password will be displayed;


2. Using the mailbox system

After installation, see if these services start: using the command pstree

For s in httpd IREDAPD AMAVISD clamd postfix dovecot cbpolicyd spamassassin CLAMD.AMAVISD saslauthd Fail2ban ; do/etc/init.d/$s restart; Done


After the installation is complete, login iredadmin background httpS://mail.huangxiaofan.com/iredadmin/

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>

650) this.width=650; "src=" http://s3.51cto.com/wyfs02/M02/6D/DD/wKiom1VtgvmCze6SAAHISd1AFDs759.jpg "style=" float: none; "title=" mail10.jpg "alt=" Wkiom1vtgvmcze6saahisd1afds759.jpg "/>

Log-in interface displays MySQL and server-related information

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/> Select the menu bar admins, modify the administrator's properties, Can choose the Simplified Chinese display;

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m00/6d/dd/wkiom1vtgwaceik5aagzlwv3odc136.jpg "title=" mail12.jpg "style=" Float:none; "alt=" Wkiom1vtgwaceik5aagzlwv3odc136.jpg "/>

Add-user, set email address and password;

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m01/6d/d9/wkiol1vthkkaiy2maacrkv5u1ci486.jpg "title=" mail13.jpg "style=" Float:none; "alt=" Wkiol1vthkkaiy2maacrkv5u1ci486.jpg "/>

Login Roundcube System httpS://mail.huangxiaofan.com/mail/Use the new user created to log in, test send and receive mail;

650) this.width=650; "src="/e/u261/themes/default/images/spacer.gif "style=" Background:url ("/e/u261/lang/zh-cn/ Images/localimage.png ") no-repeat center;border:1px solid #ddd;" alt= "Spacer.gif"/>650 "this.width=650;" src= "http ://s3.51cto.com/wyfs02/m01/6d/dd/wkiom1vtgw3cswk1aampkkyrkta416.jpg "title=" mail14.jpg "style=" Float:none; "alt=" Wkiom1vtgw3cswk1aampkkyrkta416.jpg "/>

Send mail faster, receive mail is slow, QQ mailbox to collect mail about a few minutes;

Send large attachment content 2M, upload attachment speed is very slow, QQ mailbox charge about 1-2 minutes, QQ sent over the reception is very slow, more than 10 minutes;


e-mail is normal, the mail is very slow, because the Policyd service caused by the solution:

vim/etc/policyd/cluebringer.conf//Find greylisting This module, in front add #

Then restart the Dovecot/postfix/cbpolicyd service:

Service Dovecot Restart; service Postfix restart; Service Cbpolicyd Restart


Simple mail server set up, for small and medium-sized enterprises need to consider the use;


This article is from the "Model Student's Learning blog" blog, please be sure to keep this source http://8802265.blog.51cto.com/8792265/1657624

Build Iredmail mail server under Linux

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.