簡單配置PostFix伺服器
安裝包:
[root@rhel6-1 named]# yum install postfix telnet
[root@rhel6-1 named]# yum install bind bind-chroot
配置DNS伺服器
[root@rhel6-1 named]# vi /etc/named.conf
options {
listen-on port 53 { any; };
listen-on-v6 port 53 { ::1; };
directory "/var/named";
dump-file "/var/named/data/cache_dump.db";
statistics-file "/var/named/data/named_stats.txt";
memstatistics-file "/var/named/data/named_mem_stats.txt";
allow-query { any; };
recursion yes;
dnssec-enable yes;
dnssec-validation yes;
dnssec-lookaside auto;
/* Path to ISC DLV key */
bindkeys-file "/etc/named.iscdlv.key";
};
logging {
channel default_debug {
file "data/named.run";
severity dynamic;
};
};
zone "." IN {
type hint;
file "named.ca";
};
include "/etc/named.rfc1912.zones";
[root@rhel6-1 named]# vi /etc/named.rfc1912.zones
新增
zone "testmail.com" IN {
type master;
file "named.testmail.com";
allow-update { none; };
};
[root@rhel6-1 named]# cp /var/named/named.localhost /var/named/chroot/var/named/named.testmail.com
[root@rhel6-1 named]# cat /var/named/chroot/var/named/named.testmail.com
$TTL 1D
@ IN SOA @ root (
0 ; serial
1D ; refresh
1H ; retry
1W ; expire
3H ) ; minimum
NS @
A 127.0.0.1
AAAA ::1
mail.testmail.com. IN A 192.168.1.11
testmail.com. MX 10 mail.testmail.com.
[root@rhel6-1 named]# service named restart
Stopping named: . [ OK ]
Starting named: [ OK ]
修改postfix的配置檔案
[root@rhel6-1 named]# vi /etc/postfix/main.cf
修改以下引數
myhostname = mail.testmail.com
mydomain = testmail.com
myorigin = $mydomain
inet_interfaces = all
inet_protocols = all
mydestination = $myhostname, localhost.$mydomain, localhost, $mydomain
mynetworks = 192.168.1.0/24, 127.0.0.0/8
relay_domains = $mydestination
[root@rhel6-1 ~]# service postfix restart
Shutting down postfix: [ OK ]
Starting postfix: [ OK ]
[root@rhel6-1 ~]# useradd test001
[root@rhel6-1 ~]# useradd test002
傳送郵件
[root@rhel6-1 named]# telnet 192.168.1.11 25
Trying 192.168.1.11...
Connected to 192.168.1.11.
Escape character is '^]'.
220 mail.testmail.com ESMTP Postfix
mail from:test001@testmail.com
250 2.1.0 Ok
rcpt to:test002@testmail.com
250 2.1.5 Ok
data
354 End data with
hello test002!!!
.
250 2.0.0 Ok: queued as 12623A0059
quit
221 2.0.0 Bye
Connection closed by foreign host.
接收郵件
[root@rhel6-1 named]# su - test002
[test002@rhel6-1 ~]$ mail
Heirloom Mail version 12.4 7/29/08. Type ? for help.
"/var/spool/mail/test002": 2 messages 1 new
1 test001@rhel6-1.doma Mon Oct 13 02:53 15/517
>N 2 test001@testmail.com Mon Oct 13 05:37 14/507
& r
undisclosed-recipients:; contains invalid character ':'
To: test001@testmail.comtest001@testmail.com wrote:
> hello test002!!!
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/29320885/viewspace-1298567/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Linux伺服器---郵件服務postfix配置Linux伺服器
- 伺服器簡單郵箱配置伺服器
- 如何在CentOS中安裝和配置Postfix郵件伺服器CentOS伺服器
- 如何在 CentOS 8 上安裝和配置 Postfix 郵件伺服器CentOS伺服器
- Centos 7 搭建postfix郵件伺服器CentOS伺服器
- Webapck 簡單配置Web
- Linux伺服器---郵件服務postfix安裝Linux伺服器
- Centos Linux 7 搭建郵件伺服器(postfix + dovecot)CentOSLinux伺服器
- VS code 簡單配置
- logback的簡單配置
- spingMVC框架簡單配置MVC框架
- Linux伺服器配置——簡介Linux伺服器
- 簡單的零配置命令http伺服器:http-server入門HTTP伺服器Server
- Web Scraper簡單配置方法Web
- webpack(簡單安裝配置)Web
- 一個簡單多庫配置
- 交換機的簡單配置
- node webpack4.6簡單配置Web
- Linux下簡單部署伺服器Linux伺服器
- 伺服器系統簡單分析伺服器
- 最簡單的 Git 伺服器Git伺服器
- 一個簡單vue.config.js配置和axios簡單封裝VueJSiOS封裝
- Elasticsearch 的安裝和簡單配置Elasticsearch
- Django安裝與簡單配置(1)Django
- CentOS 7 以上防火牆簡單配置CentOS防火牆
- Spring Cloud Gateway + Nacos(1)簡單配置SpringCloudGateway
- Java 18中簡單 Web 伺服器JavaWeb伺服器
- 簡單瞭解高防伺服器伺服器
- postfix 發信錯誤
- RHLE5+Postfix+OpenwebmailWebAI
- 配置中心之Nacos簡介,使用及Go簡單整合Go
- Mybatis【配置檔案】就是這麼簡單MyBatis
- 把玩Alpine linux(三):簡單手動配置Linux
- webpack4簡單實用配置解析Web
- 簡單說說webpack的配置檔案Web
- log4j簡單配置解釋
- Ubuntu-kali配置動態ip(簡單)Ubuntu
- 01 . SaltStack部署配置及簡單應用
- 從一份配置清單詳解Nginx伺服器配置Nginx伺服器