|
 |
栏目导栏 |
|
| |
|
|
|
|
 |
资料搜索 |
|
| |
|
|
|
|
 |
热门文章 |
|
| |
|
|
|
|
 |
最新文章 |
|
| |
|
|
|
| |
| |
|
|
|
| |
| ubuntu 6.10 postfix+SASL+smtp+pop3配置 |
|
安装postfix、SASL及smtp服务4quLinux联盟 apt-get install postfix libsasl2 sasl2-bin libsasl2-modules libdb3-util procmail4quLinux联盟 4quLinux联盟 您将会被问一些问题:4quLinux联盟 General type of configuration? <-- Internet Site4quLinux联盟 Mail name? <-- server1.example.com4quLinux联盟 4quLinux联盟 2,配置postfix4quLinux联盟 dpkg-reconfigure postfix4quLinux联盟 4quLinux联盟 您将再次被问一些问题:4quLinux联盟 General type of configuration? <-- Internet Site4quLinux联盟 Where should mail for root go <-- NONE4quLinux联盟 Mail name? <-- server1.example.com4quLinux联盟 Other destinations to accept mail for? (blank for none) <-- server1.example.com, localhost.example.com, localhost4quLinux联盟 Force synchronous updates on mail queue? <-- No4quLinux联盟 Local networks? <-- 127.0.0.0/84quLinux联盟 Use procmail for local delivery? <-- Yes4quLinux联盟 Mailbox size limit <-- 04quLinux联盟 Local address extension character? <-- +4quLinux联盟 Internet protocols to use? <-- all4quLinux联盟 4quLinux联盟 3,配置postfix使它通过SASL实现smtp4quLinux联盟 ### Configure Postfix to do SMTP AUTH using SASL (saslauthd)4quLinux联盟 postconf -e 'smtpd_sasl_local_domain ='4quLinux联盟 postconf -e 'smtpd_sasl_auth_enable = yes'4quLinux联盟 postconf -e 'smtpd_sasl_security_options = noanonymous'4quLinux联盟 postconf -e 'broken_sasl_auth_clients = yes'4quLinux联盟 postconf -e 'smtpd_recipient_restrictions = permit_sasl_authenticated,permit_mynetworks,reject_unauth_destination'4quLinux联盟 postconf -e 'inet_interfaces = all'4quLinux联盟 echo 'pwcheck_method: saslauthd' >> /etc/postfix/sasl/smtpd.conf4quLinux联盟 echo 'mech_list: plain login' >> /etc/postfix/sasl/smtpd.conf4quLinux联盟 4quLinux联盟 生成用于加密和认证用的证书4quLinux联盟 ### Generate certificates to be used for TLS encryption and/or certificate Authentication4quLinux联盟 mkdir /etc/postfix/ssl4quLinux联盟 cd /etc/postfix/ssl/4quLinux联盟 openssl genrsa -des3 -rand /etc/hosts -out smtpd.key 10244quLinux联盟 chmod 600 smtpd.key4quLinux联盟 openssl req -new -key smtpd.key -out smtpd.csr4quLinux联盟 openssl x509 -req -days 3650 -in smtpd.csr -signkey smtpd.key -out smtpd.crt4quLinux联盟 openssl rsa -in smtpd.key -out smtpd.key.unencrypted4quLinux联盟 mv -f smtpd.key.unencrypted smtpd.key4quLinux联盟 openssl req -new -x509 -extensions v3_ca -keyout cakey.pem -out cacert.pem -days 36504quLinux联盟 4quLinux联盟 配置postfix,加密发送和接收的邮件4quLinux联盟 ### Configure Postfix to do TLS encryption for both incoming and outgoing mail4quLinux联盟 postconf -e 'smtpd_tls_auth_only = no'4quLinux联盟 postconf -e 'smtp_use_tls = yes'4quLinux联盟 postconf -e 'smtpd_use_tls = yes'4quLinux联盟 postconf -e 'smtp_tls_note_starttls_offer = yes'4quLinux联盟 postconf -e 'smtpd_tls_key_file = /etc/postfix/ssl/smtpd.key'4quLinux联盟 postconf -e 'smtpd_tls_cert_file = /etc/postfix/ssl/smtpd.crt'4quLinux联盟 postconf -e 'smtpd_tls_CAfile = /etc/postfix/ssl/cacert.pem'4quLinux联盟 postconf -e 'smtpd_tls_loglevel = 1'4quLinux联盟 postconf -e 'smtpd_tls_received_header = yes'4quLinux联盟 postconf -e 'smtpd_tls_session_cache_timeout = 3600s'4quLinux联盟 postconf -e 'tls_random_source = dev:/dev/urandom'4quLinux联盟 postconf -e 'myhostname = mail.lawspirit.com'4quLinux联盟 4quLinux联盟 4,重启postfix服务4quLinux联盟 /etc/init.d/postfix restart4quLinux联盟 4quLinux联盟 5,做一些小的修改,以便于postfix可以通过saslauthd工作4quLinux联盟 mkdir -p /var/spool/postfix/var/run/saslauthd4quLinux联盟 4quLinux联盟 6,编辑一下下面这个文件4quLinux联盟 vim /etc/default/saslauthd4quLinux联盟 4quLinux联盟 # This needs to be uncommented before saslauthd will be run automatically4quLinux联盟 START=yes4quLinux联盟 4quLinux联盟 PWDIR="/var/spool/postfix/var/run/saslauthd"4quLinux联盟 PARAMS="-m ${PWDIR} -r"4quLinux联盟 # PIDFILE="${PWDIR}/saslauthd.pid"4quLinux联盟 4quLinux联盟 # You must specify the authentication mechanisms you wish to use.4quLinux联盟 # This defaults to "pam" for PAM support, but may also include4quLinux联盟 # "shadow" or "sasldb", like this:4quLinux联盟 # MECHANISMS="pam shadow"4quLinux联盟 4quLinux联盟 MECHANISMS="shadow"4quLinux联盟 4quLinux联盟 7,这步很重要,因为我找了很多资料,这一步都没写对 ^_^4quLinux联盟 vim /etc/init.d/saslauthd4quLinux联盟 4quLinux联盟 [...]4quLinux联盟 PWDIR=/var/spool/postfix/var/run/saslauthd4quLinux联盟 PIDFILE="/var/spool/postfix/var/run/${NAME}/saslauthd.pid"4quLinux联盟 [...]4quLinux联盟 4quLinux联盟 8,配置一下4quLinux联盟 sudo dpkg-statoverride --force --update --add root sasl 755 /var/spool/postfix/var/run/saslauthd4quLinux联盟 4quLinux联盟 9,重启saslauthd服务4quLinux联盟 /etc/init.d/saslauthd start4quLinux联盟 4quLinux联盟 10,安装pop3服务4quLinux联盟 apt-get install courier-authdaemon courier-base courier-imap courier-imap-ssl courier-pop courier-pop-ssl courier-ssl gamin libgamin0 libglib2.0-04quLinux联盟 4quLinux联盟 回答他的问题4quLinux联盟 Create directories for web-based administration ? <-- No4quLinux联盟 SSL certificate required <-- Ok4quLinux联盟 4quLinux联盟 做一些配置4quLinux联盟 postconf -e 'home_mailbox = Maildir/'4quLinux联盟 postconf -e 'mailbox_command ='4quLinux联盟 /etc/init.d/postfix restart4quLinux联盟 4quLinux联盟 4quLinux联盟 如果一切都正常的话,你现在可以用evolution之类的软件做测试了(ubuntu自带)4quLinux联盟
Linux联盟收集整理 ,转贴请标明原始链接,如有任何疑问欢迎来本站Linux论坛讨论 |
|
|
|
|
|