Configuring SendMail and Dovecot in the CentOS 6.6 system

Source: Internet
Author: User
Tags dovecot

Online introduction of SendMail's article thousands of species, rarely followed by a successful one. There are some inaccuracies in the number of words.

I'll share with you some of the methods I've tested in an experimental environment that are completely feasible.

1. Software Preparation

Operating system: centos6.6
I chose centos6.6,
The following software , centos6.6 all comes with, no additional download.
Mail system:


SASL here, I would like to say, someone on the internet said, "sendmail-8.13 already contains CYRUS-SASL functions, there is no need to install CYRUS-SASL"
Brother Mobile sister, no CYRUS-SASL with what to do certification .....

SendMail official just said that the SendMail RPM package has already supported the CYRUS-SASL authentication method, that is, SendMail will automatically create the relevant authentication profile under the CYRUS-SASL working directory, and listen to Port 25th, You do not have to manually set up the configuration file and listening port.

When a request enters Port 25th, Sendmail will automatically find the/usr/lib/sasl2/sendmail.conf read authentication method. I'll explain it in detail below.

2. Installing the Software

RPM-IVH the above software, all on the CD, good outfit.

Yum installation is more convenient

3. Authentication Configuration

POP3: Online said to modify the/etc/dovecot.conf file, the 17th line of: #protocols = IMAP imaps POP3 pop3s # removed.

In fact, it has enabled these services by default, unless you only want to use Dovecot-auth authentication, you can change to Protocols = none, otherwise do not change.
Note that SMTP is a little troublesome.

I say the principle:
When the user requests to enter Port 25th, SendMail calls the CYRUS-SASL SASLAUTHD process, SASLAUTHD asks the other party to enter the local system user's user name and password, when the user input, SASLAUTHD will go to find the system/etc/ Shadow file, password confirmation, release, tell SendMail, this user is legal, can use mail service to send mail.
At this time you go to/usr/lab/sasl2/, SendMail has done a sendmail.conf file, which indicates: PWCHECK_METHOD=SASLAUTHD, Description SendMail authentication is called SASLAUTHD
So to achieve the above function, it is necessary to set the CYRUS-SASL SASLAUTHD, to specify the authentication method.
First, go to/etc/sysconfig/, open the Saslauthd script and find the 7th line:
Whatever is written after the equal sign, we change it to:
So SASLAUTHD will go to find shadow files to authenticate users.
In fact, SASLAUTHD can also use their own user name and password database to do the verification, but this inconvenient, but also to create a user, rather than directly with the system itself exists user name and password.

4.Sendmail configuration.

To configure the mail server name:
Add your email address at the back of your @. For example, I am here [email protected]
So, you'll add the second line in the Local-host-names file:
Of course
Local-host-names can also set the mailbox alias, this does not say, we look at the document.
After the change to go to your DNS server, the MX flag, add a tag, used to resolve the DNS name and address. The specific method is to check the Bind setting method, or Win2003 DNS setting method.
Configuration SENDMAIL.MC:
Opens the/etc/mail/ file,
Found it:
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
Remove the previous DNL note and turn it into:
Trust_auth_mech (' EXTERNAL digest-md5 cram-md5 LOGIN PLAIN ') dnl
Define (' confauth_mechanisms ', ' EXTERNAL GSSAPI digest-md5 cram-md5 LOGIN PLAIN ') dnl
The above two sentences mean:
Release mail users who are authenticated by external, LOGIN, PLAIN, CRAM-MD5, or DIGEST-MD5, ignoring the settings in the Access file.
Confauth_mechanisms, determine the authentication method supported by the system. LOGIN PLAIN mode, Outlook is used more.
Not yet finished, find:
DNL daemon_options (' port=smtp,addr=,) dnl
Change to:
Daemon_options (' port=smtp,addr=,) dnl
This allows all IP addresses to use our mail server through the SMTP port.
Here's one thing to say, don't change.
DNL daemon_options (' Port=submission, Name=msa, M=ea ') dnl
This sentence! Keep the comment state.
Above that sentence, online a lot of articles are said to Port=submission, changed to Port=25, said is to force all users on the 25 port to do certification.
I don't know how the previous version of SendMail was set up for SMTP authentication. sendmail8.13 do not set, this sentence people sendmail means: After uncomment, once the port 25th is redirected or blocked, or in the case of Port 25th is not open, immediately use 587 spare port to authenticate users.
Originally somebody else sendmail already opened 25 port (Port=smtp has already), you but here also port=25, the spare port also changed to 25, this is not let SendMail sm-client recognize
Process and sendmail The main process Rob Port ....
So far, save SENDMAIL.MC.
Regenerate files with M4
To start the Dovecot process:
/etc/init.d/dovecot start
To start the SASLAUTHD process:
To start the SendMail process:
/etc/init.d/sendmail start
Add these processes to the startup script:
Chkconfig Dovecot on
Chkconfig SASLAUTHD on
Chkconfig SendMail on
OK, all settings are complete, you can authenticate and send and receive mail.
If there is inaccurate in this article, please the Sea Grant ~ ~ ~

Configuring SendMail and Dovecot in the CentOS 6.6 system

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: 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.