Codice:

yum install cyrus-sasl cyrus-sasl-devel cyrus-sasl-gssapi cyrus-sasl-md5 cyrus-sasl-plain postfix dovecot

adesso devi configurare SMTP-AUTH e TLS :

Codice:

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_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination’
postconf -e ‘inet_interfaces = all’
postconf -e ‘mynetworks = ‘127.0.0.1’,xxx.xxx.xxx.xxx’

poi bisogna dire a postfix di abilitare i login di PLAIN e LOGIN , nel file /usr/lib/sasl2/smtpd.conf , apri il file e editalo cosi :

Codice:

pwcheck_method: saslauthd
mech_list: plain login

poi crea i certificati per TLS :

Codice:

mkdir /etc/postfix/ssl
cd /etc/postfix/ssl/
openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024

Codice:

chmod 600 smtpd.key
openssl req -new -key smtpd.key -out smtpd.csr

Codice:

openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt

Codice:

openssl rsa -in smtpd.key -out smtpd.key.unencrypted

Codice:

mv -f smtpd.key.unencrypted smtpd.key
openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650

Codice:

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’

infine devi dire a Dovecot di usare POP3 e POP3s
nel file vi /etc/dovecot.conf cambia i seguenti settaggi cosi :

Codice:

# Protocols we want to be serving: imap imaps pop3 pop3s
# If you only want to use dovecot-auth, you can set this to “none”.
protocols = imap imaps pop3 pop3s

imposta i servizi

Codice:

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

Adesso dovrebbe funzionare per testarlo fai un collegamento telnet da un altro pc

telnet ipdelserver 25

quando sei collegato dai

Codice:

ehlo localhost

se vedi le linee 250-STARTTLS e 250-AUTH LOGIN PLAIN

e’ tutto a posto , ora puoi impostare Maildir
Codice:

postconf -e ‘home_mailbox = Maildir/’
postconf -e ‘mailbox_command =’
/etc/init.d/postfix restart