使用 alternatives to Switch MTA
Overview of the alternatives system
displays or configures the preferred MTA and associated man pages based on a generic name
generic name is a link to a link in /etc/alternatives/
only the links in /etc/alternatives/ are modified
Switch between MTA's
stop the current MTA and disable boot-time startup
alternatives --config mta and make a selection
start the new MTA and enable boot-time startup
Graphical interface: system-switch-mail-gnome package
顯示當前使用的MTA
[root@station10 ~]# alternatives --display mta
mta - status is auto.
link currently points to /usr/sbin/sendmail.sendmail
/usr/sbin/sendmail.sendmail - priority 90
slave mta-mailq: /usr/bin/mailq.sendmail
slave mta-newaliases: /usr/bin/newaliases.sendmail
slave mta-rmail: /usr/bin/rmail.sendmail
slave mta-sendmail: /usr/lib/sendmail.sendmail
slave mta-pam: /etc/pam.d/smtp.sendmail
slave mta-sendmailman: /usr/share/man/man8/sendmail.sendmail.8.gz
slave mta-mailqman: /usr/share/man/man1/mailq.sendmail.1.gz
slave mta-newaliasesman: /usr/share/man/man1/newaliases.sendmail.1.gz
slave mta-aliasesman: /usr/share/man/man5/aliases.sendmail.5.gz
Current `best' version is /usr/sbin/sendmail.sendmail.
[root@station10 ~]#
當前只安裝了sendmail,所以當前的mta是sendmail,安裝postfix後繼續檢視
[root@station10 ~]# yum install -y postfix
繼續檢視當前使用的MTA:
[root@station10 ~]# alternatives --display mta
mta - status is auto.
link currently points to /usr/sbin/sendmail.sendmail
/usr/sbin/sendmail.sendmail - priority 90
slave mta-pam: /etc/pam.d/smtp.sendmail
slave mta-mailq: /usr/bin/mailq.sendmail
slave mta-newaliases: /usr/bin/newaliases.sendmail
slave mta-rmail: /usr/bin/rmail.sendmail
slave mta-sendmail: /usr/lib/sendmail.sendmail
slave mta-mailqman: /usr/share/man/man1/mailq.sendmail.1.gz
slave mta-newaliasesman: /usr/share/man/man1/newaliases.sendmail.1.gz
slave mta-aliasesman: /usr/share/man/man5/aliases.sendmail.5.gz
slave mta-sendmailman: /usr/share/man/man8/sendmail.sendmail.8.gz
/usr/sbin/sendmail.postfix - priority 30
slave mta-pam: /etc/pam.d/smtp.postfix
slave mta-mailq: /usr/bin/mailq.postfix
slave mta-newaliases: /usr/bin/newaliases.postfix
slave mta-rmail: /usr/bin/rmail.postfix
slave mta-sendmail: /usr/lib/sendmail.postfix
slave mta-mailqman: /usr/share/man/man1/mailq.postfix.1.gz
slave mta-newaliasesman: /usr/share/man/man1/newaliases.postfix.1.gz
slave mta-aliasesman: /usr/share/man/man5/aliases.postfix.5.gz
slave mta-sendmailman: /usr/share/man/man1/sendmail.postfix.1.gz
Current `best' version is /usr/sbin/sendmail.sendmail.
[root@station10 ~]#
具體切換步驟:
1,停止當前使用的mta
[root@station10 ~]# /etc/init.d/sendmail stop
Shutting down sm-client: [ OK ]
Shutting down sendmail: [ OK ]
[root@station10 ~]#
2,設定系統啟動的時候不啟動:
[root@station10 ~]# chkconfig sendmail off
3,配置mta
[root@station10 ~]# 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: 2
[root@station10 ~]#
或者:
alternatives --set mta /usr/sbin/sendmail.postfix
圖形切換工具:system-switch-mail
4,啟動另外一個mta
[root@station10 ~]# service postfix status
master is stopped
[root@station10 ~]# service postfix start
Starting postfix: [ OK ]
[root@station10 ~]#
5,配置啟動系統的時候預設啟動服務
[root@station10 ~]# chkconfig postfix on
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/312079/viewspace-1012210/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- update-alternatives 使用詳解
- alternatives命令用法
- js switch 使用JS
- 【轉】使用alternatives,自由切換linux的jdk版本LinuxJDK
- 【教程】手把手教你使用 MTA 視覺化埋點視覺化
- pyttsx3 and its alternativesTTS
- 使用 "switch(ture)" 代替大量if
- 使用 "switch(true)" 代替大量if
- Ask DevOps: Top 5 Business Alternatives to Splunkdev
- switch選擇結構使用
- [JAVA] Java switch的使用細節Java
- Golang switch case 的使用注意點Golang
- SAP BTP MTA 應用的應用場景
- iOS-字典+block代替switch-(解決switch不能使用NSString)iOSBloC
- python如何使用字典實現switchPython
- SAP BTP MTA 應用解決的架構痛點架構
- update-alternatives符號連線的層數過多符號
- 使用列舉ENUM替換Switch或If-Else
- session switchSession
- SAP MTA 裡定義 SAP UI5 module 的一個例子UI
- js 學習之路7:switch/case語句的使用JS
- js使用物件代替if和switch流程控制語句JS物件
- rman恢復 使用switch映像副本進行恢復
- SVG <switch>元素SVG
- Java switch caseJava
- log file switch
- Go之旅-SwitchGo
- switch default 作用
- java之switchJava
- switch omega - VNP
- how to switch workspace
- Dataguard mode switch
- 三層switch轉一層switch的處理方法
- 『Java 語法基礎』能在 Switch 中使用 String 嗎?Java
- GamesIndustry:Switch OLED上週佔英國Switch總銷量的70%GAM
- MTA天漠音樂節樂迷現場體驗Geek智慧吉他魅力
- 利用反射代替switch反射
- JavaScript switch 語句JavaScript