1
postconf -e 'smtpd_sasl_local_domain ='
2
postconf -e 'smtpd_sasl_auth_enable = yes'
3
postconf -e 'smtpd_sasl_security_options = noanonymous'
4
postconf -e 'broken_sasl_auth_clients = yes'
5
postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination'
6
postconf -e 'inet_interfaces = all'
7
echo 'pwcheck_method: saslauthd' >> /etc/postfix/sasl/smtpd.conf
8
echo 'mech_list: plain login' >> /etc/postfix/sasl/smtpd.conf
10
mkdir /etc/postfix/ssl
12
openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 1024
14
openssl req -new -key smtpd.key -out smtpd.csr
15
openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt
16
openssl rsa -in smtpd.key -out smtpd.key.unencrypted
17
mv -f smtpd.key.unencrypted smtpd.key
18
openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 3650
20
postconf -e 'smtpd_tls_auth_only = no'
21
postconf -e 'smtp_use_tls = yes'
22
postconf -e 'smtpd_use_tls = yes'
23
postconf -e 'smtp_tls_note_starttls_offer = yes'
24
postconf -e 'smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key'
25
postconf -e 'smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt'
26
postconf -e 'smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem'
27
postconf -e 'smtpd_tls_loglevel = 1'
28
postconf -e 'smtpd_tls_received_header = yes'
29
postconf -e 'smtpd_tls_session_cache_timeout = 3600s'
30
postconf -e 'tls_random_source = dev:/dev/urandom'
31
postconf -e 'myhostname = mail.example.com'