ImageVerifierCode 换一换
格式:DOCX , 页数:24 ,大小:27.11KB ,
资源ID:8496258      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/8496258.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(GentooVirtual Mailhosting System with Postfix Guide.docx)为本站会员(b****6)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

GentooVirtual Mailhosting System with Postfix Guide.docx

1、GentooVirtual Mailhosting System with Postfix GuideVirtual Mailhosting System with Postfix Guide窗体顶端Content: 窗体底端1. IntroductionFor most Gentoo users, a simple mail client and fetchmail will do. However, if youre hosting a domain with your system, youll need a full blown MTA (Mail Transfer Agent). A

2、nd if youre hosting multiple domains, then youll definitely need something more robust to handle all of the email for your users. This system was designed to be an elegant solution to that problem. A virtual mail system needs to be able to handle email for numerous domains with multiple users over a

3、 variety of interfaces. This presents some issues that must be dealt with. For instance, what if you have two users on different domains that want the same user name? If you are providing imap access and smtp-auth, how do combine the various authentication daemons into a single system? How do you pr

4、ovide security for the numerous components that comprise the system? How do you manage it all? This howto will show you how to set up with a mail system capable of handling mail for as many domains as your hardware can handle, supports virtual mail users that dont require shell accounts, has domain

5、specific user names, can authenticate web, imap, smtp, and pop3 clients against a single database, utilizes ssl for transport layer security, has a web interface, can handle mailing lists for any domain on the machine, and is controlled by a nice, central and easy mysql database. There are quite a v

6、ariety of ways to go about setting up a virtual mailhosting system. With so may options, another may be the best choice for your specific needs. Consider investigating http:/www.qmail.org/ and http:/www.exim.org/ to explore your options. The following packages are used in this setup: apache, courier

7、-imap, courier-authlib postfix, mod_php, phpmyadmin, squirrelmail, cyrus-sasl, mysql, php, and mailman. Make sure to turn on the following USE variables in /etc/make.conf before compiling the packages: USE=mysql imap libwww maildir sasl ssl. Otherwise you will most likely have to recompile things to

8、 get the support you need for all the protocols. Further, its a good idea to turn off any other mail and network variables, like ipv6. Important: You need a domain name to run a public mail server, or at least an MX record for a domain. Ideally you would have control of at least two domains to take

9、advantage of your new virtual domain functionality. Important: Make sure /etc/conf.d/hostname is set to the right hostname for your mail server. You can apply any changes you make to this file by running /etc/init.d/hostname restart. Verify your hostname is set correctly with hostname. Also verify t

10、hat there are no conflicting entries in /etc/hosts. Note: It is recommended that you read this entire document and familiarize yourself with all the steps before attempting the install. If you run into problems with any of the steps, check the troubleshooting guide at the end of this document. Also,

11、 not all the referenced packages are necessary, this set up is very flexible. For instance, if you do not desire a web interface, feel free to skip the squirrelmail section. 2. Postfix BasicsCode Listing2.1: Install postfix# emerge postfixWarning: Verify that you have not installed any other MTA, su

12、ch as ssmtp, exim, or netqmail, or you will surely have BIG problems. After postfix is installed, its time to configure it. Change the following options in /etc/postfix/main.cf. Remember to replace $variables with your own names. Code Listing2.2: /etc/postfix/main.cfmyhostname = $host.domain.namemyd

13、omain = $domain.nameinet_interfaces = allmydestination = $myhostname, localhost.$mydomain $mydomainmynetworks = .work/24, 127.0.0.0/8home_mailbox = .maildir/local_destination_concurrency_limit = 2default_destination_concurrency_limit = 10Next change the following in /etc/postfix/master.cf. This will

14、 turn on verbose output for debugging: Code Listing2.3: /etc/postfix/master.cf# service type private unpriv chroot wakeup maxproc command + args# (yes) (yes) (yes) (never) (50)#=(Just add the -v after the smtpd in the following line)smtp inet n - n - - smtpd -vNext, edit /etc/mail/aliases to add you

15、r local aliases. There should at least be an alias for root like: root: youremail.address. Code Listing2.4: Starting postfix for the first time# /usr/bin/newaliases(This will install the new aliases. You only need to do thiswhen you update or install aliases.)# /etc/init.d/postfix startNow that post

16、fix is running, fire up your favorite console mail client and send yourself an email. I use mutt for all my console mail. Verify that postfix is delivering mail to local users, once thats done, were on to the next step. Note: I strongly recommend that you verify this basic postfix setup is functioni

17、ng before you progress to the next step of the howto. 3. Courier-imapCode Listing3.1: Install courier-imap and courier-authlib# emerge courier-imap courier-authlibCode Listing3.2: Courier-imap configuration# cd /etc/courier-imap(If you want to use the ssl capabilities of courier-imap or pop3,youll n

18、eed to create certs for this purpose.This step is recommended. If you do not want to use ssl, skip this step.)# nano -w f# nano -w f(Change the C, ST, L, CN, and email parameters to match your server.)# mkpop3dcert# mkimapdcertCode Listing3.3: Start the courier services you need.# /etc/init.d/courie

19、r-imapd start# /etc/init.d/courier-imapd-ssl start# /etc/init.d/courier-pop3d start# /etc/init.d/courier-pop3d-ssl startStart up your favorite mail client and verify that all connections youve started work for receiving and sending mail. Of course, you wont be able to log on to any of the services b

20、ecause authentication hasnt been configured yet, but it is wise to check if the connections themselves work or not. Now that the basics work, were going to do a whole bunch of stuff at once to get the rest of the system running. Again, please verify that what weve installed already works before prog

21、ressing. 4. Cyrus-saslNext were going to install cyrus-sasl. Sasl is going to play the role of actually passing your auth variables to courier-auth, which will in turn pass that information to mysql for authentication of smtp users. For this howto, well not even try to verify that sasl is working un

22、til mysql is set up and contains a test user. Which is fine since well be authenticating against mysql in the end anyway. Code Listing4.1: Configuring and installing the cyrus-sasl ebuild# emerge cyrus-saslNext, edit /etc/sasl2/smtpd.conf. Code Listing4.2: Starting sasl# nano -w /etc/sasl2/smtpd.con

23、fmech_list: PLAIN LOGINpwcheck_method: saslauthd# nano -w /etc/conf.d/saslauthdSASLAUTHD_OPTS=$SASLAUTH_MECH -a rimap -rSASLAUTHD_OPTS=$SASLAUTHD_OPTS -O localhost# /etc/init.d/saslauthd start5. SSL Certs for Postfix and ApacheNext were going to make a set of ssl certificates for postfix and apache.

24、 Code Listing5.1: Making ssl certicates# cd /etc/ssl/# nano -w fChange the following default values for your domain:countryName_defaultstateOrProvinceName_defaultlocalityName_default0.organizationName_defaultcommonName_defaultemailAddress_default.(If the variables are not already present, just add t

25、hem in a sensible place.)# cd misc# ./CA.pl -newreq-nodes# ./CA.pl -newca# ./CA.pl -sign# cp newcert.pem /etc/postfix# cp newkey.pem /etc/postfix# cp demoCA/cacert.pem /etc/postfix(Now we do the same thing for apache.)# openssl req -new new.cert.csr# openssl rsa -in privkey.pem -out new.cert.key# op

26、enssl x509 -in new.cert.csr -out new.cert.cert -req -signkey new.cert.key -days 365(Just leave the resulting certificates here for now.Well install them after Apache is installed.)6. Adding SSL and SASL support to PostfixNow edit the postfix configs to make it aware of your new sasl and ssl capabili

27、ties. Add the following parameters to the end of the file where they will be easy to find. Code Listing6.1: /etc/postfix/main.cf# nano -w /etc/postfix/main.cfsmtpd_sasl_auth_enable = yessmtpd_sasl2_auth_enable = yessmtpd_sasl_security_options = noanonymousbroken_sasl_auth_clients = yessmtpd_sasl_loc

28、al_domain =(The broken_sasl_auth_clients option and the login auth methodare for outlook and outlook express only and are undocumented.Isnt having to hack software for stupid, broken, M$ BS great?smtpd_sasl_local_domain appends a domain name to clients usingsmtp-auth. Make sure its blank or your use

29、r names will getmangled by postfix and be unable to auth.)smtpd_recipient_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination(The next two options enable outgoing encryption.)smtp_use_tls = yessmtp_tls_note_starttls_offer = yessmtpd_use_tls = yes#smtpd_tls_auth_onl

30、y = yessmtpd_tls_key_file = /etc/postfix/newkey.pemsmtpd_tls_cert_file = /etc/postfix/newcert.pemsmtpd_tls_CAfile = /etc/postfix/cacert.pemsmtpd_tls_loglevel = 3smtpd_tls_received_header = yessmtpd_tls_session_cache_timeout = 3600stls_random_source = dev:/dev/urandom(smtpd_tls_auth_only is commented

31、 out to ease testing the system.You can turn this on later if you desire.)# postfix reloadNow were going to verify that the configs we added were picked up by postfix. For this we are going to use telnet (provided by for instance net-misc/netkit-telnetd) although you can also use nc (provided by net-analyzer/netcat): Code Listing6.2: Verifying sasl and tls support# telnet localhost 25Trying 127.0.0.1.Connected to localhost.Escape character is .220 ESMTP PostfixEHLO

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1