日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

postfix+squirrelmail - rhat 5.4

發(fā)布時(shí)間:2024/4/11 编程问答 33 豆豆
生活随笔 收集整理的這篇文章主要介紹了 postfix+squirrelmail - rhat 5.4 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

系統(tǒng)環(huán)境:

安裝郵件服務(wù)器,postfix+squirrelmail+rhat 5.4下測(cè)試,本實(shí)驗(yàn)?zāi)康氖?#xff0c;在服務(wù)器與客戶(hù)端之間相互收發(fā)郵件和轉(zhuǎn)發(fā)郵件;

?

??統(tǒng)

??

服務(wù)器

客戶(hù)端

RedHat 5.4

mail.163.com

172.16.1.253

172.16.1.10

所需安裝包:

bind? (DNS)

postfix(郵件服務(wù)器)

DovecotPOP/IMAP協(xié)議,用于接受郵件)

Saslauthd(安全認(rèn)證包)

Squirrelmail(基于web的郵件客戶(hù)端)

1、配置IP

2、配置主機(jī)名:mail.163.com

[root@localhost ~]# vim /etc/sysconfig/network

HOSTNAME=mail.163.com

:wq? 保存

[root@localhost ~]# hostname mail.163.com

斷開(kāi)終端,再次連接,這樣就需要重新啟動(dòng)系統(tǒng):ctrl+d

[root@mail ~]#

?

3、配置DNS文件

[root@mail ~]# vim /etc/resolv.conf

nameserver 172.16.1.253

?

4、配置hosts文件

[root@mail ~]# vim /etc/hosts?

127.0.0.1?????? mail.163.com

?

5、配置YUM

參照:

http://yanghuawu.blog.51cto.com/2638960/886129

6、安裝DNS(bind)

[root@mail ~]# cd /mnt/Server/

[root@mail Server]# rpm -ivh bind-9.3.6-4.P1.el5.i386.rpm?????

Preparing...??????????????? ########################################### [100%]

?? 1:bind?????????????????? ########################################### [100%]

[root@mail Server]# rpm -ivh bind-chroot-9.3.6-4.P1.el5.i386.rpm

Preparing...?????????????? ?########################################### [100%]

?? 1:bind-chroot??????????? ########################################### [100%]? ???

[root@mail Server]# rpm -ivh caching-nameserver-9.3.6-4.P1.el5.i386.rpm

Preparing...??????????????? ########################################### [100%]

?? 1:caching-nameserver???? ########################################### [100%]??

?

[root@mail Server]# cd /var/named/chroot/etc/

[root@mail etc]# ll

total 32

-rw-r--r-- 1 root root?? 405 Dec 18 05:13 localtime

-rw-r----- 1 root named 1230 Jul 30? 2009 named.caching-nameserver.conf

-rw-r----- 1 root named? 955 Jul 30? 2009 named.rfc1912.zones

-rw-r----- 1 root named? 113 Dec 18 05:48 rndc.key

?

[root@mail etc]# cp -p named.caching-nameserver.conf named.conf

[root@mail etc]# vim named.conf????

修改:

?15???????? listen-on port 53 { any; };

?27???????? allow-query???? { any; };

?28???????? allow-query-cache { any; };

?37???????? match-clients????? { any; };

?38???????? match-destinations { any; };

wq

?

[root@mail etc]# vim named.rfc1912.zones??

?27 zone "163.com" IN {

?28???????? type master;

?29???????? file "163.com.zone";

?30???????? allow-update { none; };

?31 };

:wq

?

[root@mail etc]# cd ../var/named/

[root@mail named]# pwd

/var/named/chroot/var/named

[root@mail named]# cp -p localhost.zone 163.com.zone

[root@mail named]# vim 163.com.zone

$TTL??? 86400

@?????????????? IN SOA? ns.163.com.?????? root (

??????????????????????????????????????? 42????????????? ; serial (d. adams)

????????????????????? ??????????????????3H????????????? ; refresh

??????????????????????????????????????? 15M???????????? ; retry

??????????????????????????????????????? 1W????????????? ; expiry

????????????????????????????????? ??????1D )??????????? ; minimum

??????????????? IN NS?????????? ns.163.com.

ns????????????? IN A??????????? 172.16.1.253

mail??????????? IN A??????????? 172.16.1.253

pop3??????????? IN CNAME??????? mail

smtp??????????? IN CNAME??????? mail

@?????????????? IN MX 10??????? mail

:wq

?

[root@mail named]# service named start

Starting named:??????????????????????????????????????????? [? OK? ]

[root@mail named]# service named restart

Stopping named:??????????????????????????????????????????? [? OK? ]

Starting named:????????????????????????????? ??????????????[? OK? ]

[root@mail named]#

?

[root@mail named]# rndc reload

server reload successful

[root@mail named]# dig -t mx 163.com

; <<>> DiG 9.3.6-P1-RedHat-9.3.6-4.P1.el5 <<>> -t mx 163.com

;; global options:? printcmd

;; Got answer:

;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 10922

;; flags: qr aa rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 2

;; QUESTION SECTION:

;163.com.? ?????????????????????IN????? MX

;; ANSWER SECTION:

163.com.??????????????? 86400?? IN????? MX????? 10 mail.163.com.

;; AUTHORITY SECTION:

163.com.??????????????? 86400?? IN????? NS????? ns.163.com.

;; ADDITIONAL SECTION:

mail.163.com.?????????? 86400?? IN????? A?????? 172.16.1.253

ns.163.com.??????????? ?86400?? IN????? A?????? 172.16.1.253

?

;; Query time: 5 msec

;; SERVER: 172.16.1.253#53(172.16.1.253)

;; WHEN: Tue Dec 18 06:12:41 2012

;; MSG SIZE? rcvd: 95

?

[root@mail named]# chkconfig named on

?

確認(rèn)sendmail是否已關(guān)閉,并不隨機(jī)啟動(dòng)或者卸載

[root@mail named]# service sendmail status

sendmail (pid? 2754) is running...

[root@mail named]# service sendmail stop

Shutting down sm-client:?????????????????????????????????? [? OK? ]

Shutting down sendmail:??????????????????????????????????? [? OK? ]

[root@mail named]# chkconfig sendmail off

[root@mail named]#

?

7、安裝postfix

[root@mail named]# cd /mnt/Server/

[root@mail Server]# ll postfix*

-r--r--r-- 278 root root 3734257 Aug 14? 2008 postfix-2.3.3-2.1.el5_2.i386.rpm

-r--r--r-- 278 root root?? 51012 Aug 14? 2008 postfix-pflogsumm-2.3.3-2.1.el5_2.i386.rpm

[root@mail Server]# rpm -ivh postfix-2.3.3-2.1.el5_2.i386.rpm

Preparing...??????????????? ########################################### [100%]

?? 1:postfix???????????? ???########################################### [100%]

[root@mail Server]# vim /etc/postfix/main.cf

69 #myhostname = host.domain.tld

修改

69 myhostname = mail.163.com? #本機(jī)名

?

77 #mydomain = domain.tld???

修改:

77 mydomain = 163.com???????? #域名

?

93 #myorigin = $mydomain

修改為

93 myorigin = $mydomain

?

107 #inet_interfaces = all

修改為

107 inet_interfaces = all

?

110 inet_interfaces = localhost

修改為

110 #inet_interfaces = localhost

?

155 mydestination = $myhostname, localhost.$mydomain, localhost

修改為

155 #mydestination = $myhostname, localhost.$mydomain, localhost

?

156 #mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

修改為

156 mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain

?

255 #mynetworks = 168.100.189.0/28, 127.0.0.0/8

修改為

255 mynetworks = 127.0.0.0/8???? #提供郵件轉(zhuǎn)發(fā)功能的網(wǎng)段

?

255 mynetworks = 127.0.0.0/8上面添加如下:#使用SMTP認(rèn)證

broken_sasl_auth_clients = yes

smtpd_sasl_auth_enable = yes

smtpd_sasl_security_options = noanonymous

smtpd_sasl_application_name = smtpd

smtpd_client_restrictions = permit_sasl_authenticated,reject

#smtpd_clietn_restrictions = permit_sasl_authenticated

smtpd_recipient_restrictions = permit_mynetworks,permit_sasl_authenticated, reject_unauth_destination

262 mynetworks = 127.0.0.0/8

:wq

?

[root@mail Server]# service saslauthd start

Starting saslauthd:??????????????????????????????????????? [? OK? ]

[root@mail Server]# chkconfig saslauthd? on

[root@mail Server]# service postfix start

Starting postfix:????????????????????????????????????????? [? OK? ]

[root@mail Server]# service postfix restart

Shutting down postfix:???????????????????????????????????? [? OK? ]

Starting postfix:????????????????????????????????????????? [? OK? ]

?

[root@mail Server]# netstat -tupln |less

tcp??? 0?? 0 0.0.0.0:25??? 0.0.0.0:*?? LISTEN??? 4235/master

?

8、創(chuàng)建用戶(hù)

[root@mail Server]# useradd user1

[root@mail Server]# useradd user2

[root@mail Server]# useradd user3

[root@mail Server]# passwd user1

Changing password for user user1.

New UNIX password:

BAD PASSWORD: it does not contain enough DIFFERENT characters

Retype new UNIX password:

passwd: all authentication tokens updated successfully.

[root@mail Server]# passwd user2

Changing password for user user2.

New UNIX password:

BAD PASSWORD: it does not contain enough DIFFERENT characters

Retype new UNIX password:

passwd: all authentication tokens updated successfully.

[root@mail Server]# passwd user3

Changing password for user user3.

New UNIX password:

BAD PASSWORD: it does not contain enough DIFFERENT characters

Retype new UNIX password:

passwd: all authentication tokens updated successfully.

?

9、安裝squirrelmail(圖形化郵件客戶(hù)端)

[root@mail Server]# yum install squirrelmail

?

[root@mail Server]# service httpd restart

Stopping httpd:????????????????????????????????????????? ??[? OK? ]

Starting httpd: httpd: Could not reliably determine the server's fully qualified domain name, using mail.163.com for ServerName

?????????????????????????????????????????????????????????? [? OK? ]

[root@mail Server]# chkconfig httpd on

[root@mail Server]# rpm -ql squirrelmail

[root@mail Server]# cd /var/www/html/

[root@mail html]# ln -s /usr/share/squirrelmail/ mail

[root@mail html]# ll

total 4

lrwxrwxrwx 1 root root 24 Dec 18 06:46 mail -> /usr/share/squirrelmail/

[root@mail html]# cd mail/

[root@mail mail]# ll

total 88

drwxr-xr-x? 5 root root 4096 Dec 18 06:42 class

drwxr-xr-x? 2 root root 4096 Dec 18 06:42 config

drwxr-xr-x? 4 root root 4096 Dec 18 06:42 functions

drwxr-xr-x 30 root root 4096 Dec 18 06:42 help

drwxr-xr-x? 2 root root 4096 Dec 18 06:42 p_w_picpaths

drwxr-xr-x? 3 root root 4096 Dec 18 06:42 include

-rw-r--r--? 1 root root? 684 May 21? 2009 index.php

drwxr-xr-x 47 root root 4096 Dec 18 06:42 locale

drwxr-xr-x 18 root root 4096 Dec 18 06:42 plugins

drwxr-xr-x? 2 root root 4096 Dec 18 06:42 src

drwxr-xr-x? 3 root root 4096 Dec 18 06:42 themes

[root@mail mail]# cd config/

[root@mail config]# ll

total 204

-rw-r--r-- 1 root root? 29548 May 21? 2009 config_default.php

lrwxrwxrwx 1 root root???? 45 Dec 18 06:42 config_local.php -> ../../../../etc/squirrelmail/config_local.php

lrwxrwxrwx 1 root root???? 39 Dec 18 06:42 config.php -> ../../../../etc/squirrelmail/config.php

-rwxr-xr-x 1 root root 145648 May 21? 2009 conf.pl

-rw-r--r-- 1 root root??? 492 May 21? 2009 index.php

?

打開(kāi)squirrelmail配置工具

[root@mail config]# ./conf.pl [root@mail ~]# /usr/share/squirrelmail/config/conf.pl

SquirrelMail Configuration : Read: config.php (1.4.0)

---------------------------------------------------------

Main Menu --

1.? Organization Preferences

2.? Server Settings

3.? Folder Defaults

4.? General Options

5.? Themes

6.? Address Books

7.? Message of the Day (MOTD)

8.? Plugins

9.? Database

10. Languages

?

D.? Set pre-defined settings for specific IMAP servers

C?? Turn color off

S?? Save data

Q?? Quit

?

Command >> 10

?

????? 輸入d,然后輸入cyrus(指定IMAP服務(wù)器類(lèi)型)

????? 輸入2.? 選擇Server Settings然后輸入1修改Domainmail.163.com

???????????????????????????????????????? 3修改Sendmail or SMTP為選2--SMTP

????? 輸入4.? 選擇General Options然后輸入5修改Usernames in Lowercase : true

????? 輸入10? 選擇Languages然后輸入1修改Default Language : zh_CN

?????????????????????????????????? 2修改Default charset? : GB2312??

?????????????????????????????????? R返回上一層????

????? 最后輸入s保存以上修改,再輸入q退出(修改的文件同時(shí)保存)

?

[root@mail config]# vim /etc/httpd/conf/httpd.conf

747 AddDefaultCharset UTF-8

修改為:

747 #AddDefaultCharset UTF-8

:wq

[root@mail config]# service httpd restart

?

10、網(wǎng)頁(yè)訪問(wèn):http://172.16.1.253/mail

用戶(hù)登陸報(bào)錯(cuò)

系統(tǒng)出錯(cuò)

連接IMAP服務(wù)器出現(xiàn)錯(cuò)誤:localhost

111 : 鎷掔粷榪炴帴

解決方法

[root@mail config]# yum install dovecot??? #用于接受郵件

[root@mail config]# service dovecot restart

重新登錄:OK

?

發(fā)郵件報(bào)錯(cuò)

系統(tǒng)出錯(cuò):

Transaction failed

Server replied: 554 5.7.1 <localhost.localdomain[127.0.0.1]>: Client host rejected: Access denied

解決方法:

[root@mail config]# vim /etc/postfix/main.cf

smtpd_client_restrictions = permit_sasl_authenticated,reject

修改為

#smtpd_client_restrictions = permit_sasl_authenticated,reject

:wq

[root@mail config]# service postfix restart

?

11、查看收發(fā)郵件日志

[root@mail config]# tail -f /var/log/maillog

?

收發(fā)郵件成功!

轉(zhuǎn)載于:https://blog.51cto.com/yanghuawu/1092891

總結(jié)

以上是生活随笔為你收集整理的postfix+squirrelmail - rhat 5.4的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。