четверг, 29 сентября 2016 г.

Exim on CentOS 7



Установка нужны компонентов
yum -y install file perl-Mail-SPF.noarch openssl 

Создание сертификатов
mkdir /etc/SSL
cd /etc/SSL
openssl req -nodes -x509 -newkey rsa:2048 -keyout mail.mydomain.com.key -out mail.mydomain.com.crt -days 1825

Установка Exim
yum -y install exim

Настройка
cp /etc/exim/exim.conf /etc/exim/exim.conf.orig

vi /etc/exim/exim.conf

######################################################
#                    MAIN CONFIGURATION SETTINGS                     #
######################################################
     primary_hostname = mail.mydomain.com
     domainlist local_domains = @ : mydomain.com

     tls_advertise_hosts = *
     tls_certificate = /etc/ssl/mail.mydomain.com.crt
     tls_privatekey = /etc/ssl/mail.mydomain.com.key

     auth_advertise_hosts = *

#####################################################
#                      TRANSPORTS CONFIGURATION                      #
#####################################################
     local_delivery:
       driver = appendfile
       directory = $home/Maildir
       maildir_format
       maildir_use_size_file
       delivery_date_add
       envelope_to_add
       return_path_add
########################################################
#                   AUTHENTICATION CONFIGURATION                     #
########################################################
     dovecot_login:
       driver = dovecot
       public_name = LOGIN
       server_socket = /var/run/dovecot/auth-client
       server_set_id = $auth1

     dovecot_plain:
       driver = dovecot
       public_name = PLAIN
       server_socket = /var/run/dovecot/auth-client
       server_set_id = $auth1
=================================================

Запуск и Автостарт
service exim start
service exim status
chkconfig exim on

Отключаем и Удаляем Postfix
alternatives --config mta


  Selection    Command
-----------------------------------------------
*+ 1           /usr/sbin/sendmail.postfix
   2           /usr/sbin/sendmail.exim

Enter to keep the current selection[+], or type selection number: 2

chkconfig postfix off
service postfix stop
yum -y remove postfix

Установка Dovecot
yum -y install dovecot

Настройка
vi /etc/dovecot/conf.d/10-ssl.conf

     ssl = yes
     ssl_cert = </etc/ssl/mail.mydomain.com.crt
     ssl_key = </etc/ssl/mail.mydomain.com.key

==== через sed ====
sed -i 's/#ssl = yes/ssl = yes/g' /etc/dovecot/conf.d/10-ssl.conf  
sed -i 's#pki/dovecot/certs/dovecot.pem#ssl/mail.domain.com.crt#g' /etc/dovecot/conf.d/10-ssl.conf
sed -i 's#pki/dovecot/private/dovecot.pem#ssl/mail.domain.com.key#g' /etc/dovecot/conf.d/10-ssl.conf
================

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

     disable_plaintext_auth = no
     auth_mechanisms = plain login

==== через sed ====
sed -i 's/#disable_plaintext_auth = yes/disable_plaintext_auth = no/g' /etc/dovecot/conf.d/10-auth.conf
sed -i 's/auth_mechanisms = plain/auth_mechanisms = plain login/g' /etc/dovecot/conf.d/10-auth.conf
================
vi /etc/dovecot/conf.d/10-mail.conf

     mail_location = maildir:~/Maildir

==== через sed ====
sed -i 's$#mail_location =$mail_location = maildir:~/Maildir$g' /etc/dovecot/conf.d/10-mail.conf
================
vi /etc/dovecot/conf.d/10-master.conf

     service auth {
     ...
         unix_listener auth-client {
             mode = 0660
             user = exim
         }
     }

==== через sed ====
sed -i 's$# Postfix smtp-auth$unix_listener auth-client { \n  mode = 0660 \n  user = exim } \n \n # Postfix smtp-auth$g' /etc/dovecot/conf.d/10-master.conf
================

Запуск и Автостарт
service dovecot start
service dovecot status
chkconfig dovecot on

Создаём пользователя
useradd -m test
passwd test


Тестирование транспорта почты
mail -s "Test Email" <Destination@mailaddress.com> < /dev/null

Оносвано на: www.rosehosting.com

Комментариев нет:

Отправить комментарий