当前位置:网站首页>简单配置PostFix服务器
简单配置PostFix服务器
2022-07-03 16:58:00 【星哥玩云】
安装包:
[[email protected] named]# yum install postfix telnet
[[email protected] named]# yum install bind bind-chroot
配置DNS服务器
[[email protected] 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";
[[email protected] named]# vi /etc/named.rfc1912.zones
添加
zone "testmail.com" IN {
type master;
file "named.testmail.com";
allow-update { none; };
};
[[email protected] named]# cp /var/named/named.localhost /var/named/chroot/var/named/named.testmail.com
[[email protected] 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.
[[email protected] named]# service named restart
Stopping named: . [ OK ]
Starting named: [ OK ]
修改postfix的配置文件
[[email protected] 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,
mynetworks = 192.168.1.0/24, 127.0.0.0/8
relay_domains = $mydestination
[[email protected] ~]# service postfix restart
Shutting down postfix: [ OK ]
Starting postfix: [ OK ]
[[email protected] ~]# useradd test001
[[email protected] ~]# useradd test002
发送邮件
[[email protected] 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:t[email protected]
250 2.1.0 Ok
rcpt to:[email protected]
250 2.1.5 Ok
data
354 End data with <CR><LF>.<CR><LF>
hello test002!!!
.
250 2.0.0 Ok: queued as 12623A0059
quit
221 2.0.0 Bye
Connection closed by foreign host.
接收邮件
[[email protected] named]# su - test002
[[email protected] ~]$ mail
Heirloom Mail version 12.4 7/29/08. Type ? for help.
"/var/spool/mail/test002": 2 messages 1 new
1 [email protected] Mon Oct 13 02:53 15/517
>N 2 [email protected] Mon Oct 13 05:37 14/507
& r
undisclosed-recipients:; contains invalid character ':'
To: [email protected]@testmail.com wrote:
> hello test002!!!
边栏推荐
- word 退格键删除不了选中文本,只能按delete
- Preventing/catching “IllegalArgumentException: parameter must be a descendant of this view” error
- [combinatorial mathematics] counting model, common combinatorial numbers and combinatorial identities**
- mysql用户管理
- 匯編實例解析--實模式下屏幕顯示
- What material is sa537cl1? Sa537cl1 corresponds to the national standard material
- On Lagrange interpolation and its application
- Kotlin学习快速入门(7)——扩展的妙用
- C language string inversion
- Hands on in-depth learning notes (XIV) 3.7 Simple implementation of softmax regression
猜你喜欢
Redis:关于列表List类型数据的操作命令
To resist 7-Zip, list "three sins"? Netizen: "is the third key?"
What material is sa537cl1? Sa537cl1 corresponds to the national standard material
CC2530 common registers for serial communication
Bcvp developer community 2022 exclusive peripheral first bullet
Meituan side: why does thread crash not cause JVM crash
29:第三章:开发通行证服务:12:开发【获得用户账户信息,接口】;(使用VO类包装查到的数据,以符合接口对返回数据的要求)(在多处都会用到的逻辑,在Controller中可以把其抽成一个共用方法)
2022.02.14_ Daily question leetcode five hundred and forty
Build your own website (23)
大消费企业怎样做数字化转型?
随机推荐
在iptables防火墙下开启vsftpd的端口
Web crawler knowledge day03
What is the maximum number of concurrent TCP connections for a server? 65535?
What is the material of sa302grc? American standard container plate sa302grc chemical composition
[combinatorics] recursive equation (the relationship theorem between the solution of the recursive equation and the characteristic root | the linear property theorem of the solution of the recursive e
大变局!全国房价,跌破万元大关
汇编实例解析--实模式下屏幕显示
Zebras are recognized as dogs, and Stanford found the reason why AI made mistakes
CC2530 common registers for serial communication
NLP four paradigms: paradigm 1: fully supervised learning in the era of non neural networks (Feature Engineering); Paradigm 2: fully supervised learning based on neural network (Architecture Engineeri
Meituan side: why does thread crash not cause JVM crash
PHP converts a one-dimensional array into a two-dimensional array
Shentong express expects an annual loss of nearly 1billion
网络安全web渗透技术
比亚迪、长城混动市场再“聚首”
Processing strategy of message queue message loss and repeated message sending
[Jianzhi offer] 64 Find 1+2+... +n
Idea configuration plug-in
MySQL Basics
远程办公之如何推进跨部门项目协作 | 社区征文