zmail邮件系统安装手册 V2.0版本
2019獨角獸企業重金招聘Python工程師標準>>>
Tmail郵件系統安裝手冊 V2.0版本 1、系統環境 centos6.0以上,最小化安裝(64位系統) 2、部署 1、刪除自帶的postfix、mysql、httpd # rpm -qa|grep postfix|xargs rpm -e --nodeps # rpm -qa|grep mysql|xargs rpm -e --nodeps 2、下載tmail安裝包 wget http://60.173.10.106:88/tmail_setup.tar.bz2 3、安裝 tar jxvf tmail_setup.tar.bz2 cd tmal_setup ./install.sh 看到這句話,說明安裝成功了。 Tmail System Installed Succesfully! ^_^ 4、啟動郵件系統重啟系統即可 5、訪問郵件系統 1、郵件系統后臺 https://192.168.201.54 默認用戶名:admin 默認密碼:hing123 選擇:管理員登錄后臺管理系統 2、郵件系統前臺 http://192.168.201.54:88 輸入:用戶郵件地址和密碼登錄前臺 3、郵件系統數據庫 http://192.168.201.54:88/dbadmin/ 默認用戶名:root 默認密碼:tmail 3、常見故障 1、啟動postfix故障 [root@test tmail]# /tmail/postfix/sbin/postfix start postsuper: fatal: scan_dir_push: open directory defer: Permission denied postfix/postfix-script: fatal: Postfix integrity check failed! 解決: [root@test tmail]# chown postfix:root /tmail/postfix/spool/ -R [root@test tmail]# chown postfix:postdrop /tmail/postfix/spool/maildrop/ -R [root@test tmail]# chown postfix:postdrop /tmail/postfix/spool/public/ -R [root@test tmail]# chmod g+s /tmail/postfix/sbin/postdrop [root@test tmail]# chmod g+s /tmail/postfix/sbin/postqueue [root@test tmail]# chown postfix.root /var/lib/postfix/ -R 啟動postfix: [root@test tmail]# /tmail/postfix/sbin/postfix start postfix/postfix-script: starting the Postfix mail system 2、啟動spamd故障 [root@test tmail]# /tmail/spamd/bin/spamd May 17 04:55:33.618 [29729] warn: netset: cannot include 127.0.0.1/32 as it has already been included May 17 04:55:35.329 [29729] info: spamd: server started on port 783/tcp (running version 3.3.2) May 17 04:55:35.329 [29729] info: spamd: server pid: 29729 May 17 04:55:35.332 [29729] info: spamd: server successfully spawned child process, pid 29731 May 17 04:55:35.350 [29729] info: spamd: server successfully spawned child process, pid 29732 May 17 04:55:35.354 [29729] info: prefork: child states: II May 17 05:02:30.710 [29731] info: spamd: connection from localhost [127.0.0.1] at port 55793 May 17 05:02:32.899 [29731] warn: spamd: bad protocol: header error: (closed before headers) May 17 05:02:42.161 [29729] info: prefork: child states: II 解決: [root@test tmail]# vi /tmail/spamd/etc/mail/spamassassin/local.cf #--trusted_networks_start-- #trusted_networks 127.0.0.1 ?//注釋掉解決: warn: spamd: bad protocol: header error: (closed before headers) 域名問題 vi /etc/hosts XX.XX.XX.XX ?mail.XXX.com 4、postfix配置文件 1、vi /tmail/postfix/etc/main.cf #--system_default_process_limit_start-- default_process_limit = 50 #--system_default_process_limit_end-- #--system_default_destination_recipient_limit_start-- #如果一封信的收信人超過50個,postfix會自動將此信復制成很多份,以50人為單位,分批寄送 default_destination_recipient_limit = 50 #--system_default_destination_recipient_limit_end-- #--system_smtpd_error_sleep_time_start-- #當客戶端引發錯誤時,postfix的初始等待時間。當錯誤次數超過smtpd_soft_error_limit的限制時,postfix在每次錯誤之后,都會延長5秒等待時間 smtpd_error_sleep_time = 5s #--system_smtpd_error_sleep_time_end-- #--system_smtpd_soft_error_limit_start-- #客戶端在發生10次錯誤之后,postfix才開始執行再出現錯誤就延遲5秒的操作 smtpd_soft_error_limit = 10 #--system_smtpd_soft_error_limit_end-- #--system_smtp_hard_error_limit_start-- #SMTP服務所允許的硬錯誤次數。這個參數對于防止惡意攻擊非常有效 smtp_hard_error_limit = 100 #--system_smtp_hard_error_limit_end-- #--system_strict_rfc821_envelopes_start-- #嚴格使用rfc821 strict_rfc821_envelopes = yes #--system_strict_rfc821_envelopes_end-- #--set_relayhost_start-- #relayhost = [61.139.2.69] #--set_relayhost_end-- #--system_domain_start-- #設置郵件服務器域名 myhostname = mail.XXX.com #--system_domain_end-- mydestination = localhost smtp_helo_name = $myhostname local_transport = maildrop virtual_transport ?= maildrop mailbox_transport = maildrop local_destination_concurrency_limit ?= 1 maildrop_destination_recipient_limit = 1 #--system_messages_size_limit_start-- #郵件附件大小50M message_size_limit = 52428800 #--system_messages_size_limit_end-- #讓虛擬域,虛擬郵箱別名等讀取mysql virtual_mailbox_base = / recipient_bcc_maps = mysql:/tmail/postfix/etc/mysql/recipient_bcc_map.cf sender_bcc_maps = mysql:/tmail/postfix/etc/mysql/sender_bcc_maps.cf virtual_mailbox_domains = mysql:/tmail/postfix/etc/mysql/virtual_mailbox_domains.cf #virtual_transport_maps = maildrop virtual_mailbox_maps = mysql:/tmail/postfix/etc/mysql/virtual_mailbox_maps.cf virtual_uid_maps = mysql:/tmail/postfix/etc/mysql/virtual_uid_maps.cf virtual_gid_maps = mysql:/tmail/postfix/etc/mysql/virtual_gid_maps.cf virtual_alias_maps = mysql:/tmail/postfix/etc/mysql/virtual_alias_maps.cf,mysql:/tmail/postfix/etc/mysql/tmail_group.cf virtual_alias_domains = $virtual_alias_maps relay_domains = mysql:/tmail/postfix/etc/mysql/relay_domains.cf #local_transport = virtual local_recipient_maps = $virtual_mailbox_maps broken_sasl_auth_clients = yes smtpd_sender_login_maps = mysql:/tmail/postfix/etc/mysql/smtp_login.cf smtpd_reject_unlisted_sender = yes #--restrict_start-- #smtpd_end_of_data_restrictions = check_policy_service inet:127.0.0.1:10032 permit #--restrict_end-- smtpd_recipient_restrictions = ? ? ? ?permit_mynetworks, ? ? ? ?permit_sasl_authenticated, ? ? ? ?reject_non_fqdn_hostname, ? ? ? ?permit_tls_clientcerts, ? ? ? ?reject_unknown_sender_domain, ? ? ? ?reject_non_fqdn_sender, ? ? ? ?reject_non_fqdn_recipient, ? ? ? ?reject_unauth_pipelining, ? ? ? ?reject_unauth_destination, # ? ? ? reject_unlisted_recipient, #--enable_rbl_client_start-- ? ? ? ?reject_rbl_client zen.spamhaus.org, ? ? ? ?reject_rbl_client cbl.abuseat.org, ? ? ? ?reject_rbl_client bl.spamcop.net, #--enable_rbl_client_end-- #--enable_policyd_start-- # ? ? ? check_policy_service inet:127.0.0.1:10031 #--enable_policyd_end-- #使用dovecot(生成的socket文件)來做smtpd的認證, 并設置允許本地用戶和通過認證的用戶使用smtpd(發郵件) smtpd_sasl_authenticated_header = yes //禁止匿名用戶登錄 smtpd_sasl_security_options = noanonymous smtpd_sasl_type = dovecot smtpd_sasl_path = /tmail/postfix/spool/private/auth #--disbale_lookup_start-- smtpd_peername_lookup = no #--disable_lookup_end-- #smtpd_delay_reject = yes smtpd_proxy_timeout = 180s #--helo_require_start-- smtpd_helo_required = yes #--helo_require_end-- #--disable_vrfy_start-- disable_vrfy_command=yes #--disable_vrfy_end-- #--enable_domainkey_start-- smtpd_milters = inet:localhost:8891 non_smtpd_milters = inet:localhost:8891 #--enable_domainkey_end-- #--start tls set-- #讓smtp支持加密 smtp_use_tls = yes smtpd_use_tls = yes smtp_tls_note_starttls_offer = yes smtpd_tls_cert_file = /tmail/postfix/tls/cert.pem smtpd_tls_key_file = /tmail/postfix/tls/privkey.pem smtpd_tls_loglevel = 1 smtpd_tls_received_header = yes smtpd_tls_session_cache_timeout = 3600s tls_random_source = dev:/dev/urandom #--end tls set-- 2、啟動postfix 啟動: /tmail/postfix/sbin/postfix ?start 停止: /tmail/postfix/sbin/postfix ?stop 重新加載: /tmail/postfix/sbin/postfix ?reload 5、dovecot配置文件 1、dovecot支持的協議 vi /tmail/dovecot/etc/dovecot/dovecot.conf ## Dovecot configuration file # Protocols we want to be serving. #支持imap、pop3、lmtp協議 protocols = imap pop3 lmtp instance_name = dovecot 2、讓dovecot支持mysql中的虛擬用戶 1、 vi /tmail/dovecot/etc/dovecot/conf.d/10-auth.conf #取消該行注釋 !include auth-sql.conf.ext 2、 vi /tmail/dovecot/etc/dovecot/dovecot-sql.conf.ext driver = mysql connect = host=localhost dbname=tmail user=tmail password=tmail default_pass_scheme = CRYPT password_query = SELECT email, domain, password FROM tmail_mailbox WHERE email = '%u' AND active = '1' userid = '%u' user_query = SELECT homedir AS home, uid, gid FROM tmail_mailbox where email = '%u' AND active = '1' 3、dovecot指定郵件存放目錄 vi /tmail/dovecot/etc/dovecot/conf.d/10-mail.conf mail_location = maildir:%h/Maildir 6、殺毒軟件Clamav 1、啟動殺毒軟件 /tmail/clamav/sbin/clamd 2、升級病毒庫 /tmail/clamav/bin/freshclam 采用crontab設置定時升級病毒庫 7、垃圾郵件過濾SpamAssassin 1、啟動spamd /tmail/spamd/bin/spamd -u spamd -d -c -m5 -H -r /var/run/spamd.pid 2、設置參數通過登錄后臺,設置SpamAssassin 包括:(1)、對識別出來的垃圾郵件附加到主題的字符:如”垃圾“或“spam” (2)、是否在郵件內容中詳細過濾信息(3)、安全網絡,對安全網絡發來的郵件不進行過濾(4)、設置過濾分數,高于此處設置的分數即為垃圾郵件(5)、是否使用貝葉斯算法(6)、是否開啟貝葉斯自動學習 8、web程序使用nginx+php組合 1、web管理 1、啟動web程序 /tmail/httpd/sbin/nginx 2、重新啟動 kill -hup `cat /tmail/httpd/logs/nginx.pid` 2、php管理 1、啟動php /tmail/httpd/php/sbin/php-fpm start 2、重新啟動 /tmail/httpd/php/sbin/php-fpm reload 9、數據庫 1、mysql啟動 /tmail/mysql/support-files/mysql.server start 2、mysql管理默認root密碼:tmail 可以通過phpmyadmin管理
轉載于:https://my.oschina.net/u/613964/blog/364990
創作挑戰賽新人創作獎勵來咯,堅持創作打卡瓜分現金大獎總結
以上是生活随笔為你收集整理的zmail邮件系统安装手册 V2.0版本的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 原来MySQl就是这样工作的
- 下一篇: java信息管理系统总结_java实现科