Postfix Dovecot POP3/IMAP .
yum
PHP:
yum install cyrus-sasl cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-md5 cyrus-sasl-plain postfix dovecot
SMTP-AUTH TLS .
PHP:
postconf -e 'smtpd_sasl_local_domain ='
postconf -e 'smtpd_sasl_auth_enable = yes'
postconf -e 'smtpd_sasl_security_options = noanonymous'
postconf -e 'broken_sasl_auth_clients = yes'
postconf -e 'smtpd_sasl_authenticated_header = yes'
postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject _unauth_destination'
postconf -e 'inet_interfaces = all'
postconf -e 'mynetworks = 127.0.0.0/8'
smtpd.conf postfix (PLAIN LOGIN) :
:
/usr/lib/sasl2/smtpd.conf
: 32 , : /usr/lib64/sasl2/smtpd.conf 64 .
PHP:
nano /usr/lib/sasl2/smtpd.conf
PHP:
vi /usr/lib/sasl2/smtpd.conf
:
Code:
pwcheck_method: saslauthdmech_list: plain login
:
mech_list: plain login
.. SSL Certificate SSL postfix :
PHP:
mkdir /etc/postfix/ssl
SSL :
PHP:
cd /etc/postfix/ssl/
SSL :
PHP:
openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024
PHP:
chmod 600 smtpd.key
openssl req -new -key smtpd.key -out smtpd.csr
PHP:
openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt
PHP:
openssl rsa -in smtpd.key -out smtpd.key.unencrypted
PHP:
mv -f smtpd.key.unencrypted smtpd.key
openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650
postfix TLS
PHP:
postconf -e 'smtpd_tls_auth_only = no'
postconf -e 'smtp_use_tls = yes'
postconf -e 'smtpd_use_tls = yes'
postconf -e 'smtp_tls_note_starttls_offer = yes'
postconf -e 'smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key'
postconf -e 'smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt'
postconf -e 'smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem'
postconf -e 'smtpd_tls_loglevel = 1'
postconf -e 'smtpd_tls_received_header = yes'
postconf -e 'smtpd_tls_session_cache_timeout = 3600s'
postconf -e 'tls_random_source = dev:/dev/urandom'
( ) : server1.example.com
PHP:
postconf -e 'myhostname = server1.example.com'
postfix # :
PHP:
nano /etc/postfix/main.cf
PHP:
vi /etc/postfix/main.cf
:
Code:
queue_directory = /var/spool/postfixcommand_directory = /usr/sbindaemon_directory = /usr/libexec/postfixdata_directory = /var/lib/postfixmail_owner = postfixinet_interfaces = allmydestination = $myhostname, localhost.$mydomain, localhostunknown_local_recipient_reject_code = 550alias_maps = hash:/etc/aliasesalias_database = hash:/etc/aliasesdebug_peer_level = 2debugger_command = PATH=/bin:/usr/bin:/usr/local/bin:/usr/X11R6/bin ddd $daemon_directory/$process_name $process_id & sleep 5 sendmail_path = /usr/sbin/sendmail.postfixnewaliases_path = /usr/bin/newaliases.postfixmailq_path = /usr/bin/mailq.postfixsetgid_group = postdrophtml_directory = nomanpage_directory = /usr/share/mansample_directory = /usr/share/doc/postfix-2.5.1/samplesreadme_directory = /usr/share/doc/postfix-2.5.1/README_FILESinet_protocols = allsmtpd_sasl_local_domain =smtpd_sasl_auth_enable = yessmtpd_sasl_security_options = noanonymousbroken_sasl_auth_clients = yessmtpd_sasl_authenticated_header = yessmtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject _unauth_destinationmynetworks = 127.0.0.0/8smtpd_tls_auth_only = nosmtp_use_tls = yessmtpd_use_tls = yessmtp_tls_note_starttls_offer = yessmtpd_tls_key_file = /etc/postfix/ssl/smtpd.keysmtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crtsmtpd_tls_CAfile = /etc/postfix/ssl/cacert.pemsmtpd_tls_loglevel = 1smtpd_tls_received_header = yessmtpd_tls_session_cache_timeout = 3600stls_random_source = dev:/dev/urandommyhostname = server1.example.com
postfix saslauthd Dovecot :
PHP:
chkconfig --levels 235 sendmail off
chkconfig --levels 235 postfix on
chkconfig --levels 235 saslauthd on
chkconfig --levels 235 dovecot on
/etc/init.d/sendmail stop
/etc/init.d/postfix start
/etc/init.d/saslauthd start
/etc/init.d/dovecot start
SMTP-AUTH TLS :
Code:
telnet localhost 25
: 25
WHM .
:
PHP:
ehlo localhost
:
Code:
250-STARTTLS
PHP:
250-AUTH PLAIN LOGIN
PHP:
[root@server1 ssl]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 server1.example.com ESMTP Postfix
ehlo localhost
250-server1.example.com
250-PIPELINING
250-SIZE 10240000
250-VRFY
250-ETRN
250-STARTTLS
250-AUTH PLAIN LOGIN
250-AUTH=PLAIN LOGIN
250-ENHANCEDSTATUSCODES
250-8BITMIME
250 DSN
quit
221 2.0.0 Bye
Connection closed by foreign host.
[root@server1 ssl]#
PHP:
quit
Dovecot not mbox maildir
PHP:
postconf -e 'home_mailbox = Maildir/'
postconf -e 'mailbox_command ='
/etc/init.d/postfix restart
>>>
()