SendMail Mail Service build detailed solution little kid

Source: Internet
Author: User
Tags imap dovecot

Sendmail+openwebmail1.1. Software InstallationSendmaills

Yum install sendmail* perl-compress-zlib perl-suidperl perl-text-iconv–y

Yum-y Install sendmail-cf.i* sendmail-doc.i*

1.2.ConfigurationSendMailService:

    1. Configuring System Services

# back up system files

Cp/etc/mail/sendmail.mc/etc/mail/sendmail.mc.bak

Cp/etc/mail/sendmail.cf/etc/mail/sendmail.cf.bak

# add access to the domain name

echo "Mgcrazy.com" >>/etc/mail/local-host-names

    1. Configure the listener for all addresses:

Sed-i ' s/addr=127.0.0.1/addr=0.0.0.0/g '/ETC/MAIL/SENDMAIL.MC

    1. To Configure user authentication:

SendMail The run process is read /etc/mail/sendmail.cf configuration file, but the file configuration is more complex, so it is generally configured /ETC/MAIL/SENDMAIL.MC , and then build it with the following command sendmail.cf file

(each time you modify the SENDMAIL.MC service, otherwise the configuration will not take effect).   network network bits

M4/ETC/MAIL/SENDMAIL.MC >/ETC/MAIL/SENDMAIL.CF

in the /ETC/MAIL/SENDMAIL.MC the file format requirements are very strict:

    • < Span style= "font-size:14px;font-family: ' The song body '; color: #333333;" The left of each sentence cannot have a space

    • case-sensitive

    • Note on the leftmost side plus dnl

    • every sentence must be dnl end

    • The added statement cannot be in the last line

Quotation marks in the statement, such as

650) this.width=650; "Width=" 547 "height=" 164 "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 "/>

Modify VI/ETC/MAIL/SENDMAIL.MC two lines as follows:

DNL Trust_auth_mech (' EXTERNAL digest-md5 cram-md5 LOGIN PLAIN ') dnl

dnl define (' confauth_mechanisms ', ' EXTERNAL GSSAPI digest-md5 cram-md5 LOGIN PLAIN ') dnl modified into

Trust_auth_mech (' EXTERNAL digest-md5 cram-md5 LOGIN PLAIN ') dnl

Define (' confauth_mechanisms ', ' EXTERNAL GSSAPI digest-md5 cram-md5 LOGIN PLAIN ') dnl

that is to remove the first line of DNL . This sendmail configuration is complete.

when you are finished modifying it, use The M4 command generates the mail configuration file M4 SENDMAIL.MC >sendmail.cf

1.3.ConfigurationSmtpand thePOP3Certifications:

SASLAUTHD Service role: Providing SMTP authentication

Service SASLAUTHD Restart

Install the Dovecot service (POP3),

Yum Install–y dovecot*

Remove The # number that precedes the/etc/dovecot/dovecot.conf line as follows :

protocols = IMAP POP3

Modify /etc/dovecot/conf.d/10-mail.conf

Modify the mailbox location, if not modified, after the e-mail message will be prompted with mail_location related errors, cancel the injection

Mail_location = mbox:~/mail:inbox=/var/mail/%u

Modify /etc/dovecot/conf.d/10-auth.conf

Modify whether simple information validation is allowed and, if not modified, the subsequent e-mail prompts for validation errors and cannot be verified.

Yes Change to No

Disable_plaintext_auth = No

Modify /etc/dovecot/conf.d/10-ssl.conf

whether to modify the use of SSL authentication, if not modified, the same time when sending messages will not be able to pass validation, remove comments, change to No

SSL = No

1.4.SendMailConfiguration Complete

the establishment of the mailbox user, you can send and receive mail with the client is normal

Groupadd Mailgroup

Useradd-g mailgroup-s/sbin/nologin User1

passwd WUGK set a good password.

Service SendMail restart&&service dovecot restart &&service saslauthd restart

Give users all group permissions

Chgrp Mailgroup/var/mail/user1

1.5. Add a trunk

database File /etc/mail/access.db

Vi/etc/mail/access

Connect:localhost RELAY

connect:127.0.0.1 RELAY

connect:10.204.0.0 RELAY

Makemap Hash access.db<access

1.6. ConfigurationOpenwebmail

Openwebmail is a PHP page file that needs to be published with httpd, to install Apache

    • installing the Openwebmail package

wgethttp://openwebmail.org/openwebmail/download/redhat/rpm/release/2.53/openwebmail-2.53-3.i386.rpm

wget http://openwebmail.org/openwebmail/download/redhat/rpm/release/2.53/openwebmail-data-2.53-3.i386.rpm

1, modify the Openwebmail configuration as follows: All are modified content:

[[Email protected] ~] #vi/var/www/cgi-bin/openwebmail/etc/dbm.conf

Dbm_ext. Pag

Dbmopen_ext None

Dbmopen_haslock No

then initialize the./var/www/cgi-bin/openwebmail/openwebmail-tool.pl--init Press Y

2, modification,vi/var/www/cgi-bin/openwebmail/etc/defaults/dbm.conf

Dbm_ext. Pag

Dbmopen_ext None

Dbmopen_haslock No

3, modify the vi/var/www/cgi-bin/openwebmail/etc/openwebmail.conf

Domainnames mgcrazy.com

Default_language ZH_CN. GB2312

Default_iconset Cool3D.Chinese.Simplified

4, modify the vi/var/www/cgi-bin/openwebmail/etc/default/openwebmail.conf

Domainnames mgcrazy.com

SmtpServer mail.mgcrazy.com

Authpop3_server mail.mgcrazy.com

then execute /var/www/cgi-bin/openwebmail/openwebmail-tool.pl--init Press Y

5,Apache Modify the configuration file

The following is an Apache configuration section for reference:

<virtualhost *:80>

ServerAdmin [email protected]

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>

Configuration Complete Test: You do it well. DNS resolution, encountered problems to solve, encountered a lot of errors, only you really do it will understand.

Access http://mail.mgcrazy.com The page is as follows:

1.7.Sendmailmalfunction

Starting Dovecot Imap:Error:socket () Failed:address family not supported by protocol

Error:service (Pop3-login): Listen (::, +) Failed:address family not supported by protocol

this is because the system does not exist IPv6, Solutions :
Vi/etc/dovecot/dovecot.conf
put Listen = * [::] instead Listen = *

Test

[Email protected] mail]# telnet localhost 25

Trying 127.0.0.1 ...

Connected to localhost.

Escape character is ' ^] '.

220

Localhost.localdomain

ESMTP Sendmail 8.14.1/8.14.1; Wed, 2 Nov 2011 01:22:44 +0800

ehlo localhost// This is the command to enter

250-localhost.localdomain

Hello

Localhost.localdomain

[127.0.0.1], pleased to meet

250-enhancedstatuscodes

250-pipelining

250-8bitmime

250-size

250-dsn

250-etrn

250-auth digest-md5 cram-md5 LOGIN PLAIN

with LOGIN behind AUTH, you can basically certify on the outlookexpress .

250-deliverby Help

Quit// This is the meaning of the exit interface

Nov 11:34:49 localhost dovecot:pop3-login:disconnected (tried to use disabled plaintext auth): rip=10.204.0.171, lip=10 .204.3.252

Close Plaintext=no


This article is from the "Zhongliang Linux Technology blog" blog, make sure to keep this source http://zhongliang.blog.51cto.com/4507905/1878974

SendMail Mail Service build detailed solution little kid

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.