Preface * although there are many types of linux email servers and many of them have better performance than sendmail, sendmail is a good choice when we only need to simply send and receive emails and quickly set up them.
I. Environment version
System Version: Centos 5.3 64-bit Sendmail Version: sendmail-8.13.8-8.el5 Openwebmail version: openwebmail-2.53-3, openwebmail-data-2.53-3
Ii. Formal Installation
Download the desired version: Go to the sendmail official website to download the corresponding version of the server. Yum install sendmail *-y & yum install-y perl-Compress-Zlib perl-suidperl & rpm-ivh openwebmail-data-2.53-3.i386.rpm openwebmail-2.53-3.i386.rpm perl-Text-Iconv-1.7-1.el5.rf.x86_64.rpm. Download this site from favorites: wget Repository
3. Configure the sendmail service:
Cp/etc/mail/sendmail. mc/etc/mail/sendmail. mc. back & cp/etc/mail/sendmail. cf/etc/mail/sendmail. cf. back & echo "mgcrazy.com">/etc/mail/local-host-names [* The final realization of http://mail.mgcrazy.com/login mailbox access] configure listening to all addresses: sed-I's/Addr = 127.0.0.1/Addr = 0.0.0.0/G'/etc/mail/sendmail. mc configuration user authentication: Modify vi/etc/mail/sendmail. mc: Dnl TRUST_AUTH_MECH ('external DIGEST-MD5 login plain ') dnl define ('confauth _ ME CHANISMS ', 'external GSSAPI DIGEST-MD5 CRAM-MD5 login plain') dnl modified to TRUST_AUTH_MECH ('external DIGEST-MD5 CRAM-MD5 login plain ') dnl define ('confauth _ MECHANISMS ', 'External GSSAPI DIGEST-MD5 CRAM-MD5 login plain ') dnl removes the dnl of the first line. The sendmail configuration is complete. After modification, run the M4 command to generate the mail configuration file m4 sendmail. mc> sendmail. cf.
4. Configure SMTP and POP3 authentication:
Saslauthd service role: Provides the smtp authentication service saslauthd restart to install the dovecot service. yum install-y dovecot * removes the # number before/etc/dovecot. conf in the following line: protocols = imap imaps pop3 pop3s
5. sendmail configuration is complete
The mailbox user can use the client to send and receive emails, that is, the normal groupadd mailgroup useradd-g mailgroup-s/sbin/nologin wugk passwd wugk to set the password. Service sendmail restart; service dovecot restart; service saslauthd restart all sendmail-related services
6. Configure openwebmail
* Webpage access is required for the mail server: the access address is http://mail.mgcrazy.com/, and openwebmailis configured as the ingress. The configuration is as follows: httpdis installed.
We have already installed openwebmail. By default, a folder such as/var/www/cgi-bin/openwebmail will be generated. If your apache is installed in another directory, copy openwebmail to the corresponding directory:
1. Modify the openwebmail configuration as follows: All items are modified:
[Root @ localhost ~] # Vi/var/www/cgi-bin/openwebmail/etc/dbm. conf
Dbm_ext. db dbmopen_ext. db dbmopen_haslock no and then Initialize./var/www/cgi-bin/openwebmail/openwebmail-too.pl-init Press Y.
2. Modify vi/var/www/cgi-bin/openwebmail/etc/defaults/dbm. conf.
dbm_ext .db dbmopen_ext .db dbmopen_haslock yes
3. Modify vi/var/www/cgi-bin/openwebmail/etc/openwebmail. conf.
domainnames mgcrazy.com default_language zh_CN.GB2312 default_iconset Cool3D.Chinese.Simplified
4. Modify vi/var/www/cgi-bin/openwebmail/etc/default/openwebmail. conf.
Domainnames mgcrazy.com smtpserver mail.mgcrazy.com authpop3_server mail.mgcrazy.com and then run./var/www/cgi-bin/openwebmail/openwebmail-too.pl-init Press Y.
5. modify the configuration file in apache
The following is the apache configuration section for your reference:
<VirtualHost *:80> ServerAdmin wugk@mgcrazy.com ServerName mail.mgcrazy.com DocumentRoot /usr/local/apache-2.2.13/ ScriptAlias /cgi-bin/ "/usr/local/apache-2.2.13/cgi-bin/" <Directory /usr/local/apache-2.2.13/> Options Indexes FollowSymLinks AllowOverride None Order allow,deny Allow from all </Directory> RewriteEngine On ProxyPreserveHost On RewriteRule ^/$ http://mail.mgcrazy.com/cgi-bin/openwebmail/openwebmail.pl [P,L,NC] </VirtualHost>
After the configuration is completed and tested: DNS resolution has been completed, and problems have been solved by 1.1 drops, resulting in many errors. Only when you do it will you understand.
The access to the http://mail.mgcrazy.com page is as follows: