国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 系統 > Linux > 正文

如何在Linux下安裝Sendmail服務器軟件的方法

2020-06-13 12:33:17
字體:
來源:轉載
供稿:網友
Sendmail現在是最流行的郵件服務器,那我們來看看如何在Linux下安裝Sendmail服務器
 
 

1、從www.sendmail.org下載最新的版本(這個snedmail倒是有必要升級為最新的版本,因為它的升級主要是安全漏洞問題)。這里說明的是用的sendmail-8.12.2.tar.gz 
  2、cd /usr/local/src/ 
  3、把文件下載到:/usr/local/src中 
  4、tar zxvf sendmail-8.12.2.tar.gz 
  5、cd /usr/local/src/sendmail-8.12.2 
  6、chmod go-w / /etc /etc/mail /usr /var /var/spool /var/spool/mqueue 
  7、chown root / /etc /etc/mail /usr /var /var/spool /var/spool/mqueue 
  8、cd /usr/local/src/sendmail-8.12.2/sendmail 
  9、sh Build 
  10、cd /usr/local/src/sendmail-8.12.2/cf/cf 
  11、建立文件sendmail.mc內容如下,你可根據需要修改相應部分。 
  divert(-1) 
  dnl This is the macro config file used to generate the /etc/sendmail.cf 
  dnl file. If you modify thei file you will have to regenerate the 
  dnl /etc/sendmail.cf by running this macro config through the m4 
  dnl preprocessor: 
  dnl m4 /etc/sendmail.mc > /etc/sendmail.cf 
  dnl You will need to have the Sendmail-cf pacage installed for this to work. 
  include(`/usr/local/src/sendmail-8.12.2/cf') 
  define(`confDEF_USER_ID',`8:12') 
  OSTYPE(`linux') 
  undefine(`UUCP_RELAY') 
  undefine(`BITNET_RELAY') 
  define(`confTO_CONNECT', `1m') 
  define(`confTRY_NULL_MX_LIST',true) 
  define(`confDONT_PROBE_INTERFACES',true) 
  define(`PROCMAIL_MAILER_PATH',`/usr/bin/procmail') 
  define(`SMART_HOST',compaq.rd.xxx.com) 
  <---這條用于(非HUB)缺省使用HUB發送郵件 
  MASQUERADE_AS(`rd.xxx.com') 
  <------------------------- 
  FEATURE(`masquerade_entire_domain') 
  <---這三條用于郵件地址偽裝 
  FEATURE(`masquerade_envelope') 
  <------------------------- 
  FEATURE(`smrsh',`/usr/sbin/smrsh') 
  FEATURE(`mailertable',`hash -o /etc/mail/mailertable') 
  FEATURE(`virtusertable',`hash -o /etc/mail/virtusertable') 
  FEATURE(redirect) 
  FEATURE(always_add_domain) 
  FEATURE(use_cw_file) 
  FEATURE(local_procmail) 
  FEATURE(`access_db') 
  FEATURE(`blacklist_recipients') 
  FEATURE(`accept_unresolvable_domains') 
  MAILER(smtp) 
  MAILER(procmail) 
  dnl We strongly recommend to comment this one out if you want to protect 
  dnl yourself from spam. However, the laptop and users on computers that do 
  dnl not hav 24x7 DNS do need this. 
  dnl FEATURE(`relay_based_on_MX') 
  12、sh Build install-cf 
  13、groupadd smmsp 
  14、useradd smmsp 
  15、cd cd /usr/local/src/sendmail-8.12.2/sendmail 
  16、sh Build install 
  17、cd /usr/local/src/sendmail-8.12.2/makemap 
  18、sh Build clean 
  19、sh Build all 
  20、sh Build install 
  21、cd /usr/local/src/sendmail-8.12.2/ 
  22、在本域DNS主數據庫文件中增加MX紀錄: 
  rd.xxx.com. IN MX 0 compaq 
  注意修改相應部分。那個0是有幾個郵件集中器的時候用于標記先后順序的。當有好幾個MX的時候,建議順序寫為10、20、30… 
  23、在/etc/mail目錄下創建access文件,內容類似如下: 
  127.0.0.1 RELAY 
  21.9.22 RELAY 
  211.99.221.238 RELAY 
  然后:makemap hash access.db < access 
  24、創建文件/etc/mail/local-host-names,其內容為本機的擁有的域名信息。 
  rd.xxx.com 
  compaq.rd.xxx.com 
  25、創建文件/etc/mail/aliases,內容類似: 
  MAILER-DAEMON: postmaster 
  postmaster: root 
  bin: root 
  daemon: root 
  nobody: root 
  運行newaliases創建數據庫。 
  創建別名文件的意義之一在于當郵件發往域中其他郵件服務器的用戶而不是mail HUB用戶的時候用。 
  比如增加一條: 
  atan: atan@fbsd 
  則導致郵件發往mail HUB的時候自動轉發到atan@fbsd.rd.xxx.com 
  26、啟動sendmail: /usr/sbin/sendmail -bd -q30m 
  排錯:如果有問題導致啟動不了,大部分問題和DNS配置有關,可以使用nslookup檢查DNS是否正常。挨個檢查/etc/mail中的文件內容也是排錯的好辦法。另外,修改配置,不建議直接編輯sendmail.cf文件,建議使用m4宏編譯工具,因為有些帶有安全漏洞或過時的宏在編譯的時候會有提示,這樣以免造成相關安全問題。 

  通過上面文章,我們應該了解了在Linux下安裝Sendmail服務器的方法,希望對你們有幫助!



發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 雷州市| 海林市| 洛川县| 海兴县| 佛坪县| 炉霍县| 伽师县| 扎鲁特旗| 成都市| 通河县| 蓬安县| 肇东市| 湟源县| 宁城县| 开原市| 彭阳县| 乐清市| 虞城县| 麻栗坡县| 缙云县| 吉水县| 大同市| 出国| 武强县| 潍坊市| 福贡县| 广东省| 县级市| 安化县| 调兵山市| 海盐县| 兴隆县| 青岛市| 金湖县| 大港区| 惠来县| 汝阳县| 晋州市| 十堰市| 灵川县| 百色市|