Postfix 邮件服务器安装与配置

简介: #!/bin/bashyum -y install postfix dovecot;#/etc/postfix/main.cf#postfix check  postfix start  postfix stop postfix flush  postfixreload#/etc/postfix/main.

#!/bin/bash

yum -y install postfix dovecot;

#/etc/postfix/main.cf

#postfix check  postfix start  postfix stop postfix flush  postfixreload

#/etc/postfix/main.cf

中,行首不可以空白,=号两边都要空白

myhostname = centos7test5

myorigin = $myhostname

inet_interfaces = all

inet_protocols = ipv4

mydestination = $myhostname

mynetworks_style = host

mynetworks = 127.0.0.0/8,192.168.10.0/24,192.168.100.0/24

###

postfix check

#/etc/postfix/access

192.168.10.0 OK

.edu.tw      OK

av.com       REJECT

192.168.2.   REJECT

postmap hash:/etc/postfix/access

#/etc/aliases

root:    root,dmtsai

students: std1,std2,std3,std4

postalias hash:/etc/aliases

####

postqueue -p

#####################################pop3

/etc/dovecot/dovecot.conf

protocols = imap pop3

/etc/dovecot/conf.d/10-ssl.conf

ssl = no

dovecot start

##pop3s

cd /etc/pki/tls/certs/

make mydovecot.pem

vim /etc/dovecot/conf.d/10-auth.conf

disable_plaintext_auth = yes

vim /etc/dovecot/conf.d/10-ssl.conf

ssl = required

ssl_cert =

ssl_key =

vim /etc/dovecot/conf.d/10-master.conf

inet_listener imap {

port = 0

}

inet_listener pop3 {

port = 0

}

vim /etc/dovecot/conf.d/10-mail.conf

mail_location = mbox:~/mail:INBOX=/var/mail/%u

dovecot restart

#################################

yum install -y mailx sharutils mutt

uuencode

附件 邮件名| mail -s 'test' root

mutt -a

附件 -i 内容文件 -s 标题E-mail

#

邮件过滤软件postgrey

########################mail

发送邮件设置

vim /etc/mail.rc

文件尾增加以下内容

set from=1968089885@qq.com smtp="smtp.qq.com"

set smtp-auth-user="1968089885@qq.com"smtp-auth-password="123456"

set smtp-auth=login

说明:

from:

对方收到邮件时显示的发件人

smtp:

指定第三方发送邮件的smtp服务器地址

smtp-auth: SMTP

的认证方式。默认是LOGIN,也可改为CRAM-MD5或PLAIN方式

smtp-auth-user:

第三方发邮件的用户名

smtp-auth-password:

用户名对应密码

目录
相关文章
|
7月前
|
弹性计算 ice
阿里云4核8G云服务器配置价格:热门ECS实例及CPU处理器型号说明
阿里云2025年4核8G服务器配置价格汇总,涵盖经济型e实例、计算型c9i等热门ECS实例,CPU含Intel Xeon及AMD EPYC系列,月费159元起,年付低至1578元,按小时计费0.45元起,实际购买享折扣优惠。
2789 1
|
7月前
|
Shell Linux 网络安全
宝塔服务器面板部署安装git通过第三方应用安装收费怎么办—bash: git: command not found解决方案-优雅草卓伊凡
宝塔服务器面板部署安装git通过第三方应用安装收费怎么办—bash: git: command not found解决方案-优雅草卓伊凡
1333 3
宝塔服务器面板部署安装git通过第三方应用安装收费怎么办—bash: git: command not found解决方案-优雅草卓伊凡
|
7月前
|
弹性计算 定位技术 数据中心
阿里云服务器配置选择方法:付费类型、地域及CPU内存配置全解析
阿里云服务器怎么选?2025最新指南:就近选择地域,降低延迟;长期使用选包年包月,短期灵活选按量付费;企业选2核4G5M仅199元/年,个人选2核2G3M低至99元/年,高性价比爆款推荐,轻松上云。
872 11
|
7月前
|
存储 弹性计算 网络协议
超详细的阿里云服务器购买流程,ECS自定义购买配置教程
本文详细图解阿里云ECS服务器自定义购买全流程,涵盖付费模式、地域选择、网络配置、实例规格、镜像、存储、安全组及登录设置等核心步骤,助您轻松掌握专业级云服务器搭建方法。
|
7月前
|
存储 弹性计算 监控
阿里云渠道商:如何挑选阿里云服务器配置?
本文详解通用型、计算型、内存型等实例适用场景,结合性能评估与成本优化策略,助力用户按需选择。以日均1万访问企业网站为例,2核4G+3M带宽月费约200元,性价比高。合理配置更省钱。
|
7月前
|
弹性计算
阿里云ECS云服务器8核16G配置收费价格,多种ECS实例CPU及费用清单
阿里云8核16G云服务器价格因实例类型而异。计算型c9i约743元/月,一年6450元(7折);通用算力型u1仅673元/月,一年4225元(5.1折)。实际价格享时长折扣,详情见ECS官网。
|
7月前
|
弹性计算 Windows
阿里云香港服务器收费价格:香港ECS和轻量应用服务器配置介绍
2025年阿里云香港服务器优惠汇总:ECS 2核4G+5M带宽仅199元/年;轻量服务器30M带宽24元/月起,200M峰值带宽25元/月起。轻量性价比高,适合个人及中小企业建站、跨境业务,具体配置价格详见官方活动页。
3596 1