linux下Postfix郵件服務的安裝過程和基本配置

來源:互聯網
上載者:User

一、postfix郵件服務的安裝

Red Hat Enterprise Linux 提供了sendmail和postfix兩種STMP郵件服務軟體,讓使用者可以隨意地選擇其中一種!不過,預設情況下安裝程式已將sendmail安裝到系統中了,如果要使用postfix,就必須先將sendmail服務停止,然後再安裝postfix服務軟體。具體操作步驟如下:

1).檢查sendmail服務是否已啟動

[root@mail ~]#netstat -nutlp | grep :25

2>. 關閉sendmail服務及開機時自啟動

[root@mail ~]#/etc/rc.d/init.d/sendmail stop

[root@mail ~]#chkconfig sendmail off

3>.安裝postfix服務

將Red Hat Enterprise Linux 5的第3張安裝盤放入光碟機,載入光碟機後在光碟片的Server目錄下找到postfix的RPM安裝包檔案postfix-2.3.3-2.i386.rpm,然後使用

下面rpm安裝:

[root@mail ~]#rpm -ivh /mnt/Server/postfix-2.3.3-2.i386.rpm

源碼包安裝:

[root@mail ~]# groupadd -g 1000 postfix

[root@mail ~]# useradd -M -u 1000 -g postfix -G postdrop -s /sbin/nologin postfix

[root@mail ~]# groupadd -g 1200 postdrop

[root@mail ~]# tar zxvf postfix-2.6.2.tar.gz

[root@mail ~]#gunzip postfix-2.6.2-vda-ng.patch.gz

[root@mail ~]# cd postfix-2.6.2

[root@mail postfix-2.6.2]#patch -pl < ../postfix-2.6.2-vda-ng.patch

[root@mail postfix-2.6.2]#make makefiles \`CCARGS=-DHAS_MYSQL -I/usr/local/mysql/include/mysql -DUSE_SASL_AUTH -DUSE_CYRUS_SASL -I/usr/local/include/sasl -I/usr/local/BerkeleyDB/include -DUSE_TLS -I/usr/local/ssl/include/openssl ' 'AUXLIBS=-L/usr/local/mysql/lib/mysql -lmysqlclient -lz -lm -L/usr/local/lib -lsasl2 -L/usr/local/BerkeleyDB/lib -L/usr/local/ssl/lib -lssl -lcrypto'

其中,編譯參數CCARGS和AUXLIBS的作用如下:

CCARGS參數:為編譯器提供額外的參數。“-I”選項指出標準的額外標頭檔的存放目錄。例如,mysql和cyrus-sasl的標頭檔分別位於目錄:/usr/local/mysql/lib/mysql、/usr/include/sasl.

AUXLIBS參數:指出位於標準位置之外的額外函數庫。如果需要連結SASL、MySQL或任何附加的函數庫,而且他們不是存在標準位置(/usr/lib目錄),則必須在AUXLIBS參數中指出這些函數庫的路徑,例如,mysql和cyrus-sasl的庫檔案分別位於目錄:/usr/local/mysql/lib/mysql、/usr/lib/sasl2。

[root@mail postfix-2.6.2]# make

[root@mail postfix-2.6.2]# make install

執行“make install”命令以後,期間會需要設定一些安裝參數,

按照以下的提示輸入相關的路徑([]號中的是預設值,”]”後的是輸入值)

install_root: [/] /

tempdir: [/root/postfix-2.6.2]

config_directory: [/etc/postfix]

daemon_directory: [/usr/libexec/postfix]

command_directory: [/usr/sbin]

queue_directory: [/var/spool/postfix]

sendmail_path: [/usr/sbin/sendmail]

newaliases_path: [/usr/bin/newaliases]

mailq_path: [/usr/bin/mailq]

mail_owner: [postfix]

setgid_group: [postdrop]

html_directory: [no]

manpages: [/usr/local/man]

readme_directory: [no]

以上做完斷行符號鍵,預設自動識別設定。postfix的編譯安裝成功!

本文URL地址:http://www.bianceng.cn/OS/Linux/201410/45499.htm

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.