Linux uses Sendmail to build a secure and reliable Mail Server

Source: Internet
Author: User
Tags dovecot mail account mx record

Tutorial principle:Sendmail is a mail server software with good stability in UNIX/Linux environments. You can configure the Sendmail server to implement the basic mail forwarding function. The dovecot server implements the POP3 protocol, you can work with the Sendmail server to receive emails. OpenWebmail is a webpage-based email application system that allows you to send, receive, and manage emails. By comprehensively managing Sendmail, dovecot, and OpenWebmail, the system administrator can build a fully functional email application system.Tutorial steps:I,Build DNSEnvironment, and set sendmainYou can change the host domain name by modifying the "/etc/hosts" and "/etc/sysconfig/network" files. Add the corresponding MX record to the DNS server.II,SendmailThe Sendmail server is installed and configured by default in the RHEL4 system. The software package name is sendmail. The m4 Software Package provides the necessary tool programs to configure the Sendmail server, the Sendmail package is installed in the system by default. The Sendmain and m4 software are both in the 2nd installation discs of RHEL4. Change the startup level of the sendmial server. Set the local-host-names file to set the Domain Name of the mail server that provides the mail service. Edit the sendmail. mc file. The main configuration file of the Sendmail server is sendmain. cf, which is difficult to configure. However, you can configure sendmail. mc and generate the sendmail. cf file. Enable the network interface of the Sendmail server. For security reasons, the Sendmail server only provides services for the lo Network Interface (IP Address: 127.0.0.1) by default, to enable the server to provide services for all network interfaces of the host (Address: 0.0.0.0. modify the configurations in the mc file. Enable SMTP User authentication. Remove the dnl and space in front of TRUST_AUTH_MECH ('externaldigest-MD5CRAM-MD5LOGINPLAIN. After the email server is enabled, the user is required to provide the user account and password for identity authentication. Only Authenticated Users can send emails to external users through the email server. Go to the/etc/mail directory and use m4sendmail. mc & gt; sendmail. cf to generate the sendmail. cf file. Start the/etc/rc. d/init. d/sendmail service and make sure that the saslauthd service program runs correctly after the sendmial. cf configuration takes effect and the Sendmail server authentication function is enabled. The Sendmail server sets the Mail User Account in Linux as the mail account. Therefore, you only need to add a Linux Account to the mail account. To facilitate user management, users of the same nature can be added to a group. Set the mail alias and mail group function use the aliases mechanism on the Sendmail server to implement the mail alias and mail group function. The/etc directory contains two files named aliases and aliases. db. The aliases file is a text file whose content is readable and editable. The aliases. db file is a database file generated by the aliases file. Edit the aliases file and add "gongcheng: xiaonuo1, xiaonuo2" at the end of the file, meaning that aliases is generated through newaliases after sending an email to the gongcheng@xiaonuo.com, sending a group to the xiaonuo1@xiaonuo.com and setting in the xiaonuo2@xiaonuo.com. db file. If you want a user to send an email anonymously, you can modify the access file and generate a database file using "makemaphashaccess. db & lt; access.III,DevecotThe installation and configuration of the Sendmail server does not provide the mail receiving function for the MUA software. Therefore, you must separately install the server program that implements the POP3 or IMAP4 function in the system. The devecot software is installed by default. Since the devecot server has many software packages, we recommend that you use the software package management program provided in RHEL4 system to install the dovecot software package. After installing the dovecot package, you need to set its configuration file dovecot. conf. After installing the dovecot package, you need to set its configuration file dovecot. conf. By default, the dovecot server only provides the imap service. You need to modify the line "# protocols = imapimpas" to "protocols = imapimapspop3pop3s" and restart the dovecot service to make the dovecot. conf settings take effect.IV,Email client OutlookExpressUse the OutlookExpress software provided by Windows to connect to the sendmail server. Note that after the configuration is complete, you need to check the "my server requires authentication" on the server. Send and receive emails for test.V,Install and configure OpenWebmail, And through the WebPublished WebmailOpenWebmail is a Webmail application system written in Perl. It works well with Sendmail and other mail systems to build powerful Webmail applications. Download the files required by OpenWebmail, including four perl software and one openwebmail software. Create dbm. the conf file Openwebmail software installs all the files in the directory "/var/www/cgi-bin/openwebmail". In the etc subdirectory of the Directory, you must create a file named dbm. conf configuration file. Initialize the OpenWebmail system to execute the openwebmail-tool.pl program in the "/var/www/cgi-bin/openwebmail" directory, and use the "-- init" option to initialize the OpenWebmail system. Start the Apache server. Allows the client to access the mail server through the web. Enter http://mail.xiaonuo.com/cgi-bin/openwebmail/openwebmail.pl?sendmailserver In the IE browser. Because the default webpage is in English, it is not easy to use. You can change the webpage to Chinese by modifying the openwebmail. conf configuration file. Domainnamesxiaonuo.com: Set the sendmail domain name to xiaonuo. comdefault_language. Set the system's default language to simplified Chinese character. After setting the icon in the system from English to simplified Chinese, use IE browser to log on again to take effect.

This article is from the blog of "the Linux open source technology blog", please be sure to keep this source http://dreamfire.blog.51cto.com/418026/167192

Related Article

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.