close
Electronic Mail Services

(1)Service: Sendmail (MTA)

Packages: sendmail, sendmail-cf, sendmail-doc
Daemon: /usr/sbin/sendmail
Script: /etc/init.d/sendmail
Port: 25 (smtp)
Configuration: /etc/mail/sendmailmc, /etc/aliases, and others
Related: procmail(MDA), spamassassin, tcp_wrappers

(2)Service: Dovecot(MRA)

Packages: dovecot
Daemon: /usr/sbin/dovecot
Script: /etc/init.d/dovecot
Ports: 110(pop), 995(pop3s), 143(imap), 993(imaps)
Configuration: /etc/dovecot.conf
Related: procmail, openssl

%iptables開放Ports: 110(pop), 143(imap), 993(imaps), 995(pop3s)通過
%確認DNS(mx record)是否正確
%補裝Package: sendmail-cf

[root@server118 ~]# dig -t mx example.com

; <<>> DiG 9.3.4-P1 <<>> -t mx example.com
;; global options: printcmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 19431
;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1

;; QUESTION SECTION:
;example.com. IN MX

;; ANSWER SECTION:
example.com. 86400 IN MX 10 server1.example.com.

;; AUTHORITY SECTION:
example.com. 86400 IN NS server1.

;; ADDITIONAL SECTION:
server1.example.com. 86400 IN A 192.168.0.254

;; Query time: 5 msec
;; SERVER: 192.168.0.254#53(192.168.0.254)
;; WHEN: Sat Aug 1 14:06:19 2009
;; MSG SIZE rcvd: 90


1. 啟動sendmail, dovecot
#service sendmail start
#service dovecot start

%若Server有安裝其他的MTA(postfix)
%可用#alternative --config mta
[root@server118 ~]# alternatives --config mta

There are 2 programs which provide 'mta'.

Selection Command
-----------------------------------------------
*+ 1 /usr/sbin/sendmail.sendmail
2 /usr/sbin/sendmail.postfix

Enter to keep the current selection[+], or type selection number:

%考試時可自行選擇熟悉的service使用

(1) 修改sendmail.mc
#vi /etc/mail/sendmail.mc

---略---
#註解DAEMON前加 "dnl (注意有空白)"
dnl DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl
---略---

(2)修改local-host-names 加入"example.com"
#vi local-host-names

# local-host-names - include all aliases for your machine here.
example.com

(3)允許192.168.0.254 relay
#vi access

# by default we allow relaying from localhost...
Connect:localhost.localdomain RELAY
Connect:localhost RELAY
Connect:127.0.0.1 RELAY
Connect:192.168.0.254 RELAY

(4)修改dovecot.conf, 把protocols註解"#"拿掉
#vi /etc/dovecot.conf

# 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


(5)重新啟動sendmail, dovecot
#service sendmail restart
#service dovecot restart
arrow
arrow
    全站熱搜

    aquatower 發表在 痞客邦 留言(0) 人氣()