Shenzhen letter lion Postfix, Dovecot mail server installation configuration

First, install a mail server related packages
OS: Red Hat Enterprise5
postfix letter server
dovecot Incoming server

rpm -ivh postfix-2.1.5-2.3.RHEL4.1.i386.rpm (the third set)

rpm -ivh dovecot-0.99.11-2.EL4.1.i386.rpm (second disc)

(Suggestion: since many depend on the rpm package, it is proposed to put from postfix installed when installing the system the way is not recommended to open a firewall.!)

安装dovecot-1.0-1.2.rc15.el5.i386.rpm时提示缺
libmysqlclient.so.152009-03-03 23:34
[root@localhost ~]# rpm -ivh /mnt/Server/dovecot-1.0-1.2.rc15.el5.i386.rpm
warning: /mnt/Server/dovecot-1.0-1.2.rc15.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
error: Failed dependencies:
libmysqlclient.so.15 is needed by dovecot-1.0-1.2.rc15.el5.i386
libmysqlclient.so.15(libmysqlclient_15) is needed by dovecot-1.0-1.2.rc15.el5.i386

Solution:
If the above message appears, you need to install the following two packages (all in the second CD in):
[root @ localhost ~] # RPM -ivh /mnt/Server/perl-DBI-1.52-1.fc6. i386.rpm
warning: /mnt/Server/perl-DBI-1.52-1.fc6.i386.rpm: Header V3 DSA Signature: NOKEY, Key ID 37,017,186
the Preparing ... ############## ############################# [100%]
. 1: the DBI Perl-############ ############################### [100%]

[the root @ localhost ~] # RPM -ivh /mnt/Server/mysql-5.0.22-2.1.i386.rpm
warning: /mnt/Server/mysql-5.0.22-2.1.i386.rpm: Header V3 the DSA Signature: NOKEY, Key ID 37,017,186
the Preparing ... ########################################### [100%]
. 1: MySQL ########################################### [100%]
some people might also prompt:
libpq.so.4 iS needed by Dovecot-1.0-1.2.rc15.el5.i386
you also need to install:
[root @ localhost ~] # RPM -ivh / mnt / Server /postgresql-libs-8.1.4-1.1.i386.rpm
warning: /mnt/Server/postgresql-libs-8.1.4-1.1.i386.rpm: Header V3 DSA Signature: NOKEY, Key ID 37,017,186
the Preparing ... ### ######################################## [100%]
. 1: PostgreSQL-libs # ########################################## [100%]

More than three packages on CD-ROM. After installation you can install dovecot

[root @ localhost ~] # RPM -ivh /mnt/Server/dovecot-1.0-1.2.rc15.el5.i386.rpm
warning: /mnt/Server/dovecot-1.0-1.2.rc15.el5.i386.rpm: Header DSA Signature V3: NOKEY, Key ID 37,017,186
the Preparing ... ####################################### #### [100%]
. 1: ####################################### Dovecot #### [100%]
Second, start the service
start dovecot service: #service dovecot start
start postfix service: #service postfix start
(Note:

  1. If the postfix service can not start, and without any prompts, you must first stop the sendmail service "service sendmail stop", and then start the
    postfix service, the best idea is not to install or delete sendmail sendmail.
  2. If the "listen (995): Address already in use" error reporting, you can use the command "lsof -i: 995" to see the use of the 995
    program, for example, found rpc.statd, you can use "service nfslock stop" to stop. )
    Third, modifying the configuration file dovecot:
    #vi /etc/dovecot.conf
    the phrase commented
    protocols = imap imaps pop3 pop3s
    four, modifying the configuration file postfix:
    #vi /etc/postfix/main.cf
    remove these annotations below, and fill in the appropriate information
    myhostname = host name of the server
    (with a hostname see, for example: localhost.localdomain)
    mydomain = server's domain name (domain name is about to be used as a server, for example: mkdovecot.com) myorigin = m Y d The m a i n i n e t i n t e r f a c e s = a l l The i n e t i n t e r f a c e s = l The c a l h The s t This sentence Note release Fall m Y d e s t i n a t i The n = mydomain inet_interfaces = all (the sentence commented inet_interfaces = localhost) mydestination = myhostname, localhost. m Y d The m a i n , l The c a l h The s t , mydomain, localhost, mydomain mynetworks = IP address of the server
    to save exit
    five, restart the service:

service postfix restart

service dovecot restart

Sixth, the test server (turn off the firewall)

telnet host name (or server IP, 127.0.0.1) 25

telnet host name (or the server IP, 127.0.0.1) 110

Check whether the success of the above, this server can receive and send mail, here you have configured a mail server, but is not encrypted. To be encrypted
, then continues it
seven or configure the security certificate

  1. Establish server key

cd /etc/httpd/conf

rm ssl./server.

#mkdir ssl.key ssl.csr ssl.crt

/usr/bin/openssl genrsa -des3 1024 > /etc/httpd/conf/ssl.key/server.key

openssl rsa -in ssl.key/server.key -out ssl.key/server.key

  1. The establishment of a public key server

/usr/bin/openssl req -new -key /etc/httpd/conf/ssl.key/server.key -out /etc/httpd/conf/ssl.csr/server.csr

  1. Establish service certificate

openssl x509 -in ssl.csr/server.csr -out ssl.crt/server.crt -req -signkey ssl.key/server.key -days 365

  1. Configuration ssl (this is mainly to verify whether ssl configuration is successful, you can not skip)

vi /etc/httpd/conf.d/ssl.conf the DocumentRoot "/ var / www / html" Notes removed before

  1. Restart Service

service httpd restart

  1. Apache testing and safety certification.
    In the URL, enter: https: // localhost or https://127.0.0.1
    eight configuration postfix
  2. Edit the main.cf postfix

vi /etc/postfix/main.cf added at the end:

smtpd_use_tls = yes
smtpd_tls_session_cache_database = btree:/etc/postfix/smtpd_scache
smtpd_tls_cert_file=/etc/httpd/conf/ssl.crt/server.crt
smtpd_tls_key_file=/etc/httpd/conf/ssl.key/server.key
2) 编辑master.cf

vi /etc/postfix/master.cf Notes removed following three lines:

n-inet SMTPS - n-- - smtpd
-o smtpd_tls_wrappermode = Yes
-o = Yes smtpd_sasl_auth_enable
the smtp inet n - n - - smtpd commented
3) Edit dovecot.conf

we /etc/dovecot.conf

The changed protocols = imap pop3 protocols = imap imaps pop3 pop3s and commented out.
Remove ssl_disable = no comment to take effect.
= /Etc/httpd/conf/ssl.crt/server.crt modify ssl_cert_file
ssl_key_file = /etc/httpd/conf/ssl.key/server.key
nine open saslauthd service
#service saslauthd start (this service is turned on by " smtp server requires authentication ") to restart the services and networks. (Dovecot,
postfix, Networks)
Note: smtps port is 465 pops port 995 is
ten, windows client with Outlook Express test

Attached:
the Telnet port number appears 25 Connection closed by foreign host solutions
will /etc/postfix/main.cf mynetworks file inside the line commented out with #

Published 29 original articles · won praise 0 · Views 596

Guess you like

Origin blog.csdn.net/drrui520/article/details/104952116