1、安装postfix邮件服务器

yum -y install postfix*  //安装邮件发送服务器
yum -y install dovecot*  //安装邮件接受服务器


2、邮件服务器的配置

修改postfix的配置  vi /etc/postfix/main.cf  下面是一些修改的

myhostname = mail.g.cn
mydomain = g.cn  //邮件的后缀

myorigin = $myhostname
myorigin = $mydomain

inet_interfaces = all
#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
#inet_interfaces = localhost

mydestination = $myhostname,$mydomain

mynetworks = 192.168.0.0/24, 127.0.0.0/8
#mynetworks = $config_directory/mynetworks
#mynetworks = hash:/etc/postfix/network_table

relay_domains = $mydestination


修改dovecot的配置  vi /etc/dovecot.conf

protocols = imap imaps pop3 pop3s

3、重启邮件服务器和自启动

service postfix restart
service dovecot restart

chkconfig postfix on
chkconfig dovecot on
chkconfig --list postfix

修改邮件默认服务器:alternatives --config mta
选着2,即postfix

4、添加邮件用户

useradd user1
passwd user1

这样系统就添加了user1@g.cn的邮件帐号

5、发邮件
echo "root->user1" |mail user1@g.cn -s "test"  //root@g.cn发给user1@g.cn的邮件

6、windows·收发邮件

使用windows自带的邮件客户端来收发,只需要配置相应的发送和接受邮件服务器的IP地址就OK了。



相关文章:

  • 2022-01-31
  • 2021-10-17
  • 2021-12-04
  • 2021-12-30
  • 2021-09-21
猜你喜欢
  • 2021-12-04
  • 2021-04-29
  • 2021-08-13
  • 2022-12-23
  • 2021-12-06
  • 2022-12-23
  • 2021-12-21
相关资源
相似解决方案