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:
Cyrus-sasl-gssapi-2.1.23-15.el6_6.2.x86_64
Cyrus-sasl-2.1.23-15.el6_6.2.x86_64
Sendmail-cf-8.14.4-9.el6_8.1.noarch
Cyrus-sasl-md5-2.1.23-15.el6_6.2.x86_64
M4-1.4.13-5.el6.x86_64
Cyrus-sasl-lib-2.1.23-15.el6_6.2.x86_64
Sendmail-8.14.4-9.el6_8.1.x86_64
Cyrus-sasl-plain-2.1.23-15.el6_6.2.x86_64
Cyrus-sasl-devel-2.1.23-15.el6_6.2.x86_64
Dovecot-2.0.9-22.el6.x86_64
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.
Smtp:
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:
Mech=
Whatever is written after the equal sign, we change it to:
Mech=shadow
Save
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:
Open/etc/mail/local-host-names
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:
Linuxedentest.com
Save
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/sendmail.mc 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=127.0.0.1,) dnl
Change to:
Daemon_options (' port=smtp,addr=0.0.0.0,) 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 sendmail.cf files with M4
# M4/ETC/MAIL/SENDMAIL.MC >/ETC/SENDMAIL.CF
To start the Dovecot process:
/etc/init.d/dovecot start
To start the SASLAUTHD process:
/ETC/INIT.D/SASLAUTHD start
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